Conversation
supportHi. I was able to isolate my issue to the MB Custom Post Types & Custom Taxonomies plugin. When this plugin is inactive , the Visual Composer page builder plugin works fine. When the MB Custom Post Types & Custom Taxonomies plugin is enabled , I get an error message: “There has been a critical error on this website.” I am unable to edit a page with the VC page builder. I am using the more robust Visual Composer plugin ( https://visualcomposer.com ), not to be confused with the similar WP Bakery Page Builder plugin. The site is running WordPress 6.9, PHP 8.2.29, and Visual Composer 45.15.0. All the latest/current versions. I did find a “Fatal Error” with PHP. It is long, but maybe running this error through ChatGPT (or some other AI) can lead to a fix? Or maybe you’re more adept with PHP than I am, and you know exactly how to fix! Would be good to roll this out for everyone using this plugin… Let me know how to best move forward with a fix! Thank you for your help! Ok, here’s the error: Fatal error: Uncaught TypeError: MBCPT\PostTypeReorder::enqueue_scripts(): Argument #1 ($hook) must be of type string, null given, called in /PATH_TO_SITE_DIRECTORY/wp-includes/class-wp-hook.php on line 341 and defined in /PATH_TO_SITE_DIRECTORY/wp-content/plugins/mb-custom-post-type/src/PostTypeReorder.php:30 Stack trace: #0 /PATH_TO_SITE_DIRECTORY/wp-includes/class-wp-hook.php(341): MBCPT\PostTypeReorder->enqueue_scripts(NULL) #1 /PATH_TO_SITE_DIRECTORY/wp-includes/class-wp-hook.php(365): WP_Hook->apply_filters(NULL, Array) #2 /PATH_TO_SITE_DIRECTORY/wp-includes/plugin.php(522): WP_Hook->do_action(Array) #3 /PATH_TO_SITE_DIRECTORY/wp-content/plugins/visualcomposer/visualcomposer/resources/views/editor/frontend/header.php(41): do_action(‘admin_enqueue_s…’, NULL) #4 /PATH_TO_SITE_DIRECTORY/wp-content/plugins/visualcomposer/visualcomposer/Helpers/Views.php(56): include(‘/nas/content/li…’) #5 /PATH_TO_SITE_DIRECTORY/wp-content/plugins/visualcomposer/visualcomposer/Framework/helpers.php(89): VisualComposer\Helpers\Views->render(‘/nas/content/li…’, Array) #6 /PATH_TO_SITE_DIRECTORY/wp-content/plugins/visualcomposer/visualcomposer/resources/views/editor/frontend/frontend.php(22): vcview(‘editor/frontend…’, Array) #7 /PATH_TO_SITE_DIRECTORY/wp-content/plugins/visualcomposer/visualcomposer/Helpers/Views.php(56): include(‘/nas/content/li…’) #8 /PATH_TO_SITE_DIRECTORY/wp-content/plugins/visualcomposer/visualcomposer/Modules/Editors/Frontend/Controller.php(144): VisualComposer\Helpers\Views->render(‘/nas/content/li…’, Array) #9 [internal function]: VisualComposer\Modules\Editors\Frontend\Controller->renderEditorBase(Object(VisualComposer\Helpers\Views), Object(VisualComposer\Helpers\Frontend), NULL, Array, ‘vcv:editors:fro…’) #10 /PATH_TO_SITE_DIRECTORY/wp-content/plugins/visualcomposer/visualcomposer/Framework/Container.php(63): ReflectionMethod->invokeArgs(Object(VisualComposer\Modules\Editors\Frontend\Controller), Array) #11 /PATH_TO_SITE_DIRECTORY/wp-content/plugins/visualcomposer/visualcomposer/Helpers/Traits/EventsFilters.php(30): VisualComposer\Framework\Container->call(‘renderEditorBas…’, Array) #12 /PATH_TO_SITE_DIRECTORY/wp-content/plugins/visualcomposer/visualcomposer/Framework/Illuminate/Container/Container.php(260): VisualComposer\Modules\Editors\Frontend\Controller->VisualComposer\Helpers\Traits{closure}(NULL, Array) #13 /PATH_TO_SITE_DIRECTORY/wp-content/plugins/visualcomposer/visualcomposer/Framework/Illuminate/Filters/Dispatcher.php(36): VisualComposer\Framework\Illuminate\Container\Container->call(Object(Closure), Array) #14 /PATH_TO_SITE_DIRECTORY/wp-content/plugins/visualcomposer/visualcomposer/Framework/helpers.php(77): VisualComposer\Framework\Illuminate\Filters\Dispatcher->fire(‘vcv:editors:fro…’, ”, Array, false) #15 /PATH_TO_SITE_DIRECTORY/wp-content/plugins/visualcomposer/visualcomposer/Modules/Editors/Frontend/Controller.php(93): vcfilter(‘vcv:editors:fro…’, ”) #16 [internal function]: VisualComposer\Modules\Editors\Frontend\Controller->init(Object(VisualComposer\Helpers\Request), Object(VisualComposer\Helpers\Url), Object(VisualComposer\Helpers\PostType), Object(VisualComposer\Helpers\Frontend), Object(VisualComposer\Helpers\Access\UserCapabilities)) #17 /PATH_TO_SITE_DIRECTORY/wp-content/plugins/visualcomposer/visualcomposer/Framework/Container.php(63): ReflectionMethod->invokeArgs(Object(VisualComposer\Modules\Editors\Frontend\Controller), Array) #18 /PATH_TO_SITE_DIRECTORY/wp-content/plugins/visualcomposer/visualcomposer/Modules/Editors/Frontend/Controller.php(45): VisualComposer\Framework\Container->call(‘init’) #19 /PATH_TO_SITE_DIRECTORY/wp-content/plugins/visualcomposer/visualcomposer/Framework/Container.php(67): VisualComposer\Modules\Editors\Frontend\Controller->VisualComposer\Modules\Editors\Frontend{closure}(true, ‘secure_auth_red…’) #20 /PATH_TO_SITE_DIRECTORY/wp-content/plugins/visualcomposer/visualcomposer/Helpers/Traits/WpFiltersActions.php(23): VisualComposer\Framework\Container->call(Object(Closure), Array) #21 /PATH_TO_SITE_DIRECTORY/wp-includes/class-wp-hook.php(341): VisualComposer\Modules\Editors\Frontend\Controller->VisualComposer\Helpers\Traits{closure}(true) #22 /PATH_TO_SITE_DIRECTORY/wp-includes/plugin.php(205): WP_Hook->apply_filters(true, Array) #23 /PATH_TO_SITE_DIRECTORY/wp-includes/pluggable.php(1286): apply_filters(‘secure_auth_red…’, true) #24 /PATH_TO_SITE_DIRECTORY/wp-admin/admin.php(104): auth_redirect() #25 /PATH_TO_SITE_DIRECTORY/wp-admin/post.php(12): require_once(‘/nas/content/li…’) #26 {main} thrown in /PATH_TO_SITE_DIRECTORY/wp-content/plugins/mb-custom-post-type/src/PostTypeReorder.php on line 30 The page I need help with: [ log in to see the link]
UPDATE! I edited this file (…/wp-content/plugins/mb-custom-post-type/src/PostTypeReorder.php) on line 30: From: public function enqueue_scripts( string $hook ): void { if ( $hook !== 'edit.php' ) { return; } To: public function enqueue_scripts( ?string $hook ): void { if ( is_null($hook) || $hook !== 'edit.php' ) { return; } And the Fatal Error went away! I can now edit the page again with Visual Composer. Thank you, duck.ai !
Hey @rilwis ! Just following up to see if there’s a plugin fix coming soon based on my issue and fix mentioned above. Thank you!
Hi @panhead We released a new version yesterday for this specific plugin, not Meta Box Lite or Meta Box AIO. If you using this plugin only, please update.
Thank you, @rilwis ! I can confirm that this update (2.11.2) has fixed the Visual Composer conflict issue. Thank you so much for the update!
UPDATE! I edited this file (…/wp-content/plugins/mb-custom-post-type/src/PostTypeReorder.php) on line 30: From: public function enqueue_scripts( string $hook ): void { if ( $hook !== 'edit.php' ) { return; } To: public function enqueue_scripts( ?string $hook ): void { if ( is_null($hook) || $hook !== 'edit.php' ) { return; } And the Fatal Error went away! I can now edit the page again with Visual Composer. Thank you, duck.ai !
Hey @rilwis ! Just following up to see if there’s a plugin fix coming soon based on my issue and fix mentioned above. Thank you!
Hi @panhead We released a new version yesterday for this specific plugin, not Meta Box Lite or Meta Box AIO. If you using this plugin only, please update.
Thank you, @rilwis ! I can confirm that this update (2.11.2) has fixed the Visual Composer conflict issue. Thank you so much for the update!