Warning: array_key_exists() expects parameter 2 to be array, boolean given in /home/wficbs/public_html/debuginstall/wp-content/plugins/advanced-custom-fields-pro/api/api-helpers.php on line 846
Error after upgrading to newest version of ACF
Dang…ditto here. I reverted back to 5.1.0 and the errors went away. However, I’ve updated other sites with v.5 and not seen any issues. Anyone have thoughts on what specific combination of fields/repeaters/etc might be causing this? Thanks in advance.
Yep, same here. I downgraded to 5.9 because of that…
Messages, appeard in 5.11:
Warning: array_key_exists() expects parameter 2 to be array, boolean given in /Path/to/wp-content/plugins/advanced-custom-fields-pro/api/api-helpers.php on line 846
I used a repeater field with 2 subfields,
and a template-Loop seems to cause the error:
while ( have_rows(‘galleries’) ) : the_row();
get_sub_field(‘…’)
Same here.
In addition, if you just do an empty update on the offending post, the error goes away.
Thanks for that fix, @bsudeep – that did work for me too.
Unfortunately I have this on every page so going through and opening each and re-saving isn’t very practical in this instance.
Hoping Elliot comes up with a fix soon!
Same issue here. I just bought and implemented the ACF Pro plugin with repeaters an hour ago.
Updating the page is not working for me however.
@t-racer It was more like an attempt at a temporary hackey fix till the actual problem gets sorted out.
Note for anyone trying to use the empty update post temp hackey fix.
Updating the empty post causes the have_rows( ‘acf_field_name’ ) to return true, Consequently an empty row gets printed out 😐
Also, apparently it does not work for everyone.
I was originally getting the same error as in the first post in this thread, now I am getting a different error with the same cause:
Fatal error: Cannot use string offset as an array in SERVERURLHERE/wp-content/plugins/advanced-custom-fields-pro/api/api-template.php on line 580
However, this error is a fatal error and immediately stops the page drawing whereas before it was simply a warning.
It’s a simple bug with a simple fix, i’m sure Elliot will have 5.1.2 out the door very quickly, but if this is really affecting you,
https://gist.github.com/lgladdy/3d16dcf87c1cec4c4b6d
will help!
Hi guys
Thanks @lgladdy for the patch, which I’ll add to my to-do list, but I would like to first understand why the $array is false in the first place.
Does anyone know what the initial function is that is using the acf_extract_var function and passing in a blank value for $array?
I can’t replicate it on my end even with a field which doesn’t exist, however, I have just fixed a have_rows issue which may have been the initial cause. I’ll undo my work and test there.
Update: Just released ACF PRO 5.1.2 – fixes acf_extract_var() issues
Please let me know if your issues are resolved after updating
JFTR: I believe you are spot-on with the have_rows issue. Just yesterday, I stumbled over the error and narrowed it down to a single, lonely if ( have_rows('field') )
starting off the treatment of a flexible content field. And, like for the others here, the 5.1.2 update corrects it.
BeEsides this error, there’s another error since one of the latest plugin releases. If a width is set in the wrapper attribute this error shows up:
SERVERURL/wp-content/plugins/advanced-custom-fields-pro/api/api-helpers.php on line 457
As soon as the width setting is removed the error is gone.
Just wanted to second @emiel note, I have 5.1.3 and
Notice: Undefined index: data-width in D:\Xampp\htdocs\demo\wp-content\plugins\advanced-custom-fields-pro\api\api-helpers.php on line 45
shows up on all screens/tabs if you have even one width set for a field.
The topic ‘api-helpers.php on line 846 error after updating’ is closed to new replies.
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!
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.