Problem/Motivation

When indexing certain items are causing the below warning on PHP 8.2:

Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/html/docroot/modules/contrib/search_api/src/Plugin/search_api/processor/HtmlFilter.php on line 201

Issue fork search_api-3473897

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

j-barnes created an issue. See original summary.

j-barnes’s picture

Status: Active » Needs review

drunken monkey made their first commit to this issue’s fork.

drunken monkey’s picture

Thanks for reporting this problem!
However, instead of just fixing the symptom, we should fix the root cause, i.e., the preg_replace() call failing. This probably happens sometimes when the matched strings get too large.

I created MR !167 for replacing the preg_replace() with a more performant version, which should fix the problem.

  • drunken monkey committed 199a6484 on 8.x-1.x
    Issue #3473897 by drunken monkey: Fixed error in HTML Filter processor...
drunken monkey’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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