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.

CommentFileSizeAuthor
#4 module_load_all2.patch532 bytesjhriggs
#1 module_load_all.patch487 bytesjhriggs
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jhriggs’s picture

FileSize
487 bytes

Oops. Forgot the patch.

drumm’s picture

+1

Looks good to me.

Dries’s picture

Committed to HEAD. Thanks Jim.

jhriggs’s picture

FileSize
532 bytes

Just 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.

Dries’s picture

The current approach will do fine. Thanks for following up though.