Mwjames has uploaded a new change for review. https://gerrit.wikimedia.org/r/57853
Change subject: updateData() use Title->invalidateCache() instead of direct db-access ...................................................................... updateData() use Title->invalidateCache() instead of direct db-access Not sure why updateData() was using direct db-access but invalidateCache() should be used instead as it will ensure consistency in handling the Title object. $title->invalidateCache(); (takes care of wfReadOnly) invalidateCache() does exactly the same, the only difference is that instead of $dbw->timestamp( time() + 4 ) it does $dbw->timestamp() Change-Id: I40d2936767de3120e20651d2b3d43c001e4ec1a4 --- M includes/storage/SMW_Store.php 1 file changed, 5 insertions(+), 15 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticMediaWiki refs/changes/53/57853/1 diff --git a/includes/storage/SMW_Store.php b/includes/storage/SMW_Store.php index fd940da..1f471cd 100644 --- a/includes/storage/SMW_Store.php +++ b/includes/storage/SMW_Store.php @@ -215,21 +215,11 @@ */ wfRunHooks( 'SMWStore::updateDataBefore', array( $this, $data ) ); - // Invalidate the page, so data stored on it gets displayed immediately in queries. - global $smwgAutoRefreshSubject; - if ( $smwgAutoRefreshSubject && !wfReadOnly() ) { - $title = Title::makeTitle( $data->getSubject()->getNamespace(), $data->getSubject()->getDBkey() ); - $dbw = wfGetDB( DB_MASTER ); - - $dbw->update( - 'page', - array( 'page_touched' => $dbw->timestamp( time() + 4 ) ), - $title->pageCond(), - __METHOD__ - ); - - HTMLFileCache::clearFileCache( $title ); - } + // Invalidate the page, so data stored on it gets displayed + // immediately in queries. + if ( $GLOBALS['smwgAutoRefreshSubject'] ) { + $data->getSubject()->getTitle()->invalidateCache(); + } $this->doDataUpdate( $data ); -- To view, visit https://gerrit.wikimedia.org/r/57853 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I40d2936767de3120e20651d2b3d43c001e4ec1a4 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/SemanticMediaWiki Gerrit-Branch: master Gerrit-Owner: Mwjames <jamesin.hongkon...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits