Current status: Solved. . Done
Can't add new field
  • Using 3.5.4.1 on fresh WP 3.4.2 for my first install.
    Created a Group, saved.
    Added a field, saved, page refreshes, field has gone (not saved).
    Did i miss something ?
  • Hi @seb2nim,

    Sorry about this bug. I'm not sure what's happening here...
    Any chance you can create an admin account for me to look at?
    Please send the details to support@advancedcustomfields.com

    Cheers
    Elliot
  • I'm absolutely in the same situation. I have two repeater fields and everything is fine, I tried a third one, I updated the page and .. the field was saved (I see on in the fieldset number of fields) but when I enter in the editing field screen It shows me no fields to edit.. there should be one field in the attached screenshot..
    Schermata 12-2456275 alle 12.20.17.png
    1339 x 198 - 41K
  • @quirky Can u look in your database? I got a same problem and the field keys (field_XXXXXX) in the database contains some \r\n. Try to remove them.
  • Hi @Knoobie,

    I am aware of your issue but it seems to be specific to only a handful of people/ Can you try updating to the latest nightly build here: https://github.com/elliotcondon/acf/

    Does that help? If not, I can write some JS to make sure there is no \r\n\ saved to the field name

    Cheers
    Elliot
  • @admin It doesn't help to refresh the old fields. The new field didn't get the \r\n but the old fields (where it was removed from the db get the \r\n back) See our other discussion with my first screenshot attachment. Is this related?
  • Just add this in controllers/field_group.php at line 651, just before the update_post_meta() call:
    $field['key'] = preg_replace('/\s+/', '', trim($field['key']));


    This will strip all the new lines and extra spaces who might screw the query and therefore hide fields
  • I'm not sure if this is related, but I also ran into a bug this afternoon trying to add a new field. In my case, the fields were being created and were appearing on the edit form for posts, but not saving the post meta data.

    I tracked the issue down to an entry in the wp_options table called "acf_next_field_id", which apparently was not there the last time I added a field (which was some time ago, so I have no idea what version it was added in). As soon as I created a new field, a value of "2" was inserted for that key. Since a field 2 already existed on my site, ACF was getting itself confused as to what field I was trying to save the data to.

    I incremented the value to 98 (the next index that should have been created for fields on my site) and now it's working fine.
  • Hi @Soraph,

    I've added this in to the latest build

    Cheers
    Elliot
  • i am having similar problems can't add field to new and existing field groups. I added Soraph's code snippet
    $field['key' ] = preg_replace('/\s+/' , '' , trim($field['key' ]));
    but no show. Any ideas?
  • just did a clean install of wp and advanced custom field plugin. can't add fields.
  • The problem was with my theme. The plugin is working fine.