core/includes/common.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/includes/common.inc b/core/includes/common.inc index cf084a7..6125461 100644 --- a/core/includes/common.inc +++ b/core/includes/common.inc @@ -1682,13 +1682,13 @@ function drupal_get_js($scope = 'header', $javascript = NULL, $skip_alter = FALS * The merged #attached array. */ function drupal_merge_attached(array $a, array $b) { - $result = NestedArray::mergeDeep($a, $b); // If both #attached arrays contain drupalSettings, then merge them correctly; // adding the same settings multiple times needs to behave idempotently. if (!empty($a['drupalSettings']) && !empty($b['drupalSettings'])) { - $result['drupalSettings'] = NestedArray::mergeDeepArray([$a['drupalSettings'], $b['drupalSettings']], TRUE); + $a['drupalSettings'] = NestedArray::mergeDeepArray([$a['drupalSettings'], $b['drupalSettings']], TRUE); + unset($b['drupalSettings']); } - return $result; + return NestedArray::mergeDeep($a, $b); } /**