Copied to clipboard

Flag this post as spam?

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


  • Graham Carr 277 posts 389 karma points
    Nov 12, 2014 @ 15:04
    Graham Carr
    0

    Multiple conditional arguments issue

    I am experiencing a problem with a Contour field that has four conditional fields associated with it, I am receiving a Javascript error saying

    TypeError: (contourFieldValuesbd7bc999e001499fbf2f6daa8cfbd51c["b0a3522d-4daa-47f1-8760-72107507afc6"] == "Contract amendment") is not a function


    When I view the source of the page and more specifically the generated conditional argument javascript I see the following:

    if(
        (
            (contourFieldValuesbd7bc999e001499fbf2f6daa8cfbd51c["b0a3522d-4daa-47f1-8760-72107507afc6"] != null &&
                    contourFieldValuesbd7bc999e001499fbf2f6daa8cfbd51c["b0a3522d-4daa-47f1-8760-72107507afc6"] == "Contract amendment"
            )
                    ||
            (contourFieldValuesbd7bc999e001499fbf2f6daa8cfbd51c["5a7d2a7d-a258-49f1-8901-37d80a18a892"] != null &&
                    contourFieldValuesbd7bc999e001499fbf2f6daa8cfbd51c["5a7d2a7d-a258-49f1-8901-37d80a18a892"] == "true"
            )
            ) &&
                (
            (contourFieldValuesbd7bc999e001499fbf2f6daa8cfbd51c["b0a3522d-4daa-47f1-8760-72107507afc6"] != null &&
                    contourFieldValuesbd7bc999e001499fbf2f6daa8cfbd51c["b0a3522d-4daa-47f1-8760-72107507afc6"] == "Contract amendment"
            )
            (contourFieldValuesbd7bc999e001499fbf2f6daa8cfbd51c["5a7d2a7d-a258-49f1-8901-37d80a18a892"] != null &&
                    contourFieldValuesbd7bc999e001499fbf2f6daa8cfbd51c["5a7d2a7d-a258-49f1-8901-37d80a18a892"] == "true"
            )
            ) &&
                                        (contourFieldValuesbd7bc999e001499fbf2f6daa8cfbd51c["b0a3522d-4daa-47f1-8760-72107507afc6"] != null &&
                    contourFieldValuesbd7bc999e001499fbf2f6daa8cfbd51c["b0a3522d-4daa-47f1-8760-72107507afc6"] == "Contract amendment"
            )
                    &&
            (contourFieldValuesbd7bc999e001499fbf2f6daa8cfbd51c["5a7d2a7d-a258-49f1-8901-37d80a18a892"] != null &&
                    contourFieldValuesbd7bc999e001499fbf2f6daa8cfbd51c["5a7d2a7d-a258-49f1-8901-37d80a18a892"] == "true"
            )
                    &&
            (contourFieldValuesbd7bc999e001499fbf2f6daa8cfbd51c["bebc9e5a-040c-4f91-b663-bde409eb1549"] != null &&
                    contourFieldValuesbd7bc999e001499fbf2f6daa8cfbd51c["bebc9e5a-040c-4f91-b663-bde409eb1549"] != "End"
            )
                    &&
            (contourFieldValuesbd7bc999e001499fbf2f6daa8cfbd51c["bebc9e5a-040c-4f91-b663-bde409eb1549"] != null &&
                    contourFieldValuesbd7bc999e001499fbf2f6daa8cfbd51c["bebc9e5a-040c-4f91-b663-bde409eb1549"] != "-"
            )
        )
    {
                $("#9619e9c8-fa35-47db-bda5-f97ed2a106e4").closest(".contourField").show();
                                
    }
    else
    {
                $("#9619e9c8-fa35-47db-bda5-f97ed2a106e4").closest(".contourField").hide();
    }

    You will notice that this does not look to be well formed, more specifically on line 14

     &&
                (
            (contourFieldValuesbd7bc999e001499fbf2f6daa8cfbd51c["b0a3522d-4daa-47f1-8760-72107507afc6"] != null &&
                    contourFieldValuesbd7bc999e001499fbf2f6daa8cfbd51c["b0a3522d-4daa-47f1-8760-72107507afc6"] == "Contract amendment"
            )
            (contourFieldValuesbd7bc999e001499fbf2f6daa8cfbd51c["5a7d2a7d-a258-49f1-8901-37d80a18a892"] != null &&
                    contourFieldValuesbd7bc999e001499fbf2f6daa8cfbd51c["5a7d2a7d-a258-49f1-8901-37d80a18a892"] == "true"
            )
            )

    You can see there is a closing bracket followed immediately by an open bracket with no && or ||?? The conditions that I have setup are shown in the screenshot attached:

    Any ideas, is this a bug and if so can it be resolved? The version of Umbraco is 6.0.5 and the Contour version is 3.0.23.WIP-Build.17

     

     

     

     

  • Comment author was deleted

    Nov 12, 2014 @ 15:06

    Must be a bug, I'll take a look and get back to you (should have a fix today/tomorrow)

  • Graham Carr 277 posts 389 karma points
    Nov 12, 2014 @ 15:08
    Graham Carr
    0

    Thanks Tim, that would be great and full marks for such a fast response!

  • Comment author was deleted

    Nov 12, 2014 @ 15:20

    Also tried with 4 conditions and it worked like expected, mind sending an export of the form (right click form and select export)? Then I should be able to reproduce

  • Graham Carr 277 posts 389 karma points
    Nov 12, 2014 @ 16:00
    Graham Carr
    0

    That's no problem, the only issue is that the form is a very large 17 page multi-step form with custom fieldtypes determining the next/prev page as we originally discussed on another post. Where should I send the form export which is particularly big?

  • Comment author was deleted

    Nov 13, 2014 @ 10:09

    Just send it to my email so tg at umbraco dot com, will see if I can reproduce the error then

  • Graham Carr 277 posts 389 karma points
    Nov 13, 2014 @ 10:28
    Graham Carr
    0

    Email with attachments has been sent to above address. Thanks.

  • Comment author was deleted

    Nov 13, 2014 @ 10:34

    Thanks, I'll keep you posted

  • Comment author was deleted

    Nov 13, 2014 @ 11:33

    Ok I can reproduce the behaviour, it's probably a bug with nested conditions, looking into a fix now

  • Graham Carr 277 posts 389 karma points
    Nov 13, 2014 @ 11:37
    Graham Carr
    0

    Thanks Tim, I am glad you managed to reproduce it.

  • Comment author was deleted

    Nov 13, 2014 @ 12:54

    Well actually I'm getting a different js error but think it will be related

  • Graham Carr 277 posts 389 karma points
    Nov 17, 2014 @ 16:14
    Graham Carr
    0

    Hi Tim,

    Did you manage to get any further in finding a resolution to this issue?

    Thanks.

  • Comment author was deleted

    Nov 18, 2014 @ 10:59

    Still in progress, hope to have it resolved this week

  • Graham Carr 277 posts 389 karma points
    Dec 03, 2014 @ 18:47
    Graham Carr
    0

    Hi Tim, any progress on this issue? The project I am working on has a deadline for two weeks time so could really do with a fix to this issue asap. thanks in advance.

  • Comment author was deleted

    Dec 05, 2014 @ 10:20

    Sorry it is taking a bit longer then expected (and had some other todos on my list) it's on my agenda for next week so I'll keep you updated

  • Comment author was deleted

    Dec 08, 2014 @ 10:29

    Ok found the issue, it's because you have setup an empty condition, of course this needs to be handled better by Contour so it isn't possible but for now you can simply remove or update that rule

    It's on the TLR1 allowance actual amount field on page 13

  • Graham Carr 277 posts 389 karma points
    Dec 08, 2014 @ 18:54
    Graham Carr
    0

    Hi Tim,

    Thanks for this, however I am a little confused as my form does not have a TLR1 allowance actual amount field on page 13, additionally I have checked all of the fields on that page and non of the conditions are blank. I have emailed you an export of the form again in case you have an older version.

    Thanks,

    Graham

  • Comment author was deleted

    Dec 09, 2014 @ 10:49

    Could you drop the following file in the /umbraco/plugins/umbracocontour/views/ directory and see if that fixes the issue?

    https://www.dropbox.com/s/sgdix4m439fxayd/Script.cshtml?dl=0

    Thanks,
    Tim 

  • Graham Carr 277 posts 389 karma points
    Dec 09, 2014 @ 11:09
    Graham Carr
    0

    Hi Tim,

    That seems to have fixed the issue, thanks very much for looking into it for me.

    Graham

  • Comment author was deleted

    Dec 09, 2014 @ 11:10

    Sweet, thanks for confirming!

Please Sign in or register to post replies

Write your reply to:

Draft