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.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | drupal-system-form-always-true-1788608-2.patch | 1.23 KB | bfr |
Comments
Comment #1
bfr commentedI'll look into it.
Comment #2
bfr commentedThere you go. Done with
git format-patch, so apply withgit aminstead ofgit apply.Comment #3
bfr commentedComment #4
cosmicdreams commentedyes, I haven't tried applying the patch but it looks right.
Comment #5
chx commentedEvery 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.
Comment #6
dries commentedGood catch. Committed to 8.x. Thanks.