Page MenuHomePhabricator

Undefined variables $y (SpecialWatchlist) and property page_is_new (RecentChange) in REL1_5
Closed, ResolvedPublic

Description

Someone has reported to me the following problems

  • When accessing my watchlist page the following notice is displayed:

Notice: Undefined variable: y in d:\easyphp\www\includes\SpecialWatchlist.php on
line 217

and after it the following two notices are shown once for each page I have
configured to watch in my user profile:

Notice: Undefined property: page_is_new in
d:\easyphp\www\includes\RecentChange.php on line 383

Notice: Undefined property: page_is_new in
d:\easyphp\www\includes\RecentChange.php on line 393


Version: 1.5.x
Severity: major

Details

Reference
bz3162

Event Timeline

bzimport raised the priority of this task from to Unbreak Now!.Nov 21 2014, 8:47 PM
bzimport set Reference to bz3162.
bzimport added a subscriber: Unknown Object (MLST).

Fixed the first one, don't know about latter

(In reply to comment #1)

Fixed the first one, don't know about latter

Niklas:
Where have you fixed that ?
I cannot see an attachment, and als http://cvs.defau.lt hasn't your patch.

1st bug PATCH
In SpecialWatchlist.php change lines 215 ff

FROM
$header .= wfMsg( 'watchdetails', $wgLang->formatNum( $nitems ),

$header .= wfMsg( 'watchdetails', $wgLang->formatNum( $nitems / 2 ),

		$wgLang->formatNum( $npages ), $y, 
		$specialTitle->getFullUrl( 'edit=yes' ));

$wgOut->addWikiText( $header );

TO
$header .= wfMsg( 'watchdetails', $wgLang->formatNum( $nitems ) );

$header .= wfMsg( 'watchdetails', $wgLang->formatNum( $nitems / 2 ),

$wgOut->addWikiText( $header );

(In reply to comment #3)

1st bug PATCH
In SpecialWatchlist.php change lines 215 ff

FROM
$header .= wfMsg( 'watchdetails', $wgLang->formatNum( $nitems ),

$header .= wfMsg( 'watchdetails', $wgLang->formatNum( $nitems / 2 ),

		$wgLang->formatNum( $npages ), $y, 
		$specialTitle->getFullUrl( 'edit=yes' ));

$wgOut->addWikiText( $header );

TO
$header .= wfMsg( 'watchdetails', $wgLang->formatNum( $nitems ) );

$header .= wfMsg( 'watchdetails', $wgLang->formatNum( $nitems / 2 ),

$wgOut->addWikiText( $header );

I am not fully sure about these old lines. Needs review.

I dare about rising priority even higher, but these problems need to be fixed soon.

The first problem is related to the _old_ page header on watchlist. I have no
idea, if the two lines can be deleted (what I suggest) , or if someone of the
developers want to keep them there.

The second problem -- $row->page_is_new undefined properity in RecentChange.php

  • alerted me now after having studied the code in Article.php and

RecentChange.php . The "undefined property" could be related to an overlooked or
forgotten fix due to recent schema change. Remark: the reporter of the bug (not
me) runs Easyphp, which might be not so relucant to undefined stuff as PHP is
sometimes.

Somebody wrote rev_is_new instead of page_is_new.