Problem/Motivation

When using the search as an anonymous user the following error is triggered:

TypeError: str_replace(): Argument #2 ($replace) must be of type array|string, int given in str_replace() (line 293 
of /app/htdocs/web/modules/contrib/ai_search_block/src/AiSearchBlockHelper.php).

This is because of the removal of the casting in this commit.

Steps to reproduce

1. Add search block
2. Do a search as an anonymous user
3. An error message will be shown in the response output and browser console.

Proposed resolution

Add casting back

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

jonas139 created an issue. See original summary.

jonas139’s picture

Status: Active » Needs review

lammensj made their first commit to this issue’s fork.

  • lammensj committed 71c37cb4 on 1.0.x authored by jonas139
    fix: #3555705 Search as an anonymous user is broken
    
    By: @jonas139
    
lammensj’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.