After updating from 5.7.10 to 5.8.0, I get the follow notice:
Notice: Undefined index: key in /plugins/advanced-custom-fields-pro/includes/acf-field-functions.php on line 349
It doesn’t seem to cause any issues other than throwing the notice. Any insight on how to resolve this?
ACF Pro version: 5.8.0
PHP version: 7.1.20
ACF Implementation: Flexible content component using cloned ACF field groups as layouts.
I didn’t update to 5.7.11 because of the issues outlined in the following thread: (Update 5.7.11 Crashes Site) https://support.advancedcustomfields.com/forums/topic/update-5-7-11-crashes-site/
The site no longer crashes, but the
Notice is still an issue.
Notice: Undefined index: key in .../acf-field-functions.php on line 349
I switched off the WP_DEBUG_DISPLAY for now.
I opened a support ticket and got a response from the ACF team stating that they could not recreate the issue. At this point, I’ve just turned debug logging off as well.
Thanks for the info.
I’ve got over 60 field groups, some of them are flexible fields with several of the other field groups as clones inside their flexible field layouts.
Notices started to pop up after I’ve duplicated the field groups via WPML (WordPress Multilingual Plugin) functionality to make the field groups available in other languages.
I did not consider the hierarchy of the fields while duplicating them. Meaning: I should have duplicated the ones which are used as clones first. And only after duplicating all the basic field groups I should have started with duplicating the rather complex ones.
–> Might be the reason why I get these notices now.
The line that’s causing your issue indicates that the field group does not have a key, which should be impossible.
As far as the duplicated groups for wpml and clone field. I don’t know how this works, but it could be that the duplicated groups that include cloned groups the key of the cloned group was not set correctly. I would try to edit these duplicated groups and check the clone field, maybe updating these will work?
Thanks for your answer. Updating the fields didn’t help, so I went full circle:
When I ditched the database and kinda “started from scratch” concerning the db (synchronizing all fields from the json files), the errors did not occur again.
So I’m guessing: Might have been a minor glitch which might have nested itself in the db when I duplicated the fields into another language.
–> Somewhere there/towards your assumption:
it could be that the duplicated groups that include cloned groups the key of the cloned group was not set correctly
Concerning this bug report: I’m good. I don’t think I’ll run into these notices again any time soon.
I am experiencing the same issue after upgrading from 5.7.10 to 5.8.0.
Like the original author of this post, I use flexible layout fields, cloning other field groups in for each layout option.
Just adding the QueryMonitor debug output for reference (see attached). Happy to share additional details if helpful.
I had the same issue without using WPML or other plugins.
The Problem was a field group (A) i used in another group (B) via clone.
After deleting (A), the error occurs, because (B) was referencing a deleted field group. After deleting the cloned group from (B) the error disappears and everything was fine.
I have the same issue.
I’m using a repeater of field group clones.
In the “acf_get_fields” function, in line 356 of the acf-field-functions.php file (version 5.8.3), the parent value is an array of groups of fields, so they have no key or id.
If you could add a presence check before calling $parent[‘key’] or $parent[‘id’] respectively to lines 349 and 356, this will resolve the notices.
Props to Pacart. –> Sounds like a plan!
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
© 2019 Advanced Custom Fields. Subscribe