Page MenuHomePhabricator

WikiPage->getLastNAuthors( ) gives me error on a deleted file
Closed, InvalidPublic


I have written an extension which displays the last authors of any article.

When I delete a file and then call

 if ($wikiPage->exists())
   $foo= $wikiPage->getLastNAuthors(99);

I get an error when I do that:
Trying to get property of non-object in /opt/lampp/htdocs/mediawiki-1.24.0/includes/page/WikiPage.php on line 1113

Event Timeline

Schreibhan raised the priority of this task from to Low.
Schreibhan updated the task description. (Show Details)
Schreibhan added a subscriber: Schreibhan.
Aklapper raised the priority of this task from Low to Needs Triage.Dec 1 2015, 11:27 AM

Hi @Schreibhan, thanks for taking the time to report this!
Is this really MediaWiki 1.24.0 (which is an ancient unsupported version)?
Has this been brought up yet on ?

Schreibhan added a subscriber: saper.

We checked and the same code is in master.

WikiPage::getLastNAuthors() got removed from 1.27 git master with I06b617d7af5169046b484d22931922bf2f9a5b74

I have published a minimal extension to reproduce the problem:

one of the problems in the original report was the WikiPage->exists() returning true after the page has been deleted.

I cannot reproduce this with the above extension and git master ( c9e9880a3d48bb995f37406d168684867517a62c ), this is what gets logged:

[T119942ReprHooks::onSkinAfterContent] SkinAfter hook called
[T119942ReprHooks::onSkinAfterContent] $wikiPage->exists()? false
saper triaged this task as Low priority.