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.
Problem/Motivation
ModuleHandler::install() contains the following code:
if ($enable_dependencies) {
...
// Do something (but this does not mess with $enable_dependencies itself).
...
if ($enable_dependencies) {
...
}
...
}
The inner if-condition is pointless as it will never be FALSE
.
Proposed resolution
Remove the pointless condition and inline the contained code.
Remaining tasks
User interface changes
API changes
Comment | File | Size | Author |
---|---|---|---|
#1 | 2267911-1-module-handler-install-pointless-if.patch | 1.68 KB | tstoeckler |
Comments
Comment #1
tstoecklerComment #2
tstoecklerComment #3
sunHm. Somehow I was confident that I had taken over this code literally (even though I was aware that it's bogus) from
ModuleHandler::install()
intoThemeHandler::enable()
...But I just had a look at
ThemeHandler
, and it no longer exists for some reason...Comment #5
sun1: 2267911-1-module-handler-install-pointless-if.patch queued for re-testing.
Comment #6
tstoecklerBack to RTBC per #3.
Comment #8
sun1: 2267911-1-module-handler-install-pointless-if.patch queued for re-testing.
Comment #9
tstoecklerComment #10
Dries CreditAttribution: Dries commentedEasy fix. Committed to 8.x. Thanks.