r35927 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r35926‎ | r35927 | r35928 >
Date:13:20, 5 June 2008
Author:mkroetzsch
Status:old
Tags:
Comment:
Typo in redirect update
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2.php
@@ -684,10 +684,14 @@
685685 } else { // make id for use in redirect table
686686 $sid = $this->makeSMWPageID($oldtitle->getDBKey(),$oldtitle->getNamespace(),'',false);
687687 }
688 - // record new redirect
 688+ // update redirects
689689 /// NOTE: there is the (bad) case that the moved page is a redirect. As chains of
690690 /// redirects are not supported by MW or SMW, the below is maximally correct there too.
691 - $db->insert( 'smw_redi2', array('s_title'=>$newtitle->getDBkey(), 's_namespace'=>$newtitle->getNamespace(), 'o_id'=>$sid), 'SMWSQLStore2::changeTitle');
 691+ $db->insert( 'smw_redi2', array('s_title'=>$oldtitle->getDBkey(), 's_namespace'=>$oldtitle->getNamespace(), 'o_id'=>$sid), 'SMWSQLStore2::changeTitle');
 692+ /// NOTE: this temporarily leaves existing redirects to oldtitle point to newtitle as well, which
 693+ /// will be lost after the next update. Since double redirects are an error anyway, this is not
 694+ /// a bad behaviour: everything will continue to work until the old redirect is updated, which
 695+ /// will hopefully be to fix the double redirect.
692696 } else {
693697 $this->deleteSemanticData($newtitle); // should not have much effect, but let's be sure
694698 $this->updateRedirects($newtitle->getDBkey(), $newtitle->getNamespace()); // delete these redirects, may trigger update jobs!

Status & tagging log