Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment | File | Size | Author |
---|---|---|---|
#2 | search_api-preg_split-null-3344569-2.patch | 543 bytes | circuscowboy |
Comments
Comment #2
circuscowboy CreditAttribution: circuscowboy as a volunteer commentedHere is a patch
Comment #3
drunken monkeyThanks 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!