r86317 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86316‎ | r86317 | r86318 >
Date:16:27, 18 April 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
some small fixes related to the recent DataValue/DataItem changes
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2.php
@@ -718,7 +718,11 @@
719719 wfProfileIn( 'SMWSQLStore2::deleteSubject (SMW)' );
720720 wfRunHooks( 'SMWSQLStore2::deleteSubjectBefore', array( $this, $subject ) );
721721
722 - $this->deleteSemanticData( SMWWikiPageValue::makePageFromTitle( $subject ) );
 722+ $this->deleteSemanticData( new SMWDIWikiPage(
 723+ $subject->getDBkey(),
 724+ $subject->getNamespace(),
 725+ $subject->getInterwiki()
 726+ ) );
723727 $this->updateRedirects( $subject->getDBkey(), $subject->getNamespace() ); // also delete redirects, may trigger update jobs!
724728
725729 if ( $subject->getNamespace() == SMW_NS_CONCEPT ) { // make sure to clear caches
@@ -965,7 +969,12 @@
966970 /// which will hopefully be done to fix the double redirect.
967971 } else { // general move method that should be correct in all cases (equality support respected when updating redirects)
968972 // Delete any existing data from new title:
969 - $this->deleteSemanticData( SMWWikiPageValue::makePageFromTitle( $newtitle ) ); // $newtitle should not have data, but let's be sure
 973+ // $newtitle should not have data, but let's be sure
 974+ $this->deleteSemanticData( new SMWDIWikiPage(
 975+ $newtitle->getDBkey(),
 976+ $newtitle->getNamespace(),
 977+ $subject->getInterwiki()
 978+ ) );
970979 $this->updateRedirects( $newtitle->getDBkey(), $newtitle->getNamespace() ); // may trigger update jobs!
971980
972981 // Move all data of old title to new position:
@@ -1483,9 +1492,9 @@
14841493 foreach ( $res as $row ) {
14851494 $emptyrange = false; // note this even if no jobs were created
14861495
1487 - if ( ( $namespaces != false ) && ( !in_array( $row->smw_namespace, $namespaces ) ) ) continue;
 1496+ if ( $namespaces && !in_array( $row->smw_namespace, $namespaces ) ) continue;
14881497
1489 - if ( ( $row->smw_iw == '' ) || ( $row->smw_iw == SMW_SQL2_SMWREDIIW ) ) { // objects representing pages in the wiki, even special pages
 1498+ if ( $row->smw_iw == '' || $row->smw_iw == SMW_SQL2_SMWREDIIW ) { // objects representing pages in the wiki, even special pages
14901499 // TODO: special treament of redirects needed, since the store will not act on redirects that did not change according to its records
14911500 $title = Title::makeTitle( $row->smw_namespace, $row->smw_title );
14921501
@@ -1493,7 +1502,9 @@
14941503 $updatejobs[] = new SMWUpdateJob( $title );
14951504 }
14961505 } elseif ( $row->smw_iw { 0 } != ':' ) { // refresh all "normal" interwiki pages by just clearing their content
1497 - $this->deleteSemanticData( SMWWikiPageValue::makePage( $row->smw_namespace, $row->smw_title, '', $row->smw_iw ) );
 1506+ $this->deleteSemanticData(
 1507+ new SMWDIWikiPage( $row->smw_namespace, $row->smw_title, $row->smw_iw )
 1508+ );
14981509 }
14991510 }
15001511 $db->freeResult( $res );

Status & tagging log