PHP Deprecated: a:5:{s:11:"deprecation";s:95:"http_build_query(): Passing null to parameter #2 ($numeric_prefix) of type string is deprecated";s:5:"class";s:50:"Drupal\Tests\search_api_solr\Functional\FacetsTest";s:6:"method";s:10:"testFacets"
PHP Deprecated: a:5:{s:11:"deprecation";s:230:"Return type of Drupal\search_api\Item\Field::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice"
PHP Deprecated: a:5:{s:11:"deprecation";s:79:"strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated"
Deprecated function: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated
| Comment | File | Size | Author |
|---|---|---|---|
| #22 | searchapi-php81.patch | 382 bytes | michele bertani |
| #10 | 3253738-10.patch | 6.01 KB | alexpott |
| #10 | 9-10-interdiff.txt | 614 bytes | alexpott |
| #9 | 3253738-9.patch | 6.61 KB | alexpott |
| #9 | 6-9-interdiff.txt | 614 bytes | alexpott |
Comments
Comment #2
mkalkbrennerComment #3
mkalkbrennerComment #4
mkalkbrennerComment #5
mkalkbrennerComment #6
drunken monkeyThanks a lot for your work on this so far, and thanks for pinging me about it.
Your changes so far are looking good, just one comment:
By the method’s contract,
$property_pathalready has to be a string, so we should fix the caller instead. (In a second step, we might of course want to add proper type hints.)I also managed to fix some of the remaining warnings.
Unfortunately, though, my distro doesn’t include PHP 8.1 yet, and I didn’t manage to get MySQL working in my manual build. So especially the autocomplete fail, which I couldn’t reproduce, may just be specific to MySQL.
Furthermore, for the problems in
system_requirements()and\Drupal\Core\Extension\ModuleDependencyMessageTrait::checkDependencyMessage()it seems to me like this might be Core’s fault: it sets the default for'version'toNULLin\Drupal\Core\Extension\ModuleExtensionList::$defaults, which then leads to those errors. Changing this default to''fixes the warnings for me.Comment #7
alexpottHere's a fix for the core issue - #3239287: Fix \Drupal\Core\Extension\ModuleDependencyMessageTrait to not cause deprecations in PHP 8.1
Comment #8
alexpottI can't reproduce the autocomplete fail locally on PHP 8.1 / 9.3.x and mysql / sqlite or psql ... looks like something specific to mysql on DrupalCI... that's not fun.
Comment #9
alexpottI think that maybe order is not something that we need to care about here so perhaps the simplest thing to do is change the assert.
Comment #10
alexpottOkay so I far as I can see the fail in \Drupal\Tests\search_api_db\Kernel\AutocompleteTest::testAutocompletion is related to DrupalCI mysql 5.7. If I get the docker container and use that in local testing then this test fails regardless of PHP version.
I'm going to open another issue to fix this. The change in #9 is wrong so reverting.
Comment #11
alexpottHere's the existing issue. :) #3091198: Investigate problems on MySQL 5.6/5.7
Comment #12
alexpottIf you know of upstream projects that extend these classes and override these methods it might be friendlier to add the [#\ReturnTypeWillChange] PHP attribute instead.
Comment #13
alexpottWe can change the return types in the upcoming 2.0.x version of Search API
Comment #15
drunken monkeyAwesome, thanks a lot for your help! Great we even got the Core issue fixed …
I’m pretty sure no-one overrides any of those classes, but you’re right, it’s cleaner not to introduce a BC break for this.
So, no objections to your last patch. Committed. Thanks again!
Comment #16
idebr commented@drunken monkey Facets module is reporting PHP8.1 deprecations since it depends on Search API. Is there a plan for a minor release?
[edit] See https://www.drupal.org/node/2348769/qa
Comment #17
andypostFiled follow-up for facets #3255241: Add compatibility with PHP 8.1
Comment #18
drunken monkeyHuh, strange … I though automated tests will use the latest dev version by default, not the latest stable release.
Anyways, yes, I’ll create a new release shortly, so should be resolved soon.
Comment #20
michele bertani commentedthere are plan to incorporate this patch on the 8.x branch?
Comment #21
idebr commentedThis issue was released in 8.x-1.22, see https://www.drupal.org/project/search_api/releases/8.x-1.22
Comment #22
michele bertani commentedwith php 8.1 and v8.x-1.25 i still have deprecation errors
Deprecated function: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in Drupal\search_api\Utility\Utility::splitPropertyPath()this is the patch i have used to solve the issue
Comment #23
idebr commented#22 That particular code wasn't touched in the code committed in this issue. I suggest you file a new follow-up issue and upload your patch file there, since this issue is now Closed.