Lucas_Werkmeister_WMDE created this task. Lucas_Werkmeister_WMDE added projects: Wikidata, Sustainability (Incident Followup), wdwb-tech. Restricted Application added a subscriber: Aklapper.
TASK DESCRIPTION Several Wikibase extensions use `array_merge_recursive()` to combine multiple “definitions” arrays (mappings from entity or data type names to various definitions – formatter factory callback, RDF builder factory callback, etc.). However, this is dangerous – when more than one input array has a non-array value for the same (nested) key, `array_merge_recursive()` will merge the values into an array: >>> array_merge_recursive( [ 'a' => 1 ], [ 'a' => 2 ] ) => [ "a" => [ 1, 2 ] ] But an array is not a valid value for most definitions, and depending the key where this happens, it can bring down the whole site (as it did in T287100 <https://phabricator.wikimedia.org/T287100>). We don’t really want a fully recursive merge of these arrays – just one level deeper than a standard `array_merge()` (the arrays for each type should be added non-recursively). TASK DETAIL https://phabricator.wikimedia.org/T287139 EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/ To: Lucas_Werkmeister_WMDE Cc: Lucas_Werkmeister_WMDE, Aklapper, Invadibot, maantietaja, Akuckartz, Nandana, jijiki, Klaas_Z4us_V, Lahi, Gq86, GoranSMilovanovic, QZanden, LawExplorer, elukey, _jensen, rosalieper, Scott_WUaS, Wikidata-bugs, aude, Addshore, Mbch331, Jay8g
_______________________________________________ Wikidata-bugs mailing list -- wikidata-bugs@lists.wikimedia.org To unsubscribe send an email to wikidata-bugs-le...@lists.wikimedia.org