Support

Account

Home Forums Bug Reports Field type "group" doesn't return null if unset

Solved

Field type "group" doesn't return null if unset

  • Hi there!

    I have found a serious bug in the latest Version of ACF (5.11.1) that breaks central logic that I am using in many of my sites. If calling get_field on a field of type group in a post that hasn’t been saved since the field was created, it used to return null (and I’m counting on this behavior).

    Now it returns an array of it’s sub fields (keys) with empty strings:

    
    array(2) {
      ["field_619a9a537c084"]=>
      string(0) ""
      ["field_619a9a5a7c085"]=>
      string(0) ""
    }
    

    I really hope that is not supposed to be a feature, since this would lock many of my sites in ACF version <= 5.11.

    ACF convention was to always return null on unsaved fields, no matter the field type.

    Hope we can resolve this.

  • Hey Rasso,

    Thanks for the report here, I’ve confirmed the behaviour you’ve described.

    We’ll look into this ASAP and I’ll get back to you once I have a fix or workaround.

  • Hey @rasso

    We made changes in ACF 5.11.2 which should resolve this issue.

  • Hey @lgladdy ,

    that sounds good, thanks so much! Looking forward to test it out 🙂

  • …just tested the latest Version (5.11.3) and I can confirm that this issue is fixed. Thank you!

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

You must be logged in to reply to this topic.