r73777 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r73776‎ | r73777 | r73778 >
Date:15:37, 26 September 2010
Author:yaron
Status:deferred
Tags:
Comment:
SIO data updating changed to use 'SMWSQLStore2::updateDataAfter' hook, instead of 'smwDeleteSemanticData', so that SIO data is always saved after SMW data, avoiding duplicate rows
Modified paths:
  • /trunk/extensions/SemanticInternalObjects/SemanticInternalObjects.php (modified) (history)
  • /trunk/extensions/SemanticInternalObjects/SemanticInternalObjects_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticInternalObjects/SemanticInternalObjects.php
@@ -9,7 +9,7 @@
1010
1111 if ( !defined( 'MEDIAWIKI' ) ) die();
1212
13 -define( 'SIO_VERSION', '0.6' );
 13+define( 'SIO_VERSION', '0.6.1' );
1414
1515 $wgExtensionCredits[defined( 'SEMANTIC_EXTENSION_TYPE' ) ? 'semantic' : 'parserhook'][] = array(
1616 'path' => __FILE__,
@@ -23,7 +23,7 @@
2424 $wgHooks['ParserFirstCallInit'][] = 'siofRegisterParserFunctions';
2525 $wgHooks['LanguageGetMagic'][] = 'siofLanguageGetMagic';
2626 $wgHooks['ParserClearState'][] = 'SIOHandler::clearState';
27 -$wgHooks['smwDeleteSemanticData'][] = 'SIOHandler::updateData';
 27+$wgHooks['SMWSQLStore2::updateDataAfter'][] = 'SIOHandler::updateData';
2828 $wgHooks['smwUpdatePropertySubjects'][] = 'SIOHandler::handleUpdatingOfInternalObjects';
2929 $wgHooks['smwRefreshDataJobs'][] = 'SIOHandler::handleRefreshingOfInternalObjects';
3030 $wgHooks['smwAddToRDFExport'][] = 'SIOSQLStore::createRDF';
Index: trunk/extensions/SemanticInternalObjects/SemanticInternalObjects_body.php
@@ -310,13 +310,14 @@
311311 }
312312 }
313313
314 - public static function updateData( $subject ) {
 314+ public static function updateData( $sqlStore, $data ) {
315315 $sioSQLStore = new SIOSQLStore();
316316 // Find all "pages" in the SMW IDs table that are internal
317317 // objects for this page, and delete their properties from
318318 // the SMW tables.
319319 // Then save the current contents of the $mInternalObjects
320320 // array.
 321+ $subject = $data->getSubject();
321322 $pageName = $subject->getDBKey();
322323 $namespace = $subject->getNamespace();
323324 $idsForDeletion = SIOSQLStore::getIDsForDeletion( $pageName, $namespace );

Status & tagging log