• Resolved nige mcilwaine

    (@nige-mcilwaine)


    Hi,

    I thought I had contacted support about this last week but I may have forgotten to. I was editing the the Single Use Booking Form 2023 on the above page last week, I wanted to wrap the Booking Details section in a group of its own so I hide it initially, but when added the group tags and pressed save/publish it deleted all of the Condtional Rules I had created previoulsy. (Luckily I was able to restore a backup of the Database) I do have around 50 rules which might be part of the problem, but I could’nt go into text mode before the rules were deleted?!

    What can I do to edit this form, I need to make changes but I dont want it all to break again?

    cheers

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter nige mcilwaine

    (@nige-mcilwaine)

    Hi,

    Just wondering if anyone is able to look into this for me.

    Thanks

    Plugin Author Jules Colle

    (@jules-colle)

    That’s weird. Can you set up your form here https://conditional-fields-cf7.bdwm.be/form-tester/ so I can have a closer look?

    Thread Starter nige mcilwaine

    (@nige-mcilwaine)

    Hi,

    I’ve done that for you. https://conditional-fields-cf7.bdwm.be/form-tester/?hash=6647001d9f45ff36b7f042ed12328a3e

    The problem wont occure there though. The form works fine as it is, the problem is when I try to edit the form, for example add another [group] tag round something so I can then hide and show it, when I go to edit the conditional logic the first column (Show “”) is saying –Select Group– on everyone of arround 50 conditions. Adding a [group] tag to the front end and saving is basically deleteing all my conditions?! To get them back I have restore a database backup from the server.

    cheers

    Plugin Author Jules Colle

    (@jules-colle)

    While modifying your form you need to make sure that the form is valid. If you edit your form and you forget to place a closing [/group] tag at the corresponding place, it’s possible that Conditional fields will not be able to scan your tags properly.

    At line 128 for example you have a [/group] tag, but at that point there isn’t a group open yet, so there will be a parsing error.

    CF7 and Conditional Fields are plugins for users with a solid understanding of HTML. If that’s not your cup of tea, you could look into more end-user oriented plugins like ninja forms or gravity forms

    I’ve been using this for years and now having the same problem.

    I create a new group and save it. Then go to conditional fields tab and add the group and save it. Then the group disappears. Ive tried on a few different forms and the same thing on all them.

    But the conditional fields still work on my other forms that I have not edited again.

    Plugin Author Jules Colle

    (@jules-colle)

    OK, I tested this again today, and the only times when this seems to happen is when you actually change the names of a group or a field, or if you enter more than one space between [group and the name.

    It also happens when you delete your form code, then loose focus of the form code, and then paste in the same form again.

    The conditions tab is updated every time the ‘change’ event is triggered on the form input field. So this means that any time you make a change to the form, and then you change focus from the form to anywhere else, the conditions tab scans the form and fills the select boxes with the fields and groups that are available in the form at that point. It’s possible that at this point the fields and groups that you entered earlier are no longer present in the form, so the selected option does not exist, and it becomes empty (or -1 in text view).

    Adding the fields again later will have no effect, because the field is already set to empty at this point.

    Hope this makes a bit of sense. If you believe that the error is happening by simply adding a group, I’d like to see a screen recording of this happening, so I can reproduce the exact steps.

    Thread Starter nige mcilwaine

    (@nige-mcilwaine)

    Hi,

    My understganding of html is pretty solid tbh, I’ve been doing this for a while, you mentioned a [/group] tag at line 128 that didn’t have an opening tag, my bad, whilst the inclusion of this tag didn’t stop the form working, deleting it and saving the form caused the first two colunms of the conditions to be deleted aswell. I didn’t change any group names, just deleted a closing tag.

    I have created and uploaded a video of the original issue, hopefully this helps. https://denbighshireleisure.co.uk/wp-content/uploads/2023/08/conditions.webm you can see that the conditions are all there untill I click into the form editor on the form tab, I dont even add anything or save anything before returning to the conditions tab to see that the conditions have been deleted. I dont add, edit or delete anything for the conditions to disappear.

    cheers

    Plugin Author Jules Colle

    (@jules-colle)

    OK. I can confirm that there is a bug when you have exactly 50 conditions. The problem doesn’t seem to appear when you have 49 or 51 conditions. So the fix I would suggest for now is to switch to text mode and add another condition to your form, just a nonsensical line like this is okay:
    show [-1] if [-1] equals ""

    Will follow up on this issue here: https://github.com/pwkip/contact-form-7-conditional-fields/issues/109

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Conditional Logic getting deleted’ is closed to new replies.