Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Christian Palm 277 posts 272 karma points
    Sep 30, 2010 @ 12:58
    Christian Palm
    0

    Bug: Workflow with a setting crashes in "When the form has been Opened" state

    Hi

    We are trying to create a workflow which can mark all checkboxes on a checkboxlist in the workflow state "When the form has been Opened".

    You can not use a workflow with a setting on "When the form has been Opened" state.

    This is the simple test workflow:

    namespace Upac.CampaignMonitor.ContourExtensions
    {
    using System;
    using System.Collections.Generic;
    using Umbraco.Forms.Core;
    using Umbraco.Forms.Core.Enums;

    public class CheckCheckBoxListWorkflow : WorkflowType
    {
    #region Constructors

    public CheckCheckBoxListWorkflow()
    {
    Name = "Check all checkboxes on a checkboxlist";
    Description = "This workflow will check all checkboxes in a checkboxlist fieldtype.";
    Id = new Guid("1387A641-3143-4dbd-8DEB-CB0430164E01");
    }

    #endregion Constructors

    #region Properties

    [Umbraco.Forms.Core.Attributes.Setting("Test", description = "This is a test", control = "Umbraco.Forms.Core.FieldSetting.TextField")]
    public string Checkboxlist
    {
    get;
    set;
    }

    #endregion Properties

    #region Methods

    public override WorkflowExecutionStatus Execute(Record record, RecordEventArgs e)
    {
    return WorkflowExecutionStatus.Completed;
    }

    public override List<Exception> ValidateSettings()
    {
    return new List<Exception>();
    }

    #endregion Methods
    }
    }

    When the workflow is attached it will only render previous/next buttons and not the UI of the form. And there is no wizard step in the form. There is no warning or error in the log.

    If you preview the form you will get an exception

    [NullReferenceException: Object reference not set to an instance of an object.]
       Umbraco.Forms.Data.StringHelper.parseRecordPlaceholders(String value, Record record) in d:\TeamCity\buildAgent\work\e4473b9ec9597356\Umbraco.Forms.Core\Data\StringHelper.cs:110
       Umbraco.Forms.Data.StringHelper.ParsePlaceHolders(HttpContext Context, Record record, String value) in d:\TeamCity\buildAgent\work\e4473b9ec9597356\Umbraco.Forms.Core\Data\StringHelper.cs:148
       Umbraco.Forms.Core.Services.WorkflowService.ExecuteWorkflows(List`1 workflows, RecordEventArgs e) in d:\TeamCity\buildAgent\work\e4473b9ec9597356\Umbraco.Forms.Core\Services\WorkflowService\WorkflowService.cs:136
       Umbraco.Forms.Core.Services.WorkflowServiceApplication.FormService_FormEvent(Object sender, RecordEventArgs e) in d:\TeamCity\buildAgent\work\e4473b9ec9597356\Umbraco.Forms.Core\Services\WorkflowService\WorkflowService.cs:71
       Umbraco.Forms.Core.Services.RecordService.Open() in d:\TeamCity\buildAgent\work\e4473b9ec9597356\Umbraco.Forms.Core\Services\RecordService\RecordService.cs:105
       Umbraco.Forms.UI.Usercontrols.RenderForm.GetCurrentService() in d:\TeamCity\buildAgent\work\e4473b9ec9597356\Umbraco.Forms.UI\Usercontrols\RenderForm.ascx.cs:465
       Umbraco.Forms.UI.Usercontrols.RenderForm.OnInit(EventArgs e) in d:\TeamCity\buildAgent\work\e4473b9ec9597356\Umbraco.Forms.UI\Usercontrols\RenderForm.ascx.cs:263
       System.Web.UI.Control.InitRecursive(Control namingContainer) +333
       System.Web.UI.Control.AddedControl(Control control, Int32 index) +198
       System.Web.UI.ControlCollection.Add(Control child) +80
       Umbraco.Forms.UI.Dialogs.previewFormDialog.OnInit(EventArgs e) in d:\TeamCity\buildAgent\work\e4473b9ec9597356\Umbraco.Forms.UI\Dialogs\previewFormDialog.aspx.cs:38
       System.Web.UI.Control.InitRecursive(Control namingContainer) +333
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +378
    

    If you remove the setting it will work.

    Can you please confirm the bug or is it by design not possible to have a workflow with a setting in the "When the form has been Opened" state.

  • Comment author was deleted

    Sep 30, 2010 @ 14:29

    Hmm looks like the settings aren't set yet, adding this to our issue tracker, will be fixed in next maintenance release.

  • Dean 55 posts 98 karma points
    Mar 10, 2011 @ 23:31
    Dean
    0

    Hi Tim,

    I've got this same issue stopping me moving forward on my project. Just wondering when the maintenance release will be due. And if it is far off, is there a way I can get around it.

     

    Thanks

    Dean

Please Sign in or register to post replies

Write your reply to:

Draft