• Resolved Redmatters BV

    (@redmatters)


    We get the following error when updated WooCommerce to version 6.3.1

    PHP Fatal error:  Uncaught TypeError: Argument 1 passed to Automattic\WooCommerce\Blocks\BlockTypes\LegacyTemplate::add_alignment_class_to_wrapper() must be of the type string, null given, called in /wp-includes/class-wp-hook.php on line 309 and defined in /wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/BlockTypes/LegacyTemplate.php:215
    Stack trace:
    #0 /wp-includes/class-wp-hook.php(309): Automattic\WooCommerce\Blocks\BlockTypes\LegacyTemplate->add_alignment_class_to_wrapper(NULL, Array)
    #1 /Users/renetuin/Documents/repos/redpress-v2/wp-includes/plugin.php(189): WP_Hook->apply_filters(NULL, Array)
    #2 /wp-includes/class-wp-block.php(284): apply_filters('render_block', '\n\n', Array, Object(WP_Block))
    #3 /wp-includes/blocks.php(883): WP_Block->render()
    #4 /wp- in /wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/BlockTypes/LegacyTemplate.php on line 215

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Mirko P.

    (@rainfallnixfig)

    Hi @redmatters,

    It is likely that your theme or one of your other plugins is conflicting with the updated version of WooCommerce.

    I would recommend that you perform a full conflict test to see if you can find the cause.

    Here’s a more detailed explanation on how to do a conflict test:

    https://docs.woocommerce.com/document/how-to-test-for-conflicts/

    Let us know how it goes.

    Thread Starter Redmatters BV

    (@redmatters)

    It’s indeed something in my theme, because default theme is working correctly.
    But error messages is referring to a function I’m not familiar of that its used in my theme.

    Mirko P.

    (@rainfallnixfig)

    Hi @redmatters,

    Thank you for letting us know that is correctly working with a default theme.

    I’d suggest making sure that your theme is up to date. If that doesn’t resolve the issue, we recommend reaching out to the theme developer directly. They should be able to assist further.

    Best regards.

    Thread Starter Redmatters BV

    (@redmatters)

    @rainfallnixfig problem is still in WooCommerce, after some more testing problem is indeed in ClassicTemplate.php where the parameter $content can receive a NULL value. But because of fact you have a cast check of string added the error is accuring.

    When I remove string casting it works fine.

    Hi @redmatters

    Thanks for detecting that.

    If you believe this is a bug, then a good move would be to report this to the developers. You can do that here: https://github.com/woocommerce/woocommerce/issues

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

The topic ‘LegacyTemplate function add_alignment_class_to_wrapper error’ is closed to new replies.