Page MenuHomePhabricator

TypeError: Argument 1 passed to MediaWiki\Revision\RevisionStore::newRevisionFromArchiveRowAndSlots() must be an instance of stdClass, instance of Flow\Formatter\DeletedContributionsRow given, called in /srv/mediawiki/php-1.37.0-wmf.18/includes/Revision/RevisionStore.php on line 1535
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error
normalized_message
[{reqId}] {exception_url}   TypeError: Argument 1 passed to MediaWiki\Revision\RevisionStore::newRevisionFromArchiveRowAndSlots() must be an instance of stdClass, instance of Flow\Formatter\DeletedContributionsRow given, called in /srv/mediawiki/php-1.37.
exception.trace
from /srv/mediawiki/php-1.37.0-wmf.18/includes/Revision/RevisionStore.php(1578)
#0 /srv/mediawiki/php-1.37.0-wmf.18/includes/Revision/RevisionStore.php(1535): MediaWiki\Revision\RevisionStore->newRevisionFromArchiveRowAndSlots(Flow\Formatter\DeletedContributionsRow, NULL, integer, NULL, array)
#1 /srv/mediawiki/php-1.37.0-wmf.18/includes/specials/pagers/DeletedContribsPager.php(267): MediaWiki\Revision\RevisionStore->newRevisionFromArchiveRow(Flow\Formatter\DeletedContributionsRow)
#2 /srv/mediawiki/php-1.37.0-wmf.18/includes/pager/IndexPager.php(611): DeletedContribsPager->formatRow(Flow\Formatter\DeletedContributionsRow)
#3 /srv/mediawiki/php-1.37.0-wmf.18/includes/specials/SpecialDeletedContributions.php(170): IndexPager->getBody()
#4 /srv/mediawiki/php-1.37.0-wmf.18/includes/specialpage/SpecialPage.php(646): SpecialDeletedContributions->execute(string)
#5 /srv/mediawiki/php-1.37.0-wmf.18/includes/specialpage/SpecialPageFactory.php(1365): SpecialPage->run(string)
#6 /srv/mediawiki/php-1.37.0-wmf.18/includes/MediaWiki.php(314): MediaWiki\SpecialPage\SpecialPageFactory->executePath(string, RequestContext)
#7 /srv/mediawiki/php-1.37.0-wmf.18/includes/MediaWiki.php(925): MediaWiki->performRequest()
#8 /srv/mediawiki/php-1.37.0-wmf.18/includes/MediaWiki.php(559): MediaWiki->main()
#9 /srv/mediawiki/php-1.37.0-wmf.18/index.php(53): MediaWiki->run()
#10 /srv/mediawiki/php-1.37.0-wmf.18/index.php(46): wfIndexMain()
#11 /srv/mediawiki/w/index.php(3): require(string)
#12 {main}
Impact

Special:DeletedContributions cannot be used for some users.

Notes

This is a follow-up to T288563, which was an UBN. To keep the records happy, this bug serves to follow-up the older task.

Details

Request URL
https://www.mediawiki.org/wiki/Special:DeletedContributions/Matin235

Event Timeline

Urbanecm added a subscriber: Urbanecm.

Reopening, for reasoning see T288563#7288246.

Urbanecm updated the task description. (Show Details)
Urbanecm moved this task from Untriaged to Aug 2021 on the Wikimedia-production-error board.
Urbanecm added a subscriber: Zabe.

The way Flow injects fake rows into the contribs pager is quite horrid, but pretty much impossible to fix. It's a direct consequence of the fact that flow implements its own revision storage instead of using core's.

So, Flow injects fake rows into the contribs pager. These fake rows are *not* instances of stdClass (which is the class of anonymous objects only). Flow has a hierarchy of classes it uses for fake contributions rows, with FormatterRow as the base class.

Either Flow needs to be changed to use anonymous objects instead, or RevisionStore needs to be more made lenient, so it accepts fake rows that are not true anonymous objects.

A third option would be to have ContribsPager convert from "full" objects to "anon" objects. But that's even more messy.

As a short term solution, I propose to change the type hint in RevisionStore from stdClass to object, and add a comment to the @param line explaining that other kinds of objects are currently accepted.

We could make a ticket for fixing this situation, but the only true fix in my mind involves rewriting Flow...

I think the easiest thing to do for now is to implement Tim's previous solution to this since it's throwing at the same logical spot, but this time for archived rows

I think the easiest thing to do for now is to implement Tim's previous solution to this since it's throwing at the same logical spot, but this time for archived rows

After having looked at Tim's fix and realizing that we don't actually need to create a Revisionrecord for the fake row that Flow injects, I think you are right.

Change 713687 had a related patch set uploaded (by TChin; author: TChin):

[mediawiki/core@master] DeletedContribsPager row filtering with RevisionStore::isRevisionRow

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

Change 713687 merged by jenkins-bot:

[mediawiki/core@master] DeletedContribsPager row filtering with RevisionStore::isRevisionRow

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