• Resolved Pemptus

    (@pemptus)


    Hi,
    I’m having another problem with the “save draft” feature. It seems that it doesn’t save fields that have the visibility condition dependant on a checkbox. For example, I have a checkbox with the option “yes”, then a field (any field) that has the visibility condition:
    Show this field if all of the following rules match:
    checkbox is yes.

    The condition works and the field is displayed upon checking the checkbox, but the contents of field are simply not saved, which is a problem. If I remove the condition, everything saves normally.

    It seems the problem is just with checkboxes – it works as expected with radio buttons.

    Please have a look at this – it throws a wrench into the whole project. Some workaround, perhaps?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Zafer – WPMU DEV Support

    (@wpmudevsupport15)

    Hi @pemptus,

    I hope you are doing well today!

    Please share the link where the form is and also an export of the form with us, so that we can check further.

    You can find more info on how to export the form here : https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#import-export

    After exporting, please share the code using a service such as https://pastebin.com which is free to use.

    Please always make sure to use such service to share the code and don’t post the code here directly as it will most likely be unusable.`

    Kind regards,
    Zafer

    Thread Starter Pemptus

    (@pemptus)

    Hi @wpmudevsupport15,
    I can’t exactly share the link, since I’m doing the testing on localhost. I did just test it out on a server, though, so the problem’s universal. I quickly whipped up this form: https://pastebin.com/dkeZe5ZD – put it in, try to write something in the text field and see if it gets saved when “save as draft” is used.
    You can exchange the text field for any other field.

    Plugin Support Dimitris – WPMU DEV Support

    (@wpmudev-support6)

    Hello @pemptus

    I was able to replicate the same with the free v.1.17.2, while the latest pro v.1.18, which will also be released soon here in the free version, fixes the issue.

    I pinged our developers in case there’s any workaround we could provide meanwhile. ??

    Thank you,
    Dimitris

    Plugin Support Dimitris – WPMU DEV Support

    (@wpmudev-support6)

    Hello @pemptus

    As mentioned before, this is a confirmed issue that will be fixed in the upcoming v.1.18. Meanwhile, you can try to change the checkbox option values to small case letters and then re-select visibility conditions in all the dependent fields because checkbox values are changed now. Or you can edit the library/abstracts/abstract-class-field.php plugin file and around line 1012, replace
    if ( is_string( $form_field_value ) ) {
    with

    if ( is_array( $form_field_value ) ) {
    	$form_field_value = array_map( 'strtolower', $form_field_value );
    } else if ( is_string( $form_field_value ) ) {

    Please first try this in a staging/testing site.

    Thank you,
    Dimitris

    Thread Starter Pemptus

    (@pemptus)

    Hi,
    Good stuff, thanks. The file modification works, as does just using lower case letters for the checkbox.
    Glad to hear it’s getting a proper fix soon.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Save draft bug – visibility conditional with checkboxes’ is closed to new replies.