VitaliyFilippov has uploaded a new change for review. https://gerrit.wikimedia.org/r/80372
Change subject: Fix array to string conversion notice for 1.8.x / 1.9.x ...................................................................... Fix array to string conversion notice for 1.8.x / 1.9.x A similar fix exists in master branch, but I think it's needed also in 1.8.x / 1.9.x. Also, I think this implementation (with one loop) is better than one in master which has two loops. Change-Id: Ide5541f1c889bd9e02735b8a7c2ed2116c768ca5 --- M includes/storage/SQLStore/SMW_SQLStore3_Writers.php 1 file changed, 14 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticMediaWiki refs/changes/72/80372/1 diff --git a/includes/storage/SQLStore/SMW_SQLStore3_Writers.php b/includes/storage/SQLStore/SMW_SQLStore3_Writers.php index dcb7f6c..231a239 100644 --- a/includes/storage/SQLStore/SMW_SQLStore3_Writers.php +++ b/includes/storage/SQLStore/SMW_SQLStore3_Writers.php @@ -331,6 +331,18 @@ } /** + * Like array_diff_assoc(), but doesn't cast array items to strings before comparison + */ + static function array_diff_assoc_nonstr( $array1, $array2 ) { + foreach ( $array2 as $k => $i ) { + if ( isset( $array1[$k] ) && $array2[$k] === $array1[$k] ) { + unset( $array1[$k] ); + } + } + return $array1; + } + + /** * Compute necessary insertions, deletions, and new table hashes for * updating the database to contain $newData for the subject with ID * $sid. Insertions and deletions are returned in as an array mapping @@ -380,8 +392,8 @@ continue; } else { // Table contains no data or contains data that is different from the new $oldTableData = $this->getCurrentPropertyTableContents( $sid, $propertyTable, $dbr ); - $tablesInsertRows[$tableName] = array_diff_assoc( $newData[$tableName], $oldTableData ); - $tablesDeleteRows[$tableName] = array_diff_assoc( $oldTableData, $newData[$tableName] ); + $tablesInsertRows[$tableName] = self::array_diff_assoc_nonstr( $newData[$tableName], $oldTableData ); + $tablesDeleteRows[$tableName] = self::array_diff_assoc_nonstr( $oldTableData, $newData[$tableName] ); } } elseif ( array_key_exists( $tableName, $oldHashes ) ) { // Table contains data but should not contain any after update -- To view, visit https://gerrit.wikimedia.org/r/80372 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ide5541f1c889bd9e02735b8a7c2ed2116c768ca5 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/SemanticMediaWiki Gerrit-Branch: 1.8.x Gerrit-Owner: VitaliyFilippov <vita...@yourcmc.ru> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits