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.
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 CreditAttribution: bfr commentedI'll look into it.
Comment #2
bfr CreditAttribution: bfr commentedThere you go. Done with
git format-patch
, so apply withgit am
instead ofgit apply
.Comment #3
bfr CreditAttribution: bfr commentedComment #4
cosmicdreams CreditAttribution: cosmicdreams commentedyes, I haven't tried applying the patch but it looks right.
Comment #5
chx CreditAttribution: 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 CreditAttribution: Dries commentedGood catch. Committed to 8.x. Thanks.