Home Forums Feature Requests Local fields defined by PHP : better debug


Local fields defined by PHP : better debug

    • Nubee

    • July 16, 2019 at 1:43 am

    I wish ACF provided error messages for local fields. It would help debugging faulty fields much easier.

    For instance, if you accidentally define two fields with the same unique field key, the first issue you run into is “PHP reached max execution time” or “PHP reached max memory allocation”. I wish ACF would directly throw and error and tell me “Field XYZ tried to use unique field key ABC, but it was already taken by field DEF”.

  • You can use ‘get_field_object($field_key)` to see if a field is already defined. However, as I mentioned in your other topic, this will not work if a field has not already been defined in some other php code and will be defined later.

    • Nubee

    • July 16, 2019 at 11:57 pm

    That’s pretty hard to use when you’re defining whole field groups in a single array though.

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

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.