• Resolved mike8040

    (@mike8040)


    I’m on this issue with Bricks now for two weeks. It was not an easy catch as the issue disappeared once the Live page was copied to the Staging. Also the first time no debug error was given out. The issue is, the Bricks query element and its drop down list can not pull available terms (only terms-products categories are affected) when the Attribute Stock plugin is active. Now on further testing, wp debug shows an error finally. That leads to a 500 error and this log:

    [23-Apr-2024 12:31:26 UTC] PHP Fatal error:  Uncaught TypeError: strpos(): Argument #1 ($haystack) must be of type string, array given in /home/customer/www/example.com/public_html/wp-content/plugins/attribute-stock-for-woocommerce/src/Plugin/Loader.php:182
    Stack trace:
    #0 /home/customer/www/example.com/public_html/wp-content/plugins/attribute-stock-for-woocommerce/src/Plugin/Loader.php(182): strpos(Array, 'pa_')
    #1 /home/customer/www/example.com/public_html/wp-includes/class-wp-hook.php(324): Mewz\WCAS\Plugin\Loader->admin_init('')
    #2 /home/customer/www/example.com/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
    #3 /home/customer/www/example.com/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
    #4 /home/customer/www/example.com/public_html/wp-admin/admin-ajax.php(45): do_action('admin_init')
    #5 {main}
      thrown in /home/customer/www/example.com/public_html/wp-content/plugins/attribute-stock-for-woocommerce/src/Plugin/Loader.php on line 182

    Dev tools show a 500 error for the following request:

    https://example.com/wp-admin/admin-ajax.php?action=bricks_get_terms_options&taxonomy%5B%5D=product_cat&nonce=4424df1b28&postId=25620&bricks-is-builder=1&_=1713875077782

    There was never an issue with Bricks and Attribut Stock Plugin since more then half a year.

    //EDIT: So here is an explanation by the Bricks team why this might happen:
    “Most probably that plugin also assumed the $_GET[‘taxonomy’] from URL parameter is text and the code applied on entire website
    As I can see in your URL patterns, taxonomy[]=something will trigger an error just like my forum thread. Those 4 URLs got no taxonomy[]=xxx”
    With “Those 4 URLs ” he means similar requests that happen within Bricks editor that are status 200.

    • This topic was modified 7 months, 1 week ago by mike8040.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Mewz

    (@mewz)

    Thank you very much for reporting this bug @mike8040. We’ve just released a maintenance update that includes a fix for this.

    Thread Starter mike8040

    (@mike8040)

    Amazing. Thanks for the update. I will have a chance to test later in the day and get back if it is fixed.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Creates a fatal error with Bricks trying to pull available terms’ is closed to new replies.