diff --git a/src/Orchard.Web/Modules/Orchard.CustomForms/Controllers/ItemController.cs b/src/Orchard.Web/Modules/Orchard.CustomForms/Controllers/ItemController.cs index a9e866d24a3..c1533953f50 100644 --- a/src/Orchard.Web/Modules/Orchard.CustomForms/Controllers/ItemController.cs +++ b/src/Orchard.Web/Modules/Orchard.CustomForms/Controllers/ItemController.cs @@ -198,6 +198,13 @@ private ActionResult CreatePOST(int id, int contentId, string returnUrl, Action< contentItem.As().Container = customForm.ContentItem; + // save the submitted form + if (customForm.SaveContentItem) { + conditionallyPublish(contentItem); + // Refresh content item + contentItem = _contentManager.Get(contentItem.Id, VersionOptions.Latest); + } + // triggers any event _rulesManager.TriggerEvent("CustomForm", "Submitted", () => new Dictionary { { "Content", contentItem } }); @@ -210,11 +217,6 @@ private ActionResult CreatePOST(int id, int contentId, string returnUrl, Action< returnUrl = _tokenizer.Replace(customForm.RedirectUrl, new Dictionary { { "Content", contentItem } }); } - // save the submitted form - if (customForm.SaveContentItem) { - conditionallyPublish(contentItem); - } - // writes a confirmation message if (customForm.CustomMessage) { if (!String.IsNullOrWhiteSpace(customForm.Message)) {