PHP Fatal Error when user tries to edit front end form
Support › MB Frontend Submission › PHP Fatal Error when user tries to edit front end form
- This topic has 3 replies, 2 voices, and was last updated 2 weeks, 2 days ago by
Peter.
-
AuthorPosts
-
July 28, 2026 at 7:55 AM #50120
Tanja Kropf
ParticipantI have directory and event listing CPTs where users are able to edit. It's worked totally fine, and now it's not. When I'm in admin, I'm redirected to the edit form. When I'm in another role, merchant or contributor, which both have editing capabilities, it redirects to the home page. In debug mode I get a php fatal error:
PHP Fatal Uncaught TypeError: MBFS\Helper::get_post_content(): Argument #1 ($post) must be of type WP_Post, null given, called
Stack trace:
#0 /wp-content/plugins/meta-box-aio/vendor/meta-box/mb-frontend-submission/src/Dashboard/Renderer.php(186): MBFS\Helper::get_post_content()
#1 /wp-content/plugins/meta-box-aio/vendor/meta-box/mb-frontend-submission/src/Dashboard/Renderer.php(174): MBFS\Dashboard\Renderer->get_edit_page_attrs_from_shortcode()
#2 /wp-content/plugins/meta-box-aio/vendor/meta-box/mb-frontend-submission/src/Dashboard/Renderer.php(21): MBFS\Dashboard\Renderer->get_edit_page_attrs()
#3 /wp-content/plugins/meta-box-aio/vendor/meta-box/mb-frontend-submission/src/Dashboard/Shortcode.php(18): MBFS\Dashboard\Renderer->render()
#4 /wp-includes/shortcodes.php(434): MBFS\Dashboard\Shortcode->shortcode()
#5 internal function: do_shortcode_tag()
#6 /wp-includes/shortcodes.php(273): preg_replace_callback()
#7 /wp-includes/class-wp-hook.php(341): do_shortcode()
#8 /wp-includes/plugin.php(205): WP_Hook->apply_filters()
#9 /wp-includes/post-template.php(256): apply_filters()
#10 /wp-content/themes/bricks/template-parts/page.php(11): the_content()
#11 /wp-includes/template.php(816): require('/home/vpbyzrt/p...')
#12 /wp-includes/template.php(749): load_template()
#13 /wp-includes/general-template.php(206): locate_template()
#14 /wp-content/themes/bricks/page.php(12): get_template_part()
#15 /wp-includes/template-loader.php(132): include('/home/vpbyzrt/p...')
#16 /wp-blog-header.php(19): require_once('/home/vpbyzrt/p...')
#17 /index.php(17): require('/home/vpbyzrt/p...')
#18 {main} thrown in /wp-content/plugins/meta-box-aio/vendor/meta-box/mb-frontend-submission/src/Helper.php on line 12
Plugin: Meta Box AIO
File: /wp-content/plugins/meta-box-aio/vendor/meta-box/mb-frontend-submission/src/Dashboard/Renderer.php on line 186 and defined
Line:July 28, 2026 at 9:26 PM #50121Peter
ModeratorHello Tanja,
Thanks for reaching out.
Does the merchant or contributor user have their own post in the dashboard to edit? I'm not able to reproduce the issue on my demo site. To prevent the fatal error from occurring, you can use the condition code below in the function
get_post_content()
file wp-content/plugins/meta-box-aio/vendor/meta-box/mb-frontend-submission/src/Dashboard/Renderer.php(186)public static function get_post_content( WP_Post $post ): string { if ( ! $post ) { return ''; } $content = $post->post_content;July 29, 2026 at 3:10 AM #50122Tanja Kropf
Participantyes, they have their own post to edit.I'm confused by your solution suggestion and where to put that?
July 29, 2026 at 6:25 PM #50124Peter
ModeratorHello,
You can share your site credentials by submitting this contact form https://metabox.io/contact/
I will help you fix the error message.Thanks.
-
AuthorPosts
- You must be logged in to reply to this topic.