jenkins-bot has submitted this change and it was merged.

Change subject: (Bug 46930) changeTitle only create redirect where redirid > 0
......................................................................


(Bug 46930) changeTitle only create redirect where redirid > 0

changeTitle would create always a redirect entry even though
Title:moveTo() explicitly sets createRedirect to false but changeTitle
never checked redirid therefore smw_fpt_redi conatins gost redirects
for pages that did not any expect redirects and already deleted
(Special:MovePage - > Leave a redirect behind unchecked)

Change-Id: Ibad8cd133cc985656346769787698a8519f5e58e
---
M includes/storage/SQLStore/SMW_SQLStore3_Writers.php
1 file changed, 11 insertions(+), 0 deletions(-)

Approvals:
  Jeroen De Dauw: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/storage/SQLStore/SMW_SQLStore3_Writers.php 
b/includes/storage/SQLStore/SMW_SQLStore3_Writers.php
index 9020da6..c1b9d4e 100644
--- a/includes/storage/SQLStore/SMW_SQLStore3_Writers.php
+++ b/includes/storage/SQLStore/SMW_SQLStore3_Writers.php
@@ -718,6 +718,17 @@
                        // (this also updates references in other tables as 
needed.)
                        /// TODO: may not be optimal for the standard case that 
newtitle existed and redirected to oldtitle (PERFORMANCE)
                        $this->updateRedirects( $oldtitle->getDBkey(), 
$oldtitle->getNamespace(), $newtitle->getDBkey(), $newtitle->getNamespace() );
+
+                       // $redirid == 0 means that the oldTitle was not 
supposed to be a redirect
+                       // (oldTitle is delete from the db) but instead of 
deleting all
+                       // references we will still copy data from old to new 
during updateRedirects()
+                       // and clear the semantic data container for the 
oldTitle instance
+                       // to ensure that no ghost references exists for an 
deleted oldTitle
+                       // @see Title::moveTo(), createRedirect
+                       if ( $redirid == 0 ) {
+                               // Delete any existing data (including 
redirects) from old title
+                               $this->doDataUpdate( new SMWSemanticData( 
SMWDIWikiPage::newFromTitle( $oldtitle ) ) );
+                       }
                }
 
                wfProfileOut( "SMWSQLStore3::changeTitle (SMW)" );

-- 
To view, visit https://gerrit.wikimedia.org/r/57757
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibad8cd133cc985656346769787698a8519f5e58e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SemanticMediaWiki
Gerrit-Branch: master
Gerrit-Owner: Mwjames <[email protected]>
Gerrit-Reviewer: Jeroen De Dauw <[email protected]>
Gerrit-Reviewer: Mwjames <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to