Page MenuHomePhabricator

RecentChanges has buggy function [numRows() with $wgAllowCategorizedRecentChanges]
Closed, ResolvedPublic

Description

With $wgAllowCategorizedRecentChanges = true and adding a category name this error occurs:

Fatal error: Call to a member function numRows() on a non-object in .../includes/specialpage/ChangesListSpecialPage.php on line 337

MW 1.24.1, also spotted in MW 1.22.12

Solution:
if ( $rows->numRows() === 0 ) {
must read
if ( $rows === 0 ) {

Event Timeline

Subfader created this task.Jan 3 2015, 11:08 PM
Subfader renamed this task from RecentChanges to RecentChanges has buggy function [numRows() with $wgAllowCategorizedRecentChanges].
Subfader raised the priority of this task from to Needs Triage.
Subfader updated the task description. (Show Details)
Subfader set Security to None.
Subfader added a subscriber: Subfader.
Subfader updated the task description. (Show Details)Jan 3 2015, 11:18 PM
Subfader updated the task description. (Show Details)
Krenair added a subscriber: Krenair.

@Subfader, when creating a task you need to associate the relevant projects

Aklapper triaged this task as Low priority.Jan 4 2015, 12:25 PM

Solution:
if ( $rows->numRows() === 0 ) {
must read
if ( $rows === 0 ) {

Thanks for finding the right place in the code! Please feel very welcome to use developer access to submit this as a Git branch directly into Gerrit. Putting your branch in Git makes it easy to review it quickly. If you don't want to set up Git/Gerrit, you can also use the Gerrit Patch Uploader. Thanks again!

D3r1ck01 claimed this task.Oct 15 2015, 4:49 AM

Can i have a link to the extension so i can clone, i have searched on gerrit and it seems it is not there. Or are my not using the correct name? What is the name of the extension?

Ok, it is not actually and extension. It is in the wikicore. :)

D3r1ck01 removed D3r1ck01 as the assignee of this task.Oct 16 2015, 10:36 PM

Change 343426 had a related patch set uploaded (by Jforrester):
[mediawiki/core] Drop the 'CategorizedRecentChanges' feature

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

Restricted Application added a subscriber: TerraCodes. · View Herald TranscriptMar 18 2017, 1:23 AM

Solution:
if ( $rows->numRows() === 0 ) {
must read
if ( $rows === 0 ) {

This isn't the right solution. $rows is normally a ResultWrapper, or an array when using $wgAllowCategorizedRecentChanges. Never a number.

Change 343648 had a related patch set uploaded (by Bartosz Dziewoński):
[mediawiki/core] SpecialRecentchanges: Unbreak $wgAllowCategorizedRecentChanges

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

Change 343648 merged by jenkins-bot:
[mediawiki/core] SpecialRecentchanges: Unbreak $wgAllowCategorizedRecentChanges

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

matmarex closed this task as Resolved.Mar 21 2017, 10:34 AM
matmarex claimed this task.
matmarex removed a project: Patch-For-Review.