}
if ( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) {
- $messageCache = MessageCache::singleton();
- $messageCache->updateMessageOverride( $this->mTitle, $this->getContent() );
+ // @todo move this logic to MessageCache
+ if ( $this->exists() ) {
+ // NOTE: use transclusion text for messages.
+ // This is consistent with MessageCache::getMsgFromNamespace()
+
+ $content = $this->getContent();
+ $text = $content === null ? null : $content->getWikitextForTransclusion();
+
+ if ( $text === null ) {
+ $text = false;
+ }
+ } else {
+ $text = false;
+ }
+
+ MessageCache::singleton()->replace( $this->mTitle->getDBkey(), $text );
}
return true;
* - 'no-change': don't update the article count, ever
*/
public function doEditUpdates( Revision $revision, User $user, array $options = [] ) {
- global $wgRCWatchCategoryMembership;
+ global $wgRCWatchCategoryMembership, $wgContLang;
$options += [
'changed' => true,
}
if ( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) {
- MessageCache::singleton()->updateMessageOverride( $this->mTitle, $content );
+ // XXX: could skip pseudo-messages like js/css here, based on content model.
+ $msgtext = $content ? $content->getWikitextForTransclusion() : null;
+ if ( $msgtext === false || $msgtext === null ) {
+ $msgtext = '';
+ }
+
+ MessageCache::singleton()->replace( $shortTitle, $msgtext );
+
+ if ( $wgContLang->hasVariants() ) {
+ $wgContLang->updateConversionTable( $this->mTitle );
+ }
}
if ( $options['created'] ) {
*/
public function doDeleteArticleReal(
$reason, $suppress = false, $u1 = null, $u2 = null, &$error = '', User $user = null,
- $tags = []
+ $tags = [], $logsubtype = 'delete'
) {
global $wgUser, $wgContentHandlerUseDB;
// Log the deletion, if the page was suppressed, put it in the suppression log instead
$logtype = $suppress ? 'suppress' : 'delete';
- $logEntry = new ManualLogEntry( $logtype, 'delete' );
+ $logEntry = new ManualLogEntry( $logtype, $logsubtype );
$logEntry->setPerformer( $user );
$logEntry->setTarget( $logTitle );
$logEntry->setComment( $reason );
* @param Title $title
*/
public static function onArticleDelete( Title $title ) {
+ global $wgContLang;
+
// Update existence markers on article/talk tabs...
$other = $title->getOtherPage();
// Messages
if ( $title->getNamespace() == NS_MEDIAWIKI ) {
- MessageCache::singleton()->updateMessageOverride( $title, null );
+ MessageCache::singleton()->replace( $title->getDBkey(), false );
+
+ if ( $wgContLang->hasVariants() ) {
+ $wgContLang->updateConversionTable( $title );
+ }
}
// Images