In a custom extension, I have a unit test that was working fine in MediaWiki 
1.26, but it fails in MediaWiki 1.27. I'd appreciate any pointers in the right 
direction.

The extension performs a page move, more or less like this (but with error 
checking):

  $mp = new MovePage($source, $destination);
  $result = $mp->move($context->getUser(), $reason, false);

The code works fine on a running wiki, but in a unit test under MW 1.27, I get 
this error:

  MWException: No valid null revision produced in MovePage::moveToInternal

The test seem to be running into issues with the LinkCache. The call to 
MovePage::move hits this line:

  $pageid = $this->oldTitle->getArticleID( Title::GAID_FOR_UPDATE );

which returns zero instead of the page's proper article ID. (This did not 
happen in MediaWiki 1.26.) Inside of Title::getArticleID we find these lines:

  if ( $flags & self::GAID_FOR_UPDATE ) {
    $oldUpdate = $linkCache->forUpdate( true );
    $linkCache->clearLink( $this );
    $this->mArticleID = $linkCache->addLinkObj( $this );
    $linkCache->forUpdate( $oldUpdate );
  }

The call to LinkCache::addLinkObj($this) returns zero. As a result, 
MovePage::moveInternal fails and we get the error message shown above.

So, I am wondering if anyone has any insights why this began happening with MW 
1.27, and what directions I should explore to make my test work again.

Thank you very much.
DanB


_______________________________________________
Wikitech-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to