• Resolved stephan.sperling

    (@stephansperling)


    When activating the plugin, there is the following error shown on the plugins setting page:
    `Fatal error: Uncaught TypeError: WooCommerce\PayPalCommerce\WcGateway\Settings\SettingsRenderer::render_multiselect(): Return value must be of type string, null returned in /var/www/vhosts/stage.gaco.netz.rocks/htdocs/wp-content/plugins/woocommerce-paypal-payments/modules/ppcp-wc-gateway/src/Settings/SettingsRenderer.php:178 Stack trace: #0 /var/www/vhosts/stage.gaco.netz.rocks/htdocs/wp-content/plugins/woocommerce-paypal-payments/modules/ppcp-wc-gateway/src/WCGatewayModule.php(331): WooCommerce\PayPalCommerce\WcGateway\Settings\SettingsRenderer->render_multiselect() #1 /var/www/vhosts/stage.gaco.netz.rocks/htdocs/wp-includes/class-wp-hook.php(303): WooCommerce\PayPalCommerce\WcGateway\WCGatewayModule::WooCommerce\PayPalCommerce\WcGateway\{closure}() #2 /var/www/vhosts/stage.gaco.netz.rocks/htdocs/wp-includes/plugin.php(189): WP_Hook->apply_filters() #3 /var/www/vhosts/stage.gaco.netz.rocks/htdocs/wp-content/plugins/woocommerce/includes/wc-template-functions.php(2944): apply_filters() #4 /var/www/vhosts/stage.gaco.netz.rocks/htdocs/wp-content/plugins/woocommerce-paypal-payments/modules/ppcp-wc-gateway/src/Settings/SettingsRenderer.php(430): woocommerce_form_field() #5 /var/www/vhosts/stage.gaco.netz.rocks/htdocs/wp-content/plugins/woocommerce-paypal-payments/modules/ppcp-wc-gateway/src/Gateway/PayPalGateway.php(334): WooCommerce\PayPalCommerce\WcGateway\Settings\SettingsRenderer->render() #6 /var/www/vhosts/stage.gaco.netz.rocks/htdocs/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-settings-api.php(329): WooCommerce\PayPalCommerce\WcGateway\Gateway\PayPalGateway->generate_ppcp_html() #7 /var/www/vhosts/stage.gaco.netz.rocks/htdocs/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-settings-api.php(85): WC_Settings_API->generate_settings_html() #8 /var/www/vhosts/stage.gaco.netz.rocks/htdocs/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-payment-gateway.php(194): WC_Settings_API->admin_options() #9 /var/www/vhosts/stage.gaco.netz.rocks/htdocs/wp-content/plugins/woocommerce/includes/admin/settings/class-wc-settings-payment-gateways.php(104): WC_Payment_Gateway->admin_options() #10 /var/www/vhosts/stage.gaco.netz.rocks/htdocs/wp-content/plugins/woocommerce/includes/admin/settings/class-wc-settings-payment-gateways.php(87): WC_Settings_Payment_Gateways->run_gateway_admin_options() #11 /var/www/vhosts/stage.gaco.netz.rocks/htdocs/wp-includes/class-wp-hook.php(303): WC_Settings_Payment_Gateways->output() #12 /var/www/vhosts/stage.gaco.netz.rocks/htdocs/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters() #13 /var/www/vhosts/stage.gaco.netz.rocks/htdocs/wp-includes/plugin.php(470): WP_Hook->do_action() #14 /var/www/vhosts/stage.gaco.netz.rocks/htdocs/wp-content/plugins/woocommerce/includes/admin/views/html-admin-settings.php(40): do_action() #15 /var/www/vhosts/stage.gaco.netz.rocks/htdocs/wp-content/plugins/woocommerce/includes/admin/class-wc-admin-settings.php(153): include(‘…’) #16 /var/www/vhosts/stage.gaco.netz.rocks/htdocs/wp-content/plugins/woocommerce/includes/admin/class-wc-admin-menus.php(273): WC_Admin_Settings::output() #17 /var/www/vhosts/stage.gaco.netz.rocks/htdocs/wp-includes/class-wp-hook.php(303): WC_Admin_Menus->settings_page() #18 /var/www/vhosts/stage.gaco.netz.rocks/htdocs/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters() #19 /var/www/vhosts/stage.gaco.netz.rocks/htdocs/wp-includes/plugin.php(470): WP_Hook->do_action() #20 /var/www/vhosts/stage.gaco.netz.rocks/htdocs/wp-admin/admin.php(259): do_action() #21 {main} thrown in /var/www/vhosts/stage.gaco.netz.rocks/htdocs/wp-content/plugins/woocommerce-paypal-payments/modules/ppcp-wc-gateway/src/Settings/SettingsRenderer.php on line 178
    Es gab einen kritischen Fehler auf Ihrer Website.

    Screenshot: https://nimb.ws/gFVhSR

    Best regards, Stephan

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Syde Niklas

    (@niklasinpsyde)

    Hi @stephansperling,

    Thanks for the message.

    This looks like an error that should not be too difficult to prevent.
    But I’m not seeing any other reports about this particular error which usually suggests a possible plugin/code conflict.

    Instead of only fixing the error, it would be good for us to understand how this happens in the first place. You mentioned having issues on multiple sites. Is this error occurring on all sites? If yes, are there any overlapping plugins?

    The best way to isolate the potential cause for plugin/code conflicts is by temporarily enabling the default theme Storefront and disabling all other plugins except for WooCommerce and PayPal Payments to see if the behavior persists.

    This guide explains the steps to isolate a conflict in more detail: How to test for conflicts

    I will bring this error up with our developers in any case but it would also help us a lot if we could find a way to reproduce the error.
    Thank you!

    Kind regards,
    Niklas

    Plugin Support Syde Niklas

    (@niklasinpsyde)

    Hi @stephansperling,

    Based on your feedback, our developers are implementing functionality to improve the behavior when actions/filters are also used by other plugins, which is most often the cause for type errors. More details can be found in this issue: https://github.com/woocommerce/woocommerce-paypal-payments/issues/730

    If you’re interested, we can provide you with a test package after the code was reviewed. Otherwise, it will likely end up in one of the next releases after it went through testing.
    With the new behavior, the error would no longer break the settings page (only if WP_DEBUG is false). Instead, the fields which are invalid will not be displayed, and the error info will be added to logs.
    So it could still be interesting to figure out which other plugin or piece of code has been causing the conflict in the first place since it may still impact a certain field.

    Kind regards,
    Niklas

    Plugin Support Syde Niklas

    (@niklasinpsyde)

    Hi @stephansperling,

    We have not heard back from you in a while, so I’m marking this thread as resolved.
    Hopefully, the above information helped you out. This new feature is expected to be included in one of the next updates in any case.
    If you have any further questions, please feel free to reopen this topic or create a new one. Thanks!

    Kind regards,
    Niklas

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Fatal Error when activating the plugin’ is closed to new replies.