Copied to clipboard

Flag this post as spam?

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


  • Thomas 18 posts 39 karma points
    Mar 12, 2012 @ 21:44
    Thomas
    0

    Umbraco contour fields dont clear after sending

    Hi, I have a strange problem with umbraco contour v1.1.9.

    I have a contour form that after submitting the form retains the values previously submitted.

    This has only just started happening after updating to v1.1.9.

    Any help would much appreciated.

    Regards,

    Tom

  • Comment author was deleted

    Mar 13, 2012 @ 16:33

    Are you running on older verison of umbraco (older then 4.7)? If so try disabling the form caching in the contour config file (/umbraco/plugins/umbracocontour/umbraccontour.config)

    that should resolve the issue

  • Thomas 18 posts 39 karma points
    May 12, 2012 @ 12:17
    Thomas
    0

    Hi Tim,

    yes im running uumbraco 4.0.3.

    No, that didnt solve the issue im afraid.

    Any other ideas at all please?

    Regards,

    Tom

  • Comment author was deleted

    May 16, 2012 @ 14:23

    Try touching the web.config after making the change to the file... 

  • Melissa 1 post 21 karma points
    May 24, 2012 @ 21:04
    Melissa
    0

    Hello,

    I am experiencing this same issue on a client's website. I have already tried disabling caching in Contour's config file. There was no exisiting DisableFormCaching setting in the file, so I added the following line:

    <setting key="DisableFormCaching" value="True" />

    I also touched the web.config file after making these updates. The form fields were cleared after making these updates initally, but after submitting the form, the problem re-emerged. 

    Do you have any other suggestions on what I can do to resolve this?

  • Jan Brinker 77 posts 103 karma points
    Mar 04, 2013 @ 14:49
    Jan Brinker
    0

    Sorry for heating up old threads, but is there any solution coming up? I have the exact same problem as Thomas and Melissa.

    I'm running Umbraco 4.11.4 and Contour 3.0.7 locally for development via WebMatrix.

    Disabling the caching in the UmbracoContour.config didn't work, I also tried touching the web.config and restarting the whole server. No workey. I also tried invalidating cookies with a solution you posted here: http://our.umbraco.org/forum/umbraco-pro/contour/15322-Contour-Caching-Form-Values-on-a-Multi-Step-Form-How-to-Clear?p=2

    The cache-disabling does not seem to work properly, since every time I touch the web.config the new values are taken and processed, however on the second and following tries the values I entered the first try keep coming up. Oddly enough, the new values get saved to the database, I can inspect them in the backend, however they get somehow discarded and replaced with the cached values at some point. Inside of my custom workflow in the Submitted-area I only get old values to work with.

  • Comment author was deleted

    Mar 04, 2013 @ 15:30

    @Jan, you sure there aren't any default values setup?

  • Jan Brinker 77 posts 103 karma points
    Mar 04, 2013 @ 15:41
    Jan Brinker
    0

    Hi,

    yes I am sure. I always only get exactly those values that I set in my first submit. On all consecutive submits, no matter what values I chose, in my custom workflow I always get the old ones.

    Then I touch the web.config, use other values, it works again on my first try and then the same problem again for the coming submits.

  • Comment author was deleted

    Mar 04, 2013 @ 15:56

    Strange, and are you using the razor or the usercontrol macro for the contour form?

  • Jan Brinker 77 posts 103 karma points
    Mar 04, 2013 @ 15:59
    Jan Brinker
    0

    I'm using the usercontrol-macro.

  • Comment author was deleted

    Mar 04, 2013 @ 16:04

    Ok made some changes recently that could have effect could you try updating the Umbraco.Forms.Providers.dll from http://nightly.umbraco.org/Umbraco%20Contour/3.0.8/UmbracoContour_3.0.8_update.zip

  • Comment author was deleted

    Mar 04, 2013 @ 16:05

    What version of Contour are you running now? you might need to update Contour and not only the providers.dll

  • Jan Brinker 77 posts 103 karma points
    Mar 04, 2013 @ 16:23
    Jan Brinker
    0

    I just tried using the patch on my installation, I replaced all files and made sure that DisableFormCaching is set to True. But it didn't have any effect.

     

    Could it be that the problem is caused by having Umbraco run locally and Contour still being in trial mode? No idea about the inner workings of Contour, might be a shot in the dark, but as I have seen that disabling the cache worked for others as seen on other threads..

  • Comment author was deleted

    Mar 04, 2013 @ 16:47

    Strange will see if I can reproduce

  • Jan Brinker 77 posts 103 karma points
    Mar 04, 2013 @ 17:00
    Jan Brinker
    0

    Thanks a lot for your help. Will leave work in a few minutes, will come back tomorrow morning to pick up our search for the solution.

  • Comment author was deleted

    Mar 05, 2013 @ 09:44

    Could you try attaching the email workflow and check if that also always sends to old values, thanks :)

  • Jan Brinker 77 posts 103 karma points
    Mar 05, 2013 @ 10:18
    Jan Brinker
    0

    This is VERY interesting.

    When using the email workflow on submit, right before my custom workflow, I always get the right values in my email inbox.

    I even check my values in my workflow per

    foreach (RecordField rf in record.RecordFields.Values)
    {
    recordsString += rf.Values[0].ToString() + ";";
    }

    and by looking at the resulting string. I definitely always get exact the same values once I filled out the form. The values I get only change once I touch my web.config, restart the server etc to manually flush all caches Umbraco has.

    Very interesting. Any ideas?

  • Comment author was deleted

    Mar 05, 2013 @ 10:24

    Hmm so that one works correctly, mind sharing the code for your custom one

  • Jan Brinker 77 posts 103 karma points
    Mar 05, 2013 @ 11:06
    Jan Brinker
    0

    I had to wrap it up into a package and I'm about to send it to you via Email. Tried putting the code in here, but due to some output with html-code it drops tags and breaks the <pre> etc.

    Basically it is a modified version of the Score Calculator you posted on your blog once: http://www.nibble.be/?p=83

  • Comment author was deleted

    Mar 05, 2013 @ 11:13

    Ok thanks I'll take a look then :)

  • Jan Brinker 77 posts 103 karma points
    Mar 05, 2013 @ 13:41
    Jan Brinker
    0

    Another interesting thing I just found out.

    Fetching the values with

     foreach (RecordField rf in record.RecordFields.Values)

     Results in getting the old values for me.

    HOWEVER if I get the values the same way as it is handled in the email workflow everything works and I get the new entries. I just found that out by copying the code from the email workflow into my own. However getting the data via XPathNodeIterators doesn't seem to be as comfortable as just looping through the values. It seems that the core of the problem lies somewhere in the way the values are fetched like they are in the foreach seen above.

     

  • Comment author was deleted

    Mar 05, 2013 @ 13:58

    Hi Jan,

    Debugged your code and I can see the behaviour and it is the following line causing it:

    RedirectHandler redHandler = new RedirectHandler("http://testenvironment.is/" + queryString);
    

    The querystring var is always populated with the latest values but the resulting redirect happens with the first submitted values

    If you replace that line with

     HttpContext.Current.Response.Redirect("http://testenvironment.is/" + queryString);
    

    It works

    So the error is in your RedirectHandler...

     

     

  • Comment author was deleted

    Mar 05, 2013 @ 14:02

    So in your redirecthandler you are doing the following

     RecordService.RecordApproved += new System.EventHandler<RecordEventArgs>(RecordService_RecordApproved);
    

    So you add a new eventhandler to the record approved event but of course already added handlers will execute first so that's why you always get redirected with the first values

    Make sense?

  • Jan Brinker 77 posts 103 karma points
    Mar 05, 2013 @ 14:09
    Jan Brinker
    0

    Ahhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh.

    Ha.. interesting :D

    thanks! A LOT! Never figured that that the redirecting event would be set permanently like that.

    Again, thank you very much for your help!

  • Comment author was deleted

    Mar 05, 2013 @ 15:18

    Great, glad it's solved :)

Please Sign in or register to post replies

Write your reply to:

Draft