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 module_load_all() function will currently behave unexpectedly if a module cannot be found (has been removed, renamed, etc.). Once one module fails to load, all subsequent modules will not be loaded due to a short circuit condition when performing a boolean AND. This one-liner patch fixes the problem which should definitely be fixed before 4.5 release.
Comment | File | Size | Author |
---|---|---|---|
#4 | module_load_all2.patch | 532 bytes | jhriggs |
#1 | module_load_all.patch | 487 bytes | jhriggs |
Comments
Comment #1
jhriggs CreditAttribution: jhriggs commentedOops. Forgot the patch.
Comment #2
drumm+1
Looks good to me.
Comment #3
Dries CreditAttribution: Dries commentedCommitted to HEAD. Thanks Jim.
Comment #4
jhriggs CreditAttribution: jhriggs commentedJust to be safe, I probably should have just reversed the operands rather than changing to a bitwise AND. It could lead to unpredictable results if module_load() ever changes its return value/type. This patch reverts to using a boolean AND, but exchanges the operands.
Comment #5
Dries CreditAttribution: Dries commentedThe current approach will do fine. Thanks for following up though.