Last modified: 2012-05-08 18:24:33 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T38625, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 36625 - New Pages Feed - Blocked users bug
New Pages Feed - Blocked users bug
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
PageCuration (Other open bugs)
unspecified
All All
: High major (vote)
: ---
Assigned To: Nobody - You can work on this!
http://en.wikipedia.org/wiki/Special:...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-08 01:44 UTC by Fabrice Florin
Modified: 2012-05-08 18:24 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Fabrice Florin 2012-05-08 01:44:06 UTC
It appears that the new deployment of the New Pages Feed (a.k.a. Page Triage) may have caused some malfunctions regarding blocked users. 

The purpose of this ticket is to 1) find out what caused the problem and 2) if it is related to New Pages Feed, make sure this doesn't happen again.

Let's use the comments below to identify 1) and implement 2), as needed.
Comment 1 Sam Reed (reedy) 2012-05-08 01:55:57 UTC
It was fairly simple. The error being thrown was “DatabaseBase::makeList: empty input”. I’m guessing you missed the commit: https://gerrit.wikimedia.org/r/#/c/6886/

Based on the code, $pageIds is an array, used as part of the where query. 

                                $dbw->update(  
                                                'pagetriage_page_tags',
                                                array( 'ptrpt_value' => $status ),
                                                array( 'ptrpt_page_id' => $pageIds, 'ptrpt_tag_id' => $tags['user_block_status'] )
                                );

In some cases, the select query above can return no results, e.g.

                                $dbw->update(  
                                                'pagetriage_page_tags',
                                                array( 'ptrpt_value' => $status ),
                                                array( 'ptrpt_page_id' => array(), 'ptrpt_tag_id' => $tags['user_block_status'] )
                                );

So when MediaWiki tries to build the SQL query from the components it notices you have passed an array, but there are no elements. I’m not sure there are any cases where you would want to do a comparison against 0 elements, so it throws an exception as a “this shouldn’t be happening”.

The fix is literally just making sure it doesn’t attempt to run that update query if there are no elements on that where condition. If there isn’t any elements, bail out of the method and don’t go any further.

It’s in Git so you won’t have any regressions in future unless you remove the code ;)

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links