• Our plugin, GDPR-Framework, triggers a Fatal Error in your code. I’ve reproduced this bug in a local environment so I can’t give you a link to the website. Here is the fatal error and the call stack. Let me know if you need more information on reproducing the error.

    Fatal error: Uncaught Error: method_exists(): Argument #1 ($object_or_class) must be of type object|string, bool given
    in C:\Users\OliverHellwig\Local Sites\plugintester\app\public\wp-content\plugins\woocommerce\packages\woocommerce-admin\src\PageController.php on line 359
    
    Call stack:
    
    method_exists()
    wp-content/plugins/woocommerce/packages/woocommerce-admin/src/PageController.php:359
    Automattic\W\A\PageController::is_connected_page()
    wp-content/plugins/woocommerce/packages/woocommerce-admin/includes/page-controller-functions.php:40
    wc_admin_is_connected_page()
    wp-content/plugins/woocommerce/packages/woocommerce-admin/src/Loader.php:826
    Automattic\W\A\Loader::is_embed_page()
    wp-content/plugins/woocommerce/packages/woocommerce-admin/src/Loader.php:809
    Automattic\W\A\Loader::is_admin_or_embed_page()
    wp-content/plugins/woocommerce/packages/woocommerce-admin/src/Loader.php:924
    Automattic\W\A\Loader::remove_notices()
    wp-includes/class-wp-hook.php:303
    WP_Hook::apply_filters()
    wp-includes/class-wp-hook.php:327
    WP_Hook::do_action()
    wp-includes/plugin.php:470
    do_action()
    wp-content/plugins/gdpr-framework/views/installer/header.php:11
    require()
    wp-content/plugins/gdpr-framework/src/View.php:44
    Codelight\G\View::render()
    wp-content/plugins/gdpr-framework/src/Installer/InstallerStep.php:141
    Codelight\G\I\InstallerStep::renderHeader()
    wp-content/plugins/gdpr-framework/src/Installer/InstallerStep.php:35
    Codelight\G\I\InstallerStep::run()
    wp-content/plugins/gdpr-framework/src/Installer/InstallerRouter.php:84
    Codelight\G\I\InstallerRouter::route()
    wp-includes/class-wp-hook.php:303
    WP_Hook::apply_filters()
    wp-includes/class-wp-hook.php:327
    WP_Hook::do_action()
    wp-includes/plugin.php:470
    do_action()
    wp-admin/admin.php:175
    require_once()
    wp-admin/index.php:10
Viewing 4 replies - 1 through 4 (of 4 total)
  • I looked at your code and found the problem.

    Here are lines 357 to 361 in woocommerce-admin/src/PageController.php:

    		// Disable embed on the block editor.
    		$current_screen = did_action( 'current_screen' ) ? get_current_screen() : false;
    		if ( method_exists( $current_screen, 'is_block_editor' ) && $current_screen->is_block_editor() ) {
    			$is_connected_page = false;
    		}

    When $current_screen is set to false, then false is used as the first parameter to method_exists() causing the fatal error.

    Hi @data443,

    Thanks for reaching out. Development of WooCommerce takes place on GitHub so that would be the best place to get this in front of the developers.

    You could open up an issue about this incompatibility or create a pull request to propose any changes you’d like to make.

    https://github.com/woocommerce/woocommerce/issues/new/choose

    I hope that gets you pointed in the right direction.

    Thanks!

    Mirko P.

    (@rainfallnixfig)

    Hi there,

    I’m going to close this thread now. Feel free to create a new topic if you have any more questions.

    Hi @3sonsdevelopment,

    Thank you for the response. I’ll submit a bug report on GitHub.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Fatal error in PageController.php line 359’ is closed to new replies.