I have a multisite installation where subsites have child themes of the theme on the primary site. I am using the local json feature to reuse the fields within these child themes, however I have run into an issue with sub_fields of either repeater or flexible_layout fields.
Sub fields that use ajax queries (such as post_object which calls acf/fields/post_object/query), will result in errors when running the query.
During the request, acf_get_field will return null because acf_local()->fields does not have a key for the sub field. I wrote the following to fix the issue for my site: