• Resolved ramzesimus

    (@ramzesimus)


    Hello,

    I have a fresh installation with Twenty Twenty-Four theme, LearnPress and WooCommerce plugins. When performing the search using a default search form I get a fatal error.

    Fatal error: Uncaught Error: Path cannot be empty
    in /var/www/vhosts/dan-fisher.dev/woo.dan-fisher.dev/wp-content/plugins/woocommerce/src/Blocks/Utils/BlockTemplateUtils.php on line 203
    
    Call stack:
    
    file_get_contents()
    wp-content/plugins/woocommerce/src/Blocks/Utils/BlockTemplateUtils.php:203
    Automattic\W\B\U\BlockTemplateUtils::build_template_result_from_file()
    wp-content/plugins/woocommerce/src/Blocks/BlockTemplatesController.php:392
    Automattic\W\B\BlockTemplatesController::add_block_templates()
    wp-includes/class-wp-hook.php:324
    WP_Hook::apply_filters()
    wp-includes/plugin.php:205
    apply_filters()
    wp-includes/block-template-utils.php:1030
    get_block_templates()
    wp-includes/block-template.php:140
    resolve_block_template()
    wp-includes/block-template.php:66
    locate_block_template()
    wp-includes/template.php:66
    get_query_template()
    wp-includes/template.php:515
    get_search_template()
    wp-content/plugins/query-monitor/collectors/theme.php:242
    QM_Collector_Theme::action_template_redirect()
    wp-includes/class-wp-hook.php:324
    WP_Hook::apply_filters()
    wp-includes/class-wp-hook.php:348
    WP_Hook::do_action()
    wp-includes/plugin.php:517
    do_action()
    wp-includes/template-loader.php:13
    require_once()
    wp-blog-header.php:19
    require()
    index.php:17

    You can check it live on the following site https://woo.dan-fisher.dev
    Enter the “test” keyword in the search form in the header or go directly to https://woo.dan-fisher.dev/?s=test which is a search result page.

    The issue gone if LearnPress plugin is disabled. Previously I contacted WooCommerce support here and they said that you might know more about the error.

    Let me know if you need any additional info.

    Best Regards!
    Ramzesimus

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author ThimPress

    (@thimpress)

    Hi ramzesimus

    Oh, we don’t think so error from LearnPress. We tested on the local like your case, but don’t see anymore error like that, we install to site too https://testaddon.thimpress.com/?s=test

    With link https://woo.dan-fisher.dev/?s=test You can see if key search = test, it always errors, but if key search difirence, not error like https://woo.dan-fisher.dev/?s=smile

    Thanks.

    Thread Starter ramzesimus

    (@ramzesimus)

    Hi @thimpress

    Thanks for your reply!

    If you’re trying to recreate the error on your local server then please make sure the following

    • PHP 8.1 and above
    • Any block theme, e.g. Twenty Twenty-Four theme
    • LearnPress and WooCommerce plugins are installed
    • The search keyword matches a product category. For example, you have “Test” product category and your search request is “test”. For example, you can try to search “service” and you’ll get the same error.

    Best Regards!

    Ramzesimus

    Plugin Author ThimPress

    (@thimpress)

    Hi ramzesimus,

    Yes, we set all params like above, but don’t see any errors ??

    Thanks.

    Thread Starter ramzesimus

    (@ramzesimus)

    Hi @thimpress,

    Thanks for your fast reply!

    You don’t see the issue because there are not products assigned to the “Test” category.

    This is your Shop page https://testaddon.thimpress.com/shop/ and no products are displayed.

    You need to create product an assign it to the “Test” category and after that enter your “test” as your keyword. Of course it can be any word.

    Let me know if have any additional information.

    Best Regards!
    Ramzesimus

    Plugin Author ThimPress

    (@thimpress)

    Hi ramzesimus,

    We did as you said, but error not showing. We need to do what next to show error?

    You can see image my config Product https://ibb.co/cvgnVgj

    Thanks.

    Thread Starter ramzesimus

    (@ramzesimus)

    Hi @thimpress,

    Thanks for the reply!

    That’s kind of weird, but you can see the issue if you enter “Uncategorized” as a search keyword https://testaddon.thimpress.com/?s=uncategorized

    As you can see, the header and footer template parts are totally broken displaying
    “Welcome to WordPress. This is your first post. Edit or delete it, then start writing!”
    See screenshot https://share.cleanshot.com/96Wz92TP

    I’d recommend you to enable WP Debug and check the logs.

    If you enter any other keyword that is not present in the content then it’s displayed correctly https://share.cleanshot.com/NlwMKG4V

    Best Regards!
    Ramzesimus

    Plugin Author ThimPress

    (@thimpress)

    Hi ramzesimus,

    https://testaddon.thimpress.com/?s=uncategorized
    Oh, now I saw errors, but it’s so strange, why some text must has error. We’ll check to find reason.

    Thanks.

    Thread Starter ramzesimus

    (@ramzesimus)

    Hi @thimpress,

    Ah, that’s great you confirm the issue. It seems like something in LearnPress triggers wrong template part selection in WooCommerce plugin. I’m not sure what exactly but definitely there is a plugin conflict between LearnPress and WooCommerce.

    Let me know if you need any additional information.

    Best Regards!
    Ramzesimus

    Plugin Author ThimPress

    (@thimpress)

    Hi ramzesimus,

    We fixed it on the LP beta version. You can download to check. The issuse from code hook search key word on taxonomy of LP, it make query of Woocomerce not return post type wp_template, code of Woocomerce, when term null, it return WP_Error, but them not check to stop it, still runs make error.

    We have deploy new version to below link, you can check it
    https://testaddon.thimpress.com/?s=uncategorized

    We really hope you can review 5 stars. A nice rating for LearnPress is a big motivation for us to keep up the hard work and It’s really important to us.
    So, thanh you verry much for your feedback.

    Thanks.
    Best Regards!

    Thread Starter ramzesimus

    (@ramzesimus)

    Hey @thimpress,

    Thanks for the fix! I confirm that the issue is resolved with provided LearnPress 4.2.6-beta-3 Everything works like a charm ??

    Best Regards!
    Ramzesimus

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Fatal Error on search’ is closed to new replies.