enterprisemediawiki / Wiretap

User pageview tracking for MediaWiki
4 stars 6 forks source link

Fatal error on REL1_28 #17

Closed freephile closed 6 years ago

freephile commented 6 years ago

On https://demo.qualitybox.us/wiki/Special:Wiretap?requestDebug=true&useskin=vector

I get Fatal error: Call to undefined method SkinVector::link() in /opt/htdocs/mediawiki/extensions/Wiretap/SpecialWiretap.php on line 528

That line is

$page = $this->getSkin()->link( $pageTitle );

I tried inserting a context (property) or getContext() method into the chain, but that too errored:

$page = $this->getContext->getSkin()->link( $pageTitle );

I could only find a link method in the Linker class. https://doc.wikimedia.org/mediawiki-core/master/php/classLinker.html#ad97e40cfea2343c5cae8307cf1fe47a4

Solution

A little more digging reveals that indeed there was a change in REL1_28 that removed this link functionality. All the previously aliased methods in Skin have been removed. You now have to use LinkRenderer instead

Here's an example of a Special Page that was updated for this change. https://gerrit.wikimedia.org/r/#/c/292077/3/includes/specials/SpecialNewpages.php

freephile commented 6 years ago

See https://www.mediawiki.org/wiki/Manual:LinkRenderer The documentation for Linker still shows a 'link' method, but the release notes say that you should use LinkRenderer for versions of MediaWiki >= 1.28

There is an old Google Code In project to clean up extensions which use the deprecated Linker class methods. This led to a Phab Task #T149346 with the same goal.

The removed methods as of REL1_28

Aliases for Linker methods, deprecated since 1.21, were removed from Skin:

jamesmontalvo3 commented 6 years ago

Closed by #19