Problem/Motivation

When upgrading php from 5.6 to 8.1 I started getting this error
preg_split(): Passing null to parameter #2 ($subject) of type string is deprecated in SearchApiPorterStemmer->process() (line 58 of .../sites/all/modules/contrib/search_api/includes/processor_stemmer.inc).

Steps to reproduce

I am not sure why my site is sending a null value to this function.

Proposed resolution

For now I am just happy to remove noise from my watchdog log so I created a patch to return if the value is NULL

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

circuscowboy created an issue. See original summary.

circuscowboy’s picture

Here is a patch

drunken monkey’s picture

Component: General code » Plugins
Status: Needs review » Fixed

Thanks for reporting this issue and providing a patch!
Yeah, I don’t really know how that would happen, either. However, just returning early in that case seems sensible in any case.
Committed. Thanks again!

Status: Fixed » Closed (fixed)

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