&& ( !$this->mContentModel || $flags === self::GAID_FOR_UPDATE )
&& $this->getArticleID( $flags )
) {
- $linkCache = LinkCache::singleton();
+ $linkCache = MediaWikiServices::getInstance()->getLinkCache();
$linkCache->addLinkObj( $this ); # in case we already had an article ID
$this->mContentModel = $linkCache->getGoodLinkFieldObj( $this, 'model' );
}
return $errors;
}
- if ( $wgEmailConfirmToEdit && !$user->isEmailConfirmed() ) {
+ if ( $wgEmailConfirmToEdit
+ && !$user->isEmailConfirmed()
+ && $action === 'edit'
+ ) {
$errors[] = [ 'confirmedittext' ];
}
$this->mArticleID = 0;
return $this->mArticleID;
}
- $linkCache = LinkCache::singleton();
+ $linkCache = MediaWikiServices::getInstance()->getLinkCache();
if ( $flags & self::GAID_FOR_UPDATE ) {
$oldUpdate = $linkCache->forUpdate( true );
$linkCache->clearLink( $this );
return $this->mRedirect;
}
- $linkCache = LinkCache::singleton();
+ $linkCache = MediaWikiServices::getInstance()->getLinkCache();
$linkCache->addLinkObj( $this ); # in case we already had an article ID
$cached = $linkCache->getGoodLinkFieldObj( $this, 'redirect' );
if ( $cached === null ) {
$this->mLength = 0;
return $this->mLength;
}
- $linkCache = LinkCache::singleton();
+ $linkCache = MediaWikiServices::getInstance()->getLinkCache();
$linkCache->addLinkObj( $this ); # in case we already had an article ID
$cached = $linkCache->getGoodLinkFieldObj( $this, 'length' );
if ( $cached === null ) {
$this->mLatestID = 0;
return $this->mLatestID;
}
- $linkCache = LinkCache::singleton();
+ $linkCache = MediaWikiServices::getInstance()->getLinkCache();
$linkCache->addLinkObj( $this ); # in case we already had an article ID
$cached = $linkCache->getGoodLinkFieldObj( $this, 'revision' );
if ( $cached === null ) {
* @param int $newid The new Article ID
*/
public function resetArticleID( $newid ) {
- $linkCache = LinkCache::singleton();
+ $linkCache = MediaWikiServices::getInstance()->getLinkCache();
$linkCache->clearLink( $this );
if ( $newid === false ) {
}
public static function clearCaches() {
- $linkCache = LinkCache::singleton();
+ $linkCache = MediaWikiServices::getInstance()->getLinkCache();
$linkCache->clear();
$titleCache = self::getTitleCache();
$retVal = [];
if ( $res->numRows() ) {
- $linkCache = LinkCache::singleton();
+ $linkCache = MediaWikiServices::getInstance()->getLinkCache();
foreach ( $res as $row ) {
$titleObj = self::makeTitle( $row->page_namespace, $row->page_title );
if ( $titleObj ) {
);
$retVal = [];
- $linkCache = LinkCache::singleton();
+ $linkCache = MediaWikiServices::getInstance()->getLinkCache();
foreach ( $res as $row ) {
if ( $row->page_id ) {
$titleObj = self::newFromRow( $row );
// check, if the page language could be saved in the database, and if so and
// the value is not requested already, lookup the page language using LinkCache
if ( $wgPageLanguageUseDB && $this->mDbPageLanguage === false ) {
- $linkCache = LinkCache::singleton();
+ $linkCache = MediaWikiServices::getInstance()->getLinkCache();
$linkCache->addLinkObj( $this );
$this->mDbPageLanguage = $linkCache->getGoodLinkFieldObj( $this, 'lang' );
}