Jump to content

Topic on Extension talk:GoogleCustomWikiSearch

PHP Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated

5
Summary by Tosfos

patched

Kghbln (talkcontribs)
Setup
  • MediaWiki 1.39.6 (0e03068) 2024-03-11T16:26:30
  • PHP 8.1.2-1ubuntu2.14 (apache2handler)
  • MariaDB 10.6.16-MariaDB-0ubuntu0.22.04.1
  • GoogleCustomWikiSearch 0.6.0 (3436331) 2024-02-09T05:42:00
Issue

When searching for something via "Special:Search" I am getting these deprecation warnings: "PHP Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated"

Backtrace
#0 [internal function]: MWExceptionHandler::handleError()
#1 /../w/extensions/GoogleCustomWikiSearch/includes/GoogleCustomWikiSearch.php(228): str_replace()
#2 /../w/extensions/GoogleCustomWikiSearch/includes/GoogleCustomWikiSearchHooks.php(53): GoogleCustomWikiSearch::getSearchTerm()
#3 /../w/includes/HookContainer/HookContainer.php(338): GoogleCustomWikiSearchHooks::onSpecialPageAfterExecute()
#4 /../w/includes/HookContainer/HookContainer.php(137): MediaWiki\HookContainer\HookContainer->callLegacyHook()
#5 /../w/includes/HookContainer/HookRunner.php(3673): MediaWiki\HookContainer\HookContainer->run()
#6 /../w/includes/specialpage/SpecialPage.php(704): MediaWiki\HookContainer\HookRunner->onSpecialPageAfterExecute()
#7 /../w/includes/specialpage/SpecialPageFactory.php(1428): SpecialPage->run()
#8 /../w/includes/MediaWiki.php(316): MediaWiki\SpecialPage\SpecialPageFactory->executePath()
#9 /../w/includes/MediaWiki.php(904): MediaWiki->performRequest()
#10 /../w/includes/MediaWiki.php(562): MediaWiki->main()
#11 /../w/index.php(50): MediaWiki->run()
#12 /../w/index.php(46): wfIndexMain()
#13 {main}
Elcapitan68 (talkcontribs)

Thank you, @Kghbln It looks like a PHP8 related issue. Passing to WikiTeq devs. In the meantime, please confirm if search still works despite the deprecation warnings, or it is broken.

Kghbln (talkcontribs)

Thank you for your feedback. Yes, the search results are still showing.

Tosfos (talkcontribs)

A developer was assigned to this task. We'll let you know once we have an update. Thanks for the report!

Tosfos (talkcontribs)

A patch to address this was added to the master branch and 1.39.