Page MenuHomePhabricator

Deprecated usage of PrefixSearchBackend hook
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  1. Set up a new instance of Mediawiki 1.41.0
  2. Enable Extension:TitleKey
  3. See the Deprecation Warning below

What happens?:

When using this extension with mediawiki 1.41.0 (latest stable) this is creating the following deprecation warning:

Deprecated: Use of PrefixSearchBackend hook (used in TitleKey::prefixSearchBackend) was deprecated in MediaWiki 1.27. [Called from MediaWiki\HookContainer\HookContainer::register in /app/includes/HookContainer/HookContainer.php at line 438] in /app/includes/debug/MWDebug.php on line 386

What should have happened instead?:

Software version (skip for WMF-hosted wikis like Wikipedia):
1.41.0

Other information (browser name/version, screenshots, etc.):

Screenshot 2023-12-23 at 18-18-43 Test.png (939×1 px, 196 KB)

Event Timeline

Change 985385 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/extensions/TitleKey@master] Drag the extension somewhat up to date...

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

Change #985385 merged by jenkins-bot:

[mediawiki/extensions/TitleKey@master] Drag the extension somewhat up to date...

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

Aklapper assigned this task to Reedy.
Aklapper moved this task from Backlog to Hacking projects on the Wikimedia-Hackathon-2024 board.

User giving feedback that this works, but the maintenance script depends on 1.42. Using getDBLoadBalancerFactory instead of getConnectionProvider would fix this and fixing that might be valuable (as well as back porting to 1.39 ). extension.json claims 1.39 compatibility.

TheDJ added a project: User-TheDJ.

Change #1035832 had a related patch set uploaded (by TheDJ; author: TheDJ):

[mediawiki/extensions/TitleKey@master] REL1_41 should not use 1.42 getConnectionProvider()

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

Change #1035832 merged by jenkins-bot:

[mediawiki/extensions/TitleKey@master] REL1_41 should not use 1.42 getConnectionProvider()

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

This breaks the search engine.

Reading more and more of this code (and finally understanding it), I think this deprecation is actually problematic. It should have been replaced with a better hook, instead of removed and 'build your own entire search backend for all types of search'

Also considering adding a collation option to core, but this might not be performant enough in day to day operations for some of the wikis which currently use the title key extension ?

Change #1036312 had a related patch set uploaded (by TheDJ; author: TheDJ):

[mediawiki/extensions/TitleKey@master] TitleKey prefixsearch has to override each backend

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

Change #1036312 merged by jenkins-bot:

[mediawiki/extensions/TitleKey@master] TitleKey prefixsearch has to override each backend

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

Change #1063214 had a related patch set uploaded (by MarkAHershberger; author: TheDJ):

[mediawiki/extensions/TitleKey@REL1_42] TitleKey prefixsearch has to override each backend

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

Change #1063214 abandoned by MarkAHershberger:

[mediawiki/extensions/TitleKey@REL1_42] TitleKey prefixsearch has to override each backend

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

Change #1065748 had a related patch set uploaded (by TheDJ; author: Reedy):

[mediawiki/extensions/TitleKey@REL1_42] Drag the extension somewhat up to date...

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

Change #1065748 merged by jenkins-bot:

[mediawiki/extensions/TitleKey@REL1_42] Drag the extension somewhat up to date...

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

I don't really feel like backporting this all the way to 1.41. It's only a deprecation warning after all.