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.
The function array_merge_recursive in module_invoke_all (D7) or ModuleHandlerInterface::invokeAll() reindexes arrays if keys are numeric, see comments at http://us.php.net/manual/en/function.array-merge-recursive.php . This caused me problems in Ubercart and may be a problem with some other modules. Is this intended behaviour or can the indexes be preserved?
Comment | File | Size | Author |
---|---|---|---|
#29 | 376391-29.patch | 593 bytes | pietmarcus |
#21 | drupal_core-invokeall-reindex-376391-20.patch | 823 bytes | snehi |
Comments
Comment #1
Steven Jones CreditAttribution: Steven Jones commentedThis is the intended behaviour, I just think that it needs documenting that this is what
module_invoke_all
does.Comment #2
jhodgdonSounds like this should be documented (maybe?) and then backported to D6/7.
Comment #3
jhodgdonLooking through old issues... It seems like we still need to fix this documentation. Actually, should be a good Novice project. Updating summary.
Comment #4
mimran CreditAttribution: mimran as a volunteer commentedComment #5
mimran CreditAttribution: mimran as a volunteer commentedUpdated the comments with the descriptions
Comment #6
mimran CreditAttribution: mimran as a volunteer commentedUpdated the patch
Comment #7
mimran CreditAttribution: mimran as a volunteer commentedComment #8
mimran CreditAttribution: mimran as a volunteer commentedComment #12
jhodgdonThanks for the patch! Ignore the test results, there was some kind of a glitch... The patch needs a bit of improvement though:
This line goes over 80 characters. All documentation needs to be wrapped into lines as close to 80 as possible without going over.
Hm, not the best wording maybe?
How about:
Note: integer keys in arrays will be lost, as the merge is done using array_merge_recursive().
or something similar?
Comment #13
mimran CreditAttribution: mimran as a volunteer commentedComment #14
mimran CreditAttribution: mimran as a volunteer commented@jhodgdon, thanks Updated the patch accordingly
Comment #15
mimran CreditAttribution: mimran as a volunteer commentedComment #16
snehi CreditAttribution: snehi as a volunteer and at Publicis Sapient for Publicis Sapient commentedLooks ok to me +1 for RTBC.
Comment #17
jhodgdonThat (obviously) looks good to me too. Except that it should all be wrapped into one paragraph, with lines as close to 80 characters as possible, without going over. Thanks!
Comment #18
mimran CreditAttribution: mimran as a volunteer commentedwrapped into one paragraph
Comment #19
jhodgdonPlease don't make it all into one *sentence* -- it is rather run-on. Just make it into one *paragraph*. Thanks!
Comment #20
mimran CreditAttribution: mimran as a volunteer commentedupdated accordingly
Comment #21
snehi CreditAttribution: snehi as a volunteer and at Publicis Sapient for Publicis Sapient commenteduploaded
Comment #22
jhodgdonThanks, that's better!
Reminder to contributors: when you upload a new patch after previous patches, please make an interdiff file. Also set the status of issue to "Needs review". (No need to either now.)
Anyway, the patch in #21 is slightly better wrapped, so let's use that.
Comment #23
catchComment #24
catchCommitted/pushed to 8.1.x and cherry-picked to 8.0.x. Thanks!
Moving to 7.x for backport.
Comment #27
mimran CreditAttribution: mimran as a volunteer commentedThis is ported to 8.0.3
Comment #28
David_Rothstein CreditAttribution: David_Rothstein as a volunteer commentedIt was committed to Drupal 8, but still needs to be ported to Drupal 7 :)
Comment #29
pietmarcus CreditAttribution: pietmarcus as a volunteer commentedPatched to Drupal 7.
Comment #32
pietmarcus CreditAttribution: pietmarcus as a volunteer commentedTests finally completed successfully. Please review.
Comment #33
jhodgdonLooks good, thanks for the backport! Hopefully the Drupal 7 testing system will become more stable...
Comment #34
Fabianx CreditAttribution: Fabianx as a volunteer and at Tag1 Consulting commentedMarked for commit.
Comment #36
stefan.r CreditAttribution: stefan.r commentedCommitted to 7.x, thanks!