|
|
I can see that BodyPart on a content type gets versioned (specifically a Page), but the same doesn't seem to happen on an HtmlWidget.
Can someone give me a pointer to where I can find the code that is doing the versioning on BodyPart on a Page so I can get it working on HtmlWidget (as well as others) too?
Ta muchly
Rich
|
|
|
|
In a Migration you can use:
ContentDefinitionManager.AlterTypeDefinition("HtmlWidget",cfg=>cfg.Draftable());
This enables versioning for that content type. You can use Draftable(false) to disable versioning.
|
|
|
|
Thanks, i've just tried that out but it doesn't seem to have worked, all it has done is add a "Publish Now" button between save and delete when editing the widget, but clicking save doesn't create an extra record in Common_BodyPartRecord like it does when
you do the same thing for a page.
Any more ideas?
Thanks
Rich
|
|
Coordinator
Feb 16, 2012 at 11:11 PM
|
What version of Orchard is that? This only became supported relatively recently.
|
|
Feb 16, 2012 at 11:53 PM
Edited Feb 16, 2012 at 11:55 PM
|
1.3.10 source, downloaded today.
Looking at the source of the Contents AdminController, the following is called in the EditPOST method:
var contentItem = _contentManager.Get(id, VersionOptions.DraftRequired);
Which eventually calls BuildNewVersion in the DefaultContentManager which looks like it creates the new version, but in Widgets AdminController in the EditWidgetSavePOST method it does not seem to do anything similar and just calls UpdateEditor on the
ContentManager.
Is that likely to be the reason?
|
|
Coordinator
Feb 16, 2012 at 11:56 PM
|
Please try with the latest in the 1.x branch.
|
|
|
|
Ok will do
|
|
|
|
I've tried with the latest up to rev 5980, same result, editing the widget just saves to the existing bodypart record, rather than creating another
|
|
Coordinator
Feb 17, 2012 at 3:37 AM
|
Well, I was pretty sure this was in, but I guess I was wrong. Please file a bug.
|
|
|
|
Hi,
v1.4.0.0 exhibits the same behaviour. I'd be very grateful if there was an update on this or a recommended patch I can make to our code.
Thanks
|
|
|
|
FYI the related work item is at:
http://orchard.codeplex.com/workitem/18443
|
|