weirdgloop / mediawiki-extensions-SearchDigest

Displays the most popular failed wiki searches in a special page, Special:SearchDigest.
GNU General Public License v3.0
1 stars 7 forks source link

REL1_39 branch - SpecialSearchDigest.php incorrectly uses "MediaWiki\Title\Title" when it should just be "Title" #12

Closed MelvorIdle closed 4 months ago

MelvorIdle commented 4 months ago

Hello,

We had trouble loading the Special:SearchDigest page on our Wiki that is using the 1.39 release candidate. After some investigation, we found that SpecialSearchDigest.php uses an incorrect class for the respective MediaWiki version.

SpecialSearchDigest.php : Line 11

use MediaWiki\Title\Title;

Should be

use Title;

This is specifically for the REL1_39 branch.

MediaWiki reference: https://www.mediawiki.org/wiki/Manual:Title.php

alistair3149 commented 4 months ago

The MediaWiki\Title\Title class alias is added since MediaWiki 1.39.4, so it is technically correct for the REL1_39 branch as it only requires to maintain compatibility for the latest 1.39.x release.

The solution can either be changing back to the older class in the REL1_39 branch of the extension to support < 1.39.4, or you can update pass 1.39.4 (the latest patch release is 1.39.7).

jayktaylor commented 4 months ago

Hey @MelvorIdle, I've pushed https://github.com/weirdgloop/mediawiki-extensions-SearchDigest/commit/e1ccf249eb9c1ec5c83c041efe4cdc8187aa3544 to the REL1_39 branch which should fix this issue. As mentioned above, 1.39.4 does add support for MediaWiki\Title\Title, but it seems easier to change the extension code so that it would work across all 1.39 versions.