Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
If two hooks return arrays whose values are also arrays, the value arrays of the second array overwrite the value arrays of the first array instead of being merged together. The fix is to merge the arrays recursively.
Comment | File | Size | Author |
---|---|---|---|
#7 | module.inc-137650.patch | 700 bytes | Darren Oh |
#5 | invoker.tar_.gz_.txt | 1.17 KB | Darren Oh |
#2 | module.inc__0.patch | 675 bytes | Darren Oh |
module.inc_.patch | 671 bytes | Darren Oh | |
Comments
Comment #1
RobRoy CreditAttribution: RobRoy commentedThis will need to go into HEAD first and then be backported me thinks.
Comment #2
Darren OhSo here's a patch for HEAD.
Comment #3
Darren OhA bit of research reveals that array_merge_recursive() was not working at the time module.inc was written, which would explain why it was not used. This function was not working properly until PHP 4.3.3.
Comment #4
drewish CreditAttribution: drewish commenteddo you have some sample code i could use to test this out?
Comment #5
Darren OhHere's a couple of demo modules to try.
Comment #6
StevenPatzIs this still an issue?
Comment #7
Darren OhDefinitely. Here's an updated patch.
Comment #8
RobLoachPatch applies cleanly to HEAD and will allow us to pass arrays of arrays through module_invoke_all.
Comment #9
Gábor HojtsyThanks, committed.
Comment #10
Gábor HojtsyNote that we now require at least PHP 4.3.3, so we can use the proper function without those bugs noted earlier in PHP.
Comment #11
(not verified) CreditAttribution: commentedAutomatically closed -- issue fixed for two weeks with no activity.