SOLVED: Warning and Deprecated error with native search functionality

Bricks Version: 1.5.7
Browser: Chrome 90
OS: Windows

Native search functionality throws warning and deprecated error after latest update.
I render the search page template based on the search result. If no results are found, render the empty template. If results are found, render another template.

/**

  • Code
    */
    function select_template_search_result(){
    if(is_search()) {
    if( have_posts() ) {
    do_shortcode( ‘[bricks_template id=“4587”]’ );
    } else {
    do_shortcode( ‘[bricks_template id=“4746”]’ );
    }
    }else{
    do_shortcode( ‘[bricks_template id=“4746”]’ );
    }
    }

/**

  • Error
    /
    Warning : Undefined array key 1 in wp-content/themes/bricks/includes/assets.php
    * on line 679

Deprecated : str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /wp-content/themes/bricks/includes/assets.php** on line 679

Warning : Undefined array key 1 in wp-content/themes/bricks/includes/assets.php** on line 679

Deprecated : str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in wp-content/themes/bricks/includes/assets.php on line 679

Hi Daan,
Welcome to the forum, and thanks so much for your report!

We’ll provide a fix in the next version :slight_smile:

Best regards,
timmse

1 Like

Hey Daan,
Bricks 1.6 (Beta 2) contains a fix for this problem.

You can download it manually in your account:
https://bricksbuilder.io/account/?v=1.6-beta2

Best regards,
timmse