Needs review
Project:
Search API
Version:
8.x-1.41
Component:
General code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
2 Sep 2026 at 12:49 UTC
Updated:
11 Nov 2026 at 15:42 UTC
Jump to comment: Most recent
Comments
Comment #4
andres alvarez commentedConfirmed the root cause. In
ReverseEntityReferences::addFieldValues()(src/Plugin/search_api/processor/ReverseEntityReferences.php:299),$to_extract[$property_name][$nested][] = $field;uses$nesteddirectly as an array key, where$nestedcomes fromUtility::splitPropertyPath($property_path, FALSE). That function returnsNULLfor the second element whenever the property path has no:separator, which is exactly the case for this processor's own reverse-reference property. A few lines further down, the same method already expects an empty-string key for this case (isset($fields_to_extract[''])), so this only worked previously through PHP's implicit NULL-to-empty-string array key coercion — precisely the behavior PHP 8.5 now deprecates.Fix: change line 299 to
$to_extract[$property_name][$nested ?? ''][] = $field;, making the existing expectation explicit instead of relying on the deprecated coercion. No other logic changed.Added a Kernel test (
testAddFieldValuesWithoutNestedProperty) exercising the no-nested-property code path, which the existing test suite didn't cover (the existing test's property path includes a nested sub-property and never hits this branch). Verified on real PHP 8.5 that reverting the source fix (keeping the new test) reproduces the exact reported deprecation, "Using null as an array offset is deprecated, use an empty string instead", and that restoring the fix removes it while all assertions continue to pass.MR to follow.
Comment #5
andres alvarez commentedComment #8
bserem commentedmerge request !373 addresses more areas and also fixes the code quality finding on !357