1.8.1 Widgets Should Publish on Creation - Code Included


That is my thought anyway after having used it for a couple of days. Here is where the code would be changed to make this happen:

Orchard.Widgets.Services.WidgetService --> CreateWidget method
            WidgetPart widgetPart = _contentManager.Create<WidgetPart>(widgetType,
                // EMS CHANGE - start
                // EMS CHANGE - end
                widget => {
                    widget.Title = title;
                    widget.Position = position;
                    widget.Zone = zone;
                    widget.LayerPart = layerPart;
Simply change it from "Draft" to "Published"
Closed Jan 8 at 7:33 PM by sebastienros


sebastienros wrote Jan 8 at 7:34 PM

This would break the new feature of Draftable Widgets. Maybe another method or overload could be used for this.

jao28 wrote Jan 8 at 8:00 PM

Yes it would... didn't know widgets were draftable. If that is the case, wouldn't they have the "Publish" button and thus I would not need my override / hack above?