Last modified: 2011-07-29 18:45:57 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T32058, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 30058 - Revision::getTitle() will return 'null' when Revision::newFromArchiveRow() was used
Revision::getTitle() will return 'null' when Revision::newFromArchiveRow() wa...
Status: NEW
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
1.17.x
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-07-25 19:26 UTC by Daniel A. R. Werner
Modified: 2011-07-29 18:45 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Daniel A. R. Werner 2011-07-25 19:26:59 UTC
When you create a new revision object by using Revision::newFromArchiveRow() this revision object will not be able to call Revision::getTitle() with returning the right result.
One way would be to set Revision::mTitle direclty from within Revision::newFromArchiveRow() which would require to load the title and namespace information from the archive row.
Or a more complicated getTitle() function.

By the way, there is a related bug in Revision::newFromArchiveRow()
$row->page_id doesn't make any sense, it should be $row->ar_page_id, reported this in the mw irc channel already so perhaps it's fixed by now.
Comment 1 Aaron Schulz 2011-07-25 19:27:44 UTC
Related bug was fixed in r93081.
Comment 2 Brion Vibber 2011-07-29 18:45:57 UTC
Looks like if the title isn't set it tries to look it up in the db on demand via the revision id -- which obviously fails if there's no revision.

The Revision constructor will build a Title object if it sees that page_latest is present on an actual row (you joined against the 'page' table), but this isn't done in the other path.

Probably should do:

* inject the ar_namespace and ar_title into the array when doing Revision::newFromArchiveRow
* in constructor: if namespace & title subfields are provided in the array, set mTitle with Title::makeTitle

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links