X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmes_infos.php?a=blobdiff_plain;f=includes%2FTitle.php;h=b7c0a255a27ad99d870d06ad747ba516a239d740;hb=b8c038f6784ef082;hp=4adf2e4b67552b5c52d86a91e8b8ea6b19275d1c;hpb=b87966f6bbd753655cd684cbddd0ec7fe8e6616c;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Title.php b/includes/Title.php index 4adf2e4b67..b7c0a255a2 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -3814,13 +3814,31 @@ class Title { $log->addRelations( 'pr_id', $logRelationsValues, $logId ); } + // Update *_from_namespace fields as needed + if ( $this->getNamespace() != $nt->getNamespace() ) { + $dbw->update( 'pagelinks', + array( 'pl_from_namespace' => $nt->getNamespace() ), + array( 'pl_from' => $pageid ), + __METHOD__ + ); + $dbw->update( 'templatelinks', + array( 'tl_from_namespace' => $nt->getNamespace() ), + array( 'tl_from' => $pageid ), + __METHOD__ + ); + $dbw->update( 'imagelinks', + array( 'il_from_namespace' => $nt->getNamespace() ), + array( 'il_from' => $pageid ), + __METHOD__ + ); + } + # Update watchlists - $oldnamespace = MWNamespace::getSubject( $this->getNamespace() ); - $newnamespace = MWNamespace::getSubject( $nt->getNamespace() ); $oldtitle = $this->getDBkey(); $newtitle = $nt->getDBkey(); - - if ( $oldnamespace != $newnamespace || $oldtitle != $newtitle ) { + $oldsnamespace = MWNamespace::getSubject( $this->getNamespace() ); + $newsnamespace = MWNamespace::getSubject( $nt->getNamespace() ); + if ( $oldsnamespace != $newsnamespace || $oldtitle != $newtitle ) { WatchedItem::duplicateEntries( $this, $nt ); }