Need to deep merge options for compatibility with other modules

Issue information

From user: anybody

Related to !14 (merged)

Contribution record

Fork management

Problem/Motivation

Follow-up on #3331630: Compatibility with other modules, options being overwritten.

I just read the code in the commit and I think it might instead need an array_merge_deep so that all values are preserved and the second array does not override the first one?

For example for attributes:

<?php
$a
= [
 
'attributes' => ['class' => ['a']],
];
$b = [
 
'attributes' => ['class' => ['a']],
];
$c = array_merge($a, $b);
?>

will result in

array(1) {
  ["attributes"]=>
  array(1) {
    ["class"]=>
    array(1) {
      [0]=>
      string(1) "b"
    }
  }
}

but I think we need to preserve all values here.

This may also lead to conflicts, if one attribute *should* override, but I don't think we can handle that!

Steps to reproduce

Proposed resolution

Remaining tasks

  1. Discuss:
  2. Implement
  3. Test
  4. Release

User interface changes

API changes

Data model changes

Edited by drupalbot
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information