Support

Account

Home Forums Add-ons Repeater Field Repeater with same name as other field throws error after saving

Solved

Repeater with same name as other field throws error after saving

  • If you accidentally use the same name (slug) for a repeater and another field (e.g. a text-field), you’ll get two php warnings after saving (publishing) the record and data are not shown.

    There is NO warning from ACF that the name is used twice (-> feature request!).

    Costed me 4 hours to find out …

    Warning: array_key_exists() expects parameter 2 to be array, string given in /var/home/homepage-paket_com/albatros/albatros/wp-content/plugins/advanced-custom-fields-pro/pro/fields/repeater.php on line 124
    
    Warning: Invalid argument supplied for foreach() in /var/home/homepage-paket_com/albatros/albatros/wp-content/plugins/advanced-custom-fields-pro/pro/fields/repeater.php on line 255

    Anyway … ACF is very cool tool! Love it!

  • Hi @sternsbergerm

    Thank you for bringing this issue to our attention.

    It is always recommended to use unique field names for your fields, however the idea of a validation warning for duplicate field names sounds neat and I will pass this on to Elliot.

    Hopefully this will see it way into the plugin sometime soon 🙂

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Repeater with same name as other field throws error after saving’ is closed to new replies.