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 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)
Krenair added a subscriber: Krenair.

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

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!

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. :)

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

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

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 claimed this task.
matmarex removed a project: Patch-For-Review.