This is a follow-up to Ifd63cdf1 (
c8e0ec3f)
Currently if rev_parent_id is not populated on a row we just
output an empty bullet - <li class=""></li>. (Which can
happen if an update is performed properly. There are (were?) some
examples of this on en wikipedia. I was just talking to a user
who had some of his revisions not be populated for that field,
so it can happen.) Heck there's even code that checks for this
case inside the if statement (before this commit) that stops
non rev_parent_id rows from being processed.
This seems very very wrong to me. Change the check for if a revision
is valid to look for rev_id (which is the primary key, so
going to be there, and always has been there).
Also in the
case we don't have a valid revision and can't format it
(For example, an ext made a hook that added random rows
to the Special:Contribs query, but forgot to format some),
instead of outputting an empty bullet, output just an
html comment, (and a debug log entry).
Thank you to Isarra for reporting this issue.
Change-Id: I7ef562d6e829877dd8ea4ffb1e7e04b46c943ec1
History page.
* (bug 42949) API no longer assumes all exceptions are MWException.
* (bug 41733) Hide "New user message" (.usermessage) element from printable view.
+* (bug 39062) Special:Contributions will display changes that don't have
+ a parent id instead of just an empty bullet item.
=== API changes in 1.21 ===
* prop=revisions can now report the contentmodel and contentformat.
*/
wfSuppressWarnings();
$rev = new Revision( $row );
- $validRevision = $rev->getParentId() !== null;
+ $validRevision = (bool) $rev->getId();
wfRestoreWarnings();
if ( $validRevision ) {
wfRunHooks( 'ContributionsLineEnding', array( $this, &$ret, $row, &$classes ) );
$classes = implode( ' ', $classes );
- $ret = "<li class=\"$classes\">$ret</li>\n";
+ if ( $classes === '' && $ret === '' ) {
+ wfDebug( 'Dropping Special:Contribution row that could not be formatted' );
+ $ret = "<!-- Could not format Special:Contribution row. -->\n";
+ } else {
+ $ret = "<li class=\"$classes\">$ret</li>\n";
+ }
wfProfileOut( __METHOD__ );
return $ret;