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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tstoeckler’s picture

Status: Active » Needs review
FileSize
1.68 KB
tstoeckler’s picture

Title: Remove pointless condition in ModuleHandlker::install() » Remove pointless condition in ModuleHandler::install()
sun’s picture

Status: Needs review » Reviewed & tested by the community

Hm. Somehow I was confident that I had taken over this code literally (even though I was aware that it's bogus) from ModuleHandler::install() into ThemeHandler::enable()...

But I just had a look at ThemeHandler, and it no longer exists for some reason...

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 1: 2267911-1-module-handler-install-pointless-if.patch, failed testing.

sun’s picture

Status: Needs work » Needs review
tstoeckler’s picture

Status: Needs review » Reviewed & tested by the community

Back to RTBC per #3.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 1: 2267911-1-module-handler-install-pointless-if.patch, failed testing.

sun’s picture

Status: Needs work » Needs review
tstoeckler’s picture

Status: Needs review » Reviewed & tested by the community
Dries’s picture

Status: Reviewed & tested by the community » Fixed

Easy fix. Committed to 8.x. Thanks.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.