Support Forum
Hi, I've been pulling my hair out all night, because of errors being generated.
A field group with some groups, assigned to a custom post type. Page loads in backend, saving doesn't work, see below:
See below:
Fatal error: Uncaught TypeError: strpos(): Argument #1 ($haystack) must be of type string, array given in /home/u39485p34917/domains/astacreative.dev/public_html/roofclaim-bricks/wp-includes/formatting.php:2501 Stack trace: #0 /home/u39485p34917/domains/astacreative.dev/public_html/roofclaim-bricks/wp-includes/formatting.php(2501): strpos() #1 /home/u39485p34917/domains/astacreative.dev/public_html/roofclaim-bricks/wp-includes/class-wp-hook.php(308): convert_invalid_entities() #2 /home/u39485p34917/domains/astacreative.dev/public_html/roofclaim-bricks/wp-includes/plugin.php(205): WP_Hook->apply_filters() #3 /home/u39485p34917/domains/astacreative.dev/public_html/roofclaim-bricks/wp-includes/post.php(2836): apply_filters() #4 /home/u39485p34917/domains/astacreative.dev/public_html/roofclaim-bricks/wp-includes/post.php(2721): sanitize_post_field() #5 /home/u39485p34917/domains/astacreative.dev/public_html/roofclaim-bricks/wp-includes/post.php(4074): sanitize_post() #6 /home/u39485p34917/domains/astacreative.dev/public_html/roofclaim-bricks/wp-includes/post.php(4817): wp_insert_post() #7 /home/u39485p34917/domains/astacreative.dev/public_html/roofclaim-bricks/wp-admin/includes/post.php(439): wp_update_post() #8 /home/u39485p34917/domains/astacreative.dev/public_html/roofclaim-bricks/wp-admin/post.php(227): edit_post() #9 {main} thrown in /home/u39485p34917/domains/astacreative.dev/public_html/roofclaim-bricks/wp-includes/formatting.php on line 2501
I've downgraded WordPress and PHP version. Uncommented the function in formatting.php... (that actually works, but then it prevents from creating new custom posts). Searched forums.. no answers.
Coming from ACF Pro.. this is not good for my business 🙁
Please help!
Hello,
Thanks for reaching out.
Can you please let me know the scenario? Where and when this happens? Did you migrate ACF fields to Meta Box?
Please export the field group to a JSON file and share it here. I will import it to my local site and check the issue. Please refer to the documentation
https://docs.metabox.io/extensions/meta-box-builder/#export--import
Hi Peter, thanks for your reply.
I've tried this in LocalWP and live development setup. The setup is a clean installation, without pages with a few plugins activated. Using BricksBuilder as a theme in WP 6.2. Deactivating plugins and switching themes did not solve the issues. It is a simple setup in MetaBox using a CPT and custom field groups (with group fields). The group fields seem to be causing the problem. Creating a new post or modifing post generates the errors. All MB extensions are active. PHP v8.0 and v8.1, Apache server.
The export of the custom field group:
https://pastebin.com/VsqhuwFH
Many thanks for giving it a shot in your local site setup! Please let me know if you need anything else for testing.
Hi Peter, were you able to look into yet? I don't want to sound pushy, but I can't work on my project until this is problem is resolved.
Hello,
Somehow the pastebin link does not work on my side. Can you please upload it to another hosting and share the URL here?
Hi Peter,
Here's the link to the export file:
https://drive.google.com/file/d/1ByoWetqHmDntwtXpuOq-DmRASNzEaXMs/view?usp=share_link
Hello,
I got the issue. There is a group that has the same ID as the field post content, standard of WordPress, that causes the issue: content
I change the group ID to content_1
then save the post and field values properly.
So "content" is a reserved ID by WordPress. Strange, because I followed a tutorial and this didn't happen. Anyways, very glad it works now. Thank you so much Peter!