Last modified: 2013-06-04 14:45:53 UTC
Created attachment 11633 [details] Replace array_diff_assoc The array_diff_assoc in SMWSQLStore3Writers::preparePropertyTableUpdates is not going to work, because it does not work recursively. Instead it just uses string representations of the top-level elements. Which are all "Array" or some such for an array of arrays. The attached patch should fix this. It might be faster though instead of having a loop in a loop in PHP to simply delete all old values from the DB and add all new values, i.e. delete and re-insert values even if they do not change. (Sorry, I can not push from here. SSH port is blocked. Could somebody apply the patch?) Semantic MediaWiki (Version 1.9 alpha) (0e1afb0)
Thanks for the patch. I also just ran into this. Not the only thing that's broken though. Even if you diff correctly, the input data does not have matching format: var_dump($oldTableData,$newData); // line 383 array (size=1) 0 => array (size=3) 's_id' => string '51' (length=2) 'o_serialized' => string '1/2013/1/10/15/25/28' (length=20) 'o_sortkey' => string '2456303.1426852' (length=15) array (size=2) 'smw_fpt_ask' => array (size=1) 0 => array (size=2) 's_id' => string '51' (length=2) 'o_id' => string '737' (length=3) 'smw_fpt_mdat' => array (size=1) 0 => array (size=3) 's_id' => string '51' (length=2) 'o_serialized' => string '1/2013/1/17/10/41/53' (length=20) 'o_sortkey' => float 2456309.9457523
Yes. Which is why I use == in the patch instead of ===. Seems the easiest solution, unless you want to change all the DIs to use string values.
https://gerrit.wikimedia.org/r/#/c/44389/
Thanks for the fix :)
*** Bug 42691 has been marked as a duplicate of this bug. ***