Publishing from the Details View

Posted by Community Admin on 04-Aug-2018 18:43

Publishing from the Details View

All Replies

Posted by Community Admin on 28-Mar-2012 00:00

Hello,

I've recently been working through the creation of a Locations module. I've implemented the Content Lifecycle into the module, and thought it was working. I have a "publish" button that appears when all of my module items are listed out, and clicking it does cause the publish event to occur. However, I've added a button to my details view for my module, in the definitions file, as so:

toolbarSectionElement.Items.Add(new CommandWidgetElement(toolbarSectionElement.Items)
            
                Name = "SaveChangesWidgetElement",
                ButtonType = CommandButtonType.Save,
                CommandName = DefinitionsHelper.PublishCommandName,
                Text = (isCreateMode) ? String.Concat("Create Location") : "Publish",
                WrapperTagKey = HtmlTextWriterTag.Span,
                WidgetType = typeof(CommandWidget)
            );

The button appears, however, whenever I click the publish button, I get a JS popup that says "Operation 'publish' is not supported at this time". Is there something I'm doing incorrectly in the above code that is causing this? I attempted simply passing "publish" instead of DefinitionHelper.PublishCommandName, but that had the same results. Any ideas why this error keeps popping up for me?

Posted by Community Admin on 02-Apr-2012 00:00

Hi,

Can you please let us know of the exact steps you have taken for reproducing the issue. It looks like the exception might be thrown on purpose (i.e. to notify that usage of this functionality is not intended in that particular item state), however I'd like to investigate this behavior further. Thanks in advance for your kind cooperation.

Regards,
Boyan Barnev
the Telerik team

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 02-Apr-2012 00:00

Unfortunately, I cannot give a step-by-step breakdown, as this question was posted last week, and I can't accurately retrace my steps. I can tell you that I implemented the Content Lifecycle into my module, by way of following the Agents module in the SDK. I've put my item into a "Draft" status, by Saving it from my details page. Then, If I attempt to publish from the details screen it says "Operation 'publish' is not supported at this time". However, If, instead of going to the details form, I use the "publish" link from the listing, it does publish as expected. This behaviour persists when the item status is "Unpublished" as well.

When adding the action item for publish to the listing, I simply added a line, like the following, to my definitions class:
actionsColumn.MenuItems.Add(DefinitionsHelper.CreateActionMenuCommand(actionsColumn.MenuItems, "Publish", HtmlTextWriterTag.Li, "publish", "Publish", string.Empty));

Similarly when adding the functionality to the details view, I simply pasted the code I had in my previous post.

Does that give you any additional information? Is there anything else I can provide?

Posted by Community Admin on 03-Apr-2012 00:00

Looking at the SDK products module, it seems that it doesn't use Publish in this context. So, does Sitefinity require that a save be done, then a publish be called from the listing?

Is there more information you need that I can offer? Would you like copies of my classes? I can certainly make that available if it will expedite the support process. 

This thread is closed