Page MenuHomePhabricator

Navigation links, categories and {{PAGENAME}} are the ones of the Main_Page, if only ?diff= is given
Closed, ResolvedPublic

Description

When viewing a diff via a URL which only contain the diff number, the resulting page link to the main page rather than the page for which the diff occurred in.


Version: unspecified
Severity: normal
URL: http://meta.wikimedia.org/wiki/?diff=1001561&diffonly=yes

Details

Reference
bz14238

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:11 PM
bzimport set Reference to bz14238.
bzimport added a subscriber: Unknown Object (MLST).

This doesn't happen if both "diff" and "oldid" are present in the URL; this only happens when only "diff" is given and "diffonly" is set to "yes".

It looks like when the "oldid" value is not present, the default value of 0 is used, which falls back to Main Page. The diff itself works correctly because in DifferenceEngine.php we have:

elseif ( $this->mOldid === 0 ) {
  $rev = $this->mNewRev->getPrevious();
  if( $rev ) {
    $this->mOldid = $rev->getId();

So the oldid used for the diff is corrected, but that being used to create the content_actions is equal to zero.

I couldn't find where exactly this oldid is being used to create the content_actions link relating to the page itself; once it is located, using an approach similar to what I posted above can solve the bug.

  • Bug 14297 has been marked as a duplicate of this bug. ***

charlottethewebb wrote:

This doesn't happen if both "diff" and "oldid" are present in the URL; this
only happens when only "diff" is given and "diffonly" is set to "yes".

Maybe this is why I thought the bug had been fixed and un-fixed. I recently changed my prefs to diffonly by default. Sorry for duplicate 14297.

(In reply to comment #1)

This doesn't happen if both "diff" and "oldid" are present in the URL; this
only happens when only "diff" is given and "diffonly" is set to "yes".

The above first sentence is correct, but not the second. This does happen even when diffonly is not set. The casuse is when oldid is not set.

*** Bug 14437 has been marked as a duplicate of this bug. ***

  • This bug has been marked as a duplicate of bug 15233 ***