Page MenuHomePhabricator

revision getPrevious() getNext()
Closed, ResolvedPublic

Description

Author: fabiogandola

Description:
Fatal error: Call to a member function getPreviousRevisionID() on a non-object

Line 560 & 573

560 : $prev = $this->getTitle()->getPreviousRevisionID( $this->getId() );

573 : $next = $this->getTitle()->getNextRevisionID( $this->getId() );

I think that getTitle doesn't give a Revision object, and calling on it getPreviousRevisionID and getNextRevisionID maybe is wrong.


Version: unspecified
Severity: normal
URL: http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/includes/Revision.php?annotate=37519

Details

Reference
bz14813

Event Timeline

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

(In reply to comment #0)

Fatal error: Call to a member function getPreviousRevisionID() on a non-object

Line 560 & 573

560 : $prev = $this->getTitle()->getPreviousRevisionID(
$this->getId() );

573 : $next = $this->getTitle()->getNextRevisionID(
$this->getId() );

I think that getTitle doesn't give a Revision object, and calling on it
getPreviousRevisionID and getNextRevisionID maybe is wrong.

Actually, getPreviousRevisionID() and getNextRevisionID() are Title members. The problem is that $this->getTitle() doesn't return an object ("on a non-object"), so stuff goes wrong when calling getPrevious() or getNext() on Revision objects that don't have valid associated Title objects.