I’ve got some issues which I can’t seem to figure out.. I recently updated an entire site, wordpress and plugins. And now I also updated ACF. Everything works fine except for the page link and post object fields.. and since the page link field is basically using the post object field I’m guessing that’s where the issue is..
It does not provide any php errors but when I add a page link field (or post object) to a field group the rendering of that group stops at the field and with the field being completely empty.. So it’s really like an php-error which breaks further rendering.
I’ve tried to debug the code in the field file and rewrite some stuff but can’t seem to find the issue or make it work..!
Would be very grateful if you could take a look at it and see if it’s a general bug or if its an isolated thing.
The setup I had while noticing it was the page link field as the last field inside a repeater.
Thanks / Jonathan
There are a few things that could be going on, but most likely there is an infinite loop / timeout happening when a post object is loaded for the dropdown select.
Are you able to debug the post_object field type?
Also, check your server logs for any PHP errors
You’re probably right.. however I’m having difficulties debugging the field type. Nothing is being registered in the debug.log file. Probably since it’s being loaded with ajax and the ajax call works..
The only error I get is this js-error: Uncaught TypeError: Object [object Object] has no method ‘sortable’
But I’m pretty sure that’s due to the wysiwyg script not loading since the post object field disrupts the loading.
Do you have any tricks to get the field to output errors? I’ve tried doing print_r with a die(); right after but there’s no output anywhere.
Okay so I tried disabling all other plugins with no luck, so I guess that’s not the issue.. I did manage to get this error at the place where the field should have appeared in page edit: Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in /var/www/qa.nord-lock.com/wwwroot/wp-includes/wp-db.php on line 1225
which I suppose makes your guess for it to be a loop correct. Now I just have to figure out why the hell its looping..
I tried changing the get_pages to a wp_query and setting the numberposts to 100 which then workes.. So I’m guessing that this has to do with the clients site actually having such a monstrous amount of pages.
My solution to this was to change the post link field to a relationship field since that uses ajax and does not have to fetch all posts at once.
There’s a new issue with the relationship field tho that I’ll post in a new topic to not clutter things up.
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