Page MenuHomePhabricator

CargoSQLQuery: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated on PHP 8.1
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue:

  • Issue a Cargo query via the API or the parser function that doesn't include a WHERE clause

What happens?:

18:27:30 str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated
18:27:30 
18:27:30 /workspace/src/extensions/Cargo/includes/CargoSQLQuery.php:120
18:27:30 /workspace/src/extensions/Cargo/includes/CargoSQLQuery.php:55
18:27:30 /workspace/src/extensions/Cargo/includes/api/CargoQueryAPI.php:31
18:27:30 /workspace/src/includes/api/ApiMain.php:1908
18:27:30 /workspace/src/includes/api/ApiMain.php:853
18:27:30 /workspace/src/tests/phpunit/includes/api/ApiTestCase.php:122
18:27:30 /workspace/src/extensions/Cargo/tests/phpunit/integration/api/CargoQueryAPIIntegrationTest.php:40
18:27:30 /workspace/src/tests/phpunit/MediaWikiIntegrationTestCase.php:522

Event Timeline

Change 908899 had a related patch set uploaded (by TK-999; author: TK-999):

[mediawiki/extensions/Cargo@master] CargoSQLQuery: Account for potential null WHERE condition

https://gerrit.wikimedia.org/r/908899

Change 908899 merged by jenkins-bot:

[mediawiki/extensions/Cargo@master] CargoSQLQuery: Account for potential null WHERE condition

https://gerrit.wikimedia.org/r/908899