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

Changes required to implement workflow logic on Before and After event #48

Closed
Closed
Changes from all commits
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
15 changes: 12 additions & 3 deletions Source/Solution/FormEditor/FormModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ public class FormModel

private const string FormSubmittedCookieKey = "_fe";

private IEnumerable<Page> _pages;
public IPublishedContent CurrentPublishedContent { get; private set; }

private IEnumerable<Page> _pages;
private IEnumerable<Row> _rows;

#region Properties configured in the form editor
Expand Down Expand Up @@ -100,6 +102,9 @@ public bool CollectSubmittedValues(bool redirect = true)

public bool CollectSubmittedValues(IPublishedContent content, bool redirect = true)
{

this.CurrentPublishedContent = content;

// currently not supporting GET forms ... will require some limitation on fields and stuff
if(Request.HttpMethod != "POST")
{
Expand Down Expand Up @@ -317,6 +322,8 @@ private IPublishedContent RequestedContent
{
get
{
if (null != this.CurrentPublishedContent) return this.CurrentPublishedContent;

if(Context == null || Context.PublishedContentRequest == null || Context.PublishedContentRequest.PublishedContent == null)
{
return null;
Expand All @@ -325,9 +332,11 @@ private IPublishedContent RequestedContent
}
}

#region Stuff for backwards compatibility with v0.10.0.2 (before introducing form pages) - should probably be removed at some point


#region Stuff for backwards compatibility with v0.10.0.2 (before introducing form pages) - should probably be removed at some point

private void EnsurePagesForBackwardsCompatibility()
private void EnsurePagesForBackwardsCompatibility()
{
if(_pages == null && _rows != null)
{
Expand Down