Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Content Item published before Custom Form submit event triggers #8795

Merged
merged 2 commits into from
May 17, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,13 @@ private ActionResult CreatePOST(int id, int contentId, string returnUrl, Action<

contentItem.As<ICommonPart>().Container = customForm.ContentItem;

// save the submitted form
BenedekFarkas marked this conversation as resolved.
Show resolved Hide resolved
if (customForm.SaveContentItem) {
conditionallyPublish(contentItem);
// Refresh content item
contentItem = _contentManager.Get(contentItem.Id);
BenedekFarkas marked this conversation as resolved.
Show resolved Hide resolved
}

// triggers any event
_rulesManager.TriggerEvent("CustomForm", "Submitted",
() => new Dictionary<string, object> { { "Content", contentItem } });
Expand All @@ -210,11 +217,6 @@ private ActionResult CreatePOST(int id, int contentId, string returnUrl, Action<
returnUrl = _tokenizer.Replace(customForm.RedirectUrl, new Dictionary<string, object> { { "Content", contentItem } });
}

// save the submitted form
if (customForm.SaveContentItem) {
conditionallyPublish(contentItem);
}

// writes a confirmation message
if (customForm.CustomMessage) {
if (!String.IsNullOrWhiteSpace(customForm.Message)) {
Expand Down