Fatal errors
- This topic has 7 replies, 2 voices, and was last updated 2 years ago by
ASTA Creative.
-
AuthorPosts
-
April 19, 2023 at 2:17 PM #41535
ASTA Creative
ParticipantHi, 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 2501I'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!
April 19, 2023 at 5:49 PM #41541Peter
ModeratorHello,
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--importApril 19, 2023 at 6:58 PM #41542ASTA Creative
ParticipantHi 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/VsqhuwFHMany thanks for giving it a shot in your local site setup! Please let me know if you need anything else for testing.
April 20, 2023 at 3:33 PM #41554ASTA Creative
ParticipantHi 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.
April 20, 2023 at 7:26 PM #41563Peter
ModeratorHello,
Somehow the pastebin link does not work on my side. Can you please upload it to another hosting and share the URL here?
April 20, 2023 at 9:12 PM #41566ASTA Creative
ParticipantHi Peter,
Here's the link to the export file:
https://drive.google.com/file/d/1ByoWetqHmDntwtXpuOq-DmRASNzEaXMs/view?usp=share_linkApril 20, 2023 at 10:55 PM #41567Peter
ModeratorHello,
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 tocontent_1
then save the post and field values properly.April 21, 2023 at 2:48 AM #41572ASTA Creative
ParticipantSo "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!
-
AuthorPosts
- You must be logged in to reply to this topic.