Open-CSP / WSSlots

This extension improves support for slots in MediaWiki.
GNU General Public License v2.0
2 stars 3 forks source link

Support newer (1.41+) MediaWiki versions #27

Open DanielWTQ opened 3 weeks ago

DanielWTQ commented 3 weeks ago

I was looking to use this extension in 1.42, and it seems like the extension is broken due to the use of WikiPage::factory() in both WSSlotsHooksonBeforeDataUpdateComplete() https://github.com/Open-CSP/WSSlots/blob/dfdcd6adea3fae512c4469704ef93accff83937f/src/WSSlotsHooks.php#L137 and the WikiPageTrait trait https://github.com/Open-CSP/WSSlots/blob/dfdcd6adea3fae512c4469704ef93accff83937f/src/WikiPageTrait.php#L33-L35

This method was removed in MediaWiki 1.41, see https://github.com/wikimedia/mediawiki/commit/f3885d455e6b8bcc0308453e1f375b5e77915226 and https://phabricator.wikimedia.org/T297688.

The extension currently requires 1.35+, but the replacement for this method, using the WikiPageFactory service, is only available since 1.36 - given that 1.35 is no longer supported, rather than adding some version-conditional logic I suggest bumping the minimum version to 1.39 (the oldest still-supported version) and then just always using the factory - this would also allow simplifying things like the conditional logic in WSSlots::editSlots() for handling the watchlist: https://github.com/Open-CSP/WSSlots/blob/dfdcd6adea3fae512c4469704ef93accff83937f/src/WSSlots.php#L241-L255

Note: I have not actually tested this extension with 1.42 yet, so there might be other places that are broken - it might be useful to add some CI

tosfos commented 2 weeks ago

It seems like OpenCSP's latest supported version is 1.39 and that the prior supported version was 1.35. This points to an ltsrel compatibility policy. Is that correct? And does that policy also apply to WSSlots? If so, I suggest noting this in the documentation. Thanks!