WordPress 4.1/ACF 5.1.7.1 the backend, adding/editing fields not working. Content already saved to fields in page templates seems to have been erased. Have several nested repeaters.
acfcloneindex new_field created on all Custom Fields. Before the update I did duplicate a Flexible Content Field.
All sorts of other weird behavior, duplicate fields on some pages.
I determined it is some sort of theme error. I disabled the theme and ACF works fine. I am getting this error message when I attempt to add a new field:
Uncaught TypeError: Cannot read property 'outerHTML' of undefinedinput.min.js:1 $.fn.outerHTMLfield-group.min.js:1 acf.field_group.update_field_metafield-group.min.js:1 acf.field_group.wipe_fieldfield-group.min.js:1 acf.field_group.add_fieldfield-group.min.js:1 (anonymous function)jquery.min.js:3 m.event.dispatchjquery.min.js:3 r.handle
Also, I have the same theme running locally and ACF still works there. Has anyone ever seen something like this? Have any debugging tips?
I’m not sure what sequence of events caused this issue but it was resolved by deleting a template file and adding it back again. No changes were made the file.
I’m not sure if this is the same issue, but any repeater fields aren’t saving fields and aren’t allowing me to add items. I get this error in the condole:
TypeError: undefined is not an object (evaluating ‘$(this).get(0).outerHTML’)
I can’t figure out what the issue is, but it seems to be when the repeater is saved, the values aren’t being stored properly.
I’m having issues since updating to 5.1.7.1 as well. From what I can tell, it’s a conflict with the latest point release of WordPress.
I wasn’t able to edit any custom fields at all, so I did the standard troubleshooting of de-activating plugins and themes and when I had the “twenty-fifteen” theme active and the only plugin active was ACF Pro and I still couldn’t edit fields, I tried reverting to ACF Pro 5.1.6 and still no luck. I went back to 5.1.4 which I know 100% didn’t have issues on my site, but still no luck.
So, I re-activated my theme and all plugins I had active, updated ACF to 5.1.7.1, but this time I reverted WordPress core back to 4.0.1, and all is well.
So, something in WP 4.1 seems to conflict with ACF Pro (as far back as version 5.1.4 according to my tests).
The .js error I noticed was:
load-scripts.php:563 Uncaught TypeError: undefined is not a function
But there didn’t seem to be any helpful info in the console to help me troubleshoot further. . .
Hi @jasonbahl
Thanks for the error report.
Are you able to add the following to yoru config.php file:
define('WP_DEBUG', true);
define('SCRIPT_DEBUG', true);
This will allow WP to load unminified JS files and give you an actual JS error with line number.
Thanks
E
Hi guys
I can’t replicate this on my end. I’ve just release 5.1.8 so please try to update and see if that fixed the bug.
Please also use the ‘SCRIPT_DEBUG’ as above and try to get hold of a JS error to report
Thanks
E
Hi guys
Sorry about that. v5.1.8 is now out. Please use the check again button in the updates page
Cheers
E
Updated to 5.1.8. Deleted the Page I was adding fields to and started a fresh Field Group. It still won’t save and I get this from WP:
Warning: Illegal string offset 'acfcloneindex' in /Users/Phil/Sites/augustblume/wp-content/plugins/advanced-custom-fields-pro/pro/fields/repeater.php on line 156
Notice: Array to string conversion in /Users/Phil/Sites/augustblume/wp-content/plugins/advanced-custom-fields-pro/pro/fields/repeater.php on line 156
Warning: Invalid argument supplied for foreach() in /Users/Phil/Sites/augustblume/wp-content/plugins/advanced-custom-fields-pro/pro/fields/repeater.php on line 255
and then when I try to Add a Row, I get this in the JS:
[Error] TypeError: undefined is not an object (evaluating '$(this).get(0).outerHTML')
outerHTML (acf-input.js, line 288)
add (acf-pro-input.js, line 377)
doEvent (acf-input.js, line 1866)
(anonymous function) (acf-input.js, line 1805)
dispatch (jquery.js, line 3)
handle (jquery.js, line 3)
After a little more testing, it seems that my issue has to do with having a Tab precede the repeater that has the same field name. So:
Tab: Our Process / our_process
Repeater: Our Process / our_process
If I remove the Tab’s field name, and save, it works fine. I guess that when the repeater’s fields are loaded, it thinks it’s the tab instead of the repeater.
I’ll post back if I find out anymore.
Thanks mate. I’ll do some testing with this.
I can’t replicate the issue on my end. perhaps you have some custom code which is interfering with the repeater field? Perhaps a filter like load_value or load_field?
We just recently added a Layout to one of our flexible field entries and it also broke our site. Most of the data isn’t accessible now from those layouts. I removed the layout I added and it didn’t resolve the problem. I restored the site from a backup, tried it again, and again, it broke the flexible fields. I think the fact that it re-ordered them, might have something to do with the issue because the couple layouts above the one I added are ok, it’s the existing layouts, now below the layout I added that are now gone, both Front end and Back End.
Can you please elaborate on what is broken / accessible. ACF loads data in multiple places and it is hard to understand what has gone wrong where in the plugin.
Please also check your console log for errors and attach images to help
I am not seeing any errors in the console or the log.
This was an existing configuration that had Flexible Content. I added a choice to the Flexible Content field, added a couple of sub fields, put it second in the list of choices, and saved. After saving, most the existing content that was saved for other flexible content selections (layouts I guess) were missing. On the front end, it put in the rows, but the data is missing. It’s like when I added the field, it re-indexed the fields and broke the link to the data. I will try and restore the site again, and take screenshots along the way, then re-post.
Hi Guys
I’ve just done a bunch of testing with the flexible content field:
– adding layouts
– duplicating layouts
– adding sub fields
– duplciating sub fields
– reordering layouts
– reordering sub fields
– reordergind sub fields into new layouts
All the above with mixed in saving of the page to see if this effects the problem.
I still can’t reproduce any issues at all and am very confused as to the mixed results in this thread.
Can I please ask for a very clear set of instructions to replicate the issue?
Thanks
E
Elliot,
I think I narrowed my issues down to WP Engine. I’ve been troubleshooting for a while thinking it was an issue with ACF Pro, as I was having issues even when the Twenty-Fifteen theme was active and the only active plugin was ACF Pro.
As I mentioned before, downgrading to WP 4.0 from 4.1 seemed to resolve the issue, but that’s not an ideal long-term solution. So, for the short-term, I downgraded to 4.0 then cloned the site to WP Engine’s staging server where I could continue to troubleshoot.
Once cloned to their staging server, I updated WP to 4.1, assuming it would bring back the issues I was having so that I could use SCRIPT_DEBUG to narrow down the issue further. However, once upgraded to 4.1 on the WP Engine staging server, everything seemed to work fine. I cloned the staging site back to the production environment and the issues came back. . .so, I’ll be opening a ticket with WP Engine to see what on their end is causing trouble.
When I use SCRIPT_DEBUG on their production environment, I don’t see any errors in the console. . .but when I turn off SCRIPT_DEBUG, a lot of things that rely on JS in the admin fall apart.
Thought this might be helpful in case any of the other folks having issues are also on WP Engine.
I’m having the same issue.
Illegal string offset ‘acfcloneindex’ …/advanced-custom-fields-pro/pro/fields/repeater.php:156
Invalid argument supplied for foreach() …/advanced-custom-fields-pro/pro/fields/repeater.php:255
Array to string conversion …/advanced-custom-fields-pro/pro/fields/repeater.php:156
This uses some repeater fields (that are obviously the problem) divided into tabbed sections.
I’m using 5.1.9.1
I’ve managed to fix this as per @nathanaelphilip’s suggestion.
I can now confirm that the problem arose when the repeaters where separated by tabs with the same name as the repeater fields. When I changed the name of the tab separators the problem disappeared and the repeaters function as expected.
Hi guys
Thanks for all your help with this issue.
I’ve done some debugging and found the issue!
This is a very specific case which is caused by a specific version of ACF PRO (v5.1.7, v5.1.8) + tab/repeater field using the same name.
This problem has been fixed in v5.1.9, so firstly, please update to the latest version.
The next thing to do is delete and re create your tab fields.
They can use the same names, but by re-createing them, the tab fields won’t conflict with the loading of values and will allow your repeater field to work again!
Cheers
E
UPDATE 1/28/16:
I solved my issue. At the time I wrote that theme, I used the php spl_autoload_register() function to instantiate a class that uses ACF fields. Somewhere in the loading sequence, ACF no likey. Instead, I call that class w/ the WP action “init” and it’s good to go. Hope this helps somebody else!
———————
ORIGINAL POST:
I’m having a very similar issue, except the difference is I don’t have any tab fields, or any other fields with the same name as the multiple repeater fields that are throwing back the error.
I’m using ACF 5.3.3.1 on a multisite environment. All the sites running the same theme have the issue. I have the exact same plugin running, and a different theme where these issues don’t exist.
I know that sounds like it’s gotta be my theme! But I’ve looked for dup’s of the field name in my PHP registered fields AND the WP back-end registered fields.
It looks like the problem is only happening with repeater fields that were registered via PHP. And the problem only has come up after an update of either WP and/or ACF 5. I didn’t realize it until after both those have been upgraded.
What I’ve tried:
-Recreate the fields and update the PHP code to register them. Creating them with the same name didn’t fix it. If I renamed the repeater field, it worked.
-Comment out PHP registered fields and use same fields names in backend field creation tool. Same issue.
These fields are also displaying on options pages. That is where the issue seems to be occurring. Not sure if this is related.
These are the exact errors I’m getting:
Warning: Illegal string offset ‘acfcloneindex’ in /home/creare/webapps/creare_websites_wpms/wp-content/plugins/advanced-custom-fields-pro/pro/fields/repeater.php on line 161
Warning: Invalid argument supplied for foreach() in /home/creare/webapps/creare_websites_wpms/wp-content/plugins/advanced-custom-fields-pro/pro/fields/repeater.php on line 292
I guess I’m asking, what else should I look for?
Thanks in advance.
Running WP 4.4.1
The topic ‘5.1.7.1 Broken backend and duplicate fields’ 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.