Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2.php |
— | — | @@ -684,10 +684,14 @@ |
685 | 685 | } else { // make id for use in redirect table |
686 | 686 | $sid = $this->makeSMWPageID($oldtitle->getDBKey(),$oldtitle->getNamespace(),'',false); |
687 | 687 | } |
688 | | - // record new redirect |
| 688 | + // update redirects |
689 | 689 | /// NOTE: there is the (bad) case that the moved page is a redirect. As chains of |
690 | 690 | /// 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. |
692 | 696 | } else { |
693 | 697 | $this->deleteSemanticData($newtitle); // should not have much effect, but let's be sure |
694 | 698 | $this->updateRedirects($newtitle->getDBkey(), $newtitle->getNamespace()); // delete these redirects, may trigger update jobs! |