On line 1079 of the system module's system.admin.inc states the following

if ($form) {
    // Set some default form values
    $form = confirm_form(
      $form,
      t('Some required modules must be enabled'),
      'admin/modules',
      t('Would you like to continue with the above?'),
      t('Continue'),
      t('Cancel'));
    return $form;
  }

but earlier in the function the $form array is initialized and given some properties. Therefore $form will always exist and the if statement is unnecessary.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bfr’s picture

Assigned: Unassigned » bfr

I'll look into it.

bfr’s picture

There you go. Done with git format-patch, so apply with git am instead of git apply.

bfr’s picture

Status: Active » Needs review
cosmicdreams’s picture

Status: Needs review » Reviewed & tested by the community

yes, I haven't tried applying the patch but it looks right.

chx’s picture

Every time I see something like this, I really like to see some git archeology to get a peek into what happened? Did we forget something else somewhere? This time, however, the answer is a resounding no, this code was added when the dependency system was added in #84875: Dependency system like six years ago and it was already broken like this.

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Good catch. Committed to 8.x. Thanks.

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