• Resolved apexdivision

    (@apexdivision)


    Hi

    I have ACF custom group and post type. And mapped with a contact form. The form has text, textarea, select and radio, all these types of fields.

    Everything was working earlier, but recently for the select fields, its alwasys the first value that gets saved in cpt data.

    If I change the ACF type to text, it saves the selected data, but makes whole value to lower case, space removed.

    WP: 6.4 / php 8.2 / ACF 6.2.2 / Post CF7 form 6.0.5

    CF7 form select options are exactly same as defined in ACF. No value:label used, value and label is same in both placed.

    Any help will be highly appreciated.

    Thank you

    Nir Banerjee

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Aurovrata Venet

    (@aurovrata)

    Here is one way to debug this kind of issue,

    1. Duplicate your form into a test form.
    2. Map this test form to a custom post created by the Post My CF7 Form plugin (not one created usign ACF), and if you map them to post meta fields, create new ones for that too.
    3. Submit the test form and check if the values were saved properly.

    let me know the results

    Thread Starter apexdivision

    (@apexdivision)

    Hi,

    Yes, it worked fine, but we will have to use the ACF CPT because it is used from other API as well.

    Worst case scenario we have to use wpcf7_before_send_mail hook.

    Thank you,

    Nir

    Plugin Author Aurovrata Venet

    (@aurovrata)

    Everything was working earlier, but recently for the select fields, its alwasys the first value that gets saved in cpt data.

    I can only guess that something changed with ACF, its likely expecting the value in a certain format. You’ll need to grammatically save the value of your field in the format ACF expects it.

    Thread Starter apexdivision

    (@apexdivision)

    Yes, it’s ACF issue it seems. Even directly editing post meta does not affect for select fields.

    I will update here, if I find anything, which can be used for future version of this plugin.

    Thread Starter apexdivision

    (@apexdivision)

    Is this project in github?

    Plugin Author Aurovrata Venet

    (@aurovrata)

    I will update here, if I find anything, which can be used for future version of this plugin

    great. However I am sure there is a way to fix this programmatically with a hook. A number of users have complained in the past about ACF and uploaded images mapped to meta fields for which I have introduced a specific hook to programmatically ensure the correct format for ACF.

    Is this project in github?

    yes, currently developing v5 of the plugin is you have time to test, all help is welcome.

    Thread Starter apexdivision

    (@apexdivision)

    Thank you.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘ACF Select mapping always saves the first option value’ is closed to new replies.