}
if( !$this->mContentModel ) {
- throw new MWException( "failed to determin content model!" );
+ throw new MWException( 'Failed to determine content model!' );
}
return $this->mContentModel;
return $this->mLatestID = 0;
}
$linkCache = LinkCache::singleton();
+ $linkCache->addLinkObj( $this );
$cached = $linkCache->getGoodLinkFieldObj( $this, 'revision' );
if ( $cached === null ) { # check the assumption that the cache actually knows about this title
# XXX: this does apparently happen, see https://bugzilla.wikimedia.org/show_bug.cgi?id=37209
if ( !$wgContentHandlerUseDB &&
$this->getContentModel() !== $nt->getContentModel() ) {
// can't move a page if that would change the page's content model
- $errors[] = array( 'bad-target-model',
- ContentHandler::getLocalizedName( $this->getContentModel() ),
- ContentHandler::getLocalizedName( $nt->getContentModel() ) );
+ $errors[] = array(
+ 'bad-target-model',
+ ContentHandler::getLocalizedName( $this->getContentModel() ),
+ ContentHandler::getLocalizedName( $nt->getContentModel() )
+ );
}
// Image-specific checks
array()
);
- if ( $dbr->numRows( $res ) > 0 ) {
+ if ( $res->numRows() > 0 ) {
foreach ( $res as $row ) {
// $data[] = Title::newFromText($wgContLang->getNSText ( NS_CATEGORY ).':'.$row->cl_to);
$data[$wgContLang->getNSText( NS_CATEGORY ) . ':' . $row->cl_to] = $this->getFullText();
HTMLFileCache::clearFileCache( $this );
// Clear page info.
- $memcKey = wfMemcKey( 'infoaction', $this->getPrefixedText(), $this->getLatestRevID() );
- $success = $success && $wgMemc->delete( $memcKey );
+ $revision = WikiPage::factory( $this )->getRevision();
+ if( $revision !== null ) {
+ $memcKey = wfMemcKey( 'infoaction', $this->getPrefixedText(), $revision->getId() );
+ $success = $success && $wgMemc->delete( $memcKey );
+ }
return $success;
}