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.
Removal of unused variables in the code base.
Comment | File | Size | Author |
---|---|---|---|
#9 | acl-2612464-9-D8.patch | 492 bytes | salvis |
#4 | 2612464-4.patch | 1015 bytes | heykarthikwithu |
Comments
Comment #2
heykarthikwithuRemoved the unused variables
$button_name
and$path
.Comment #3
salvisHave you checked whether these also appear in the D8 version? The latest version always needs to go first.
module_load_include() has a side effect. Removing the call probably breaks ACL.
We may be able to save the call to drupal_get_path() depending on what we get back from module_load_include().
Blindly going through the code base and mechanically removing everything flagged by some code inspection tool is a waste of maintainer time.
Comment #4
heykarthikwithurerolled the patch.
1.
$button_name = 'acl_' . $form['acl_id']['#value'];
$button_name is no more used in the code base, so this can be removed.
2.
$path = module_load_include($type, 'acl');
$path variable is no more used in the code base. so this is replaced with
module_load_include($type, 'acl');
So this works fine :)
Comment #5
Elin Yordanov CreditAttribution: Elin Yordanov commentedThis is a reasonable patch. It makes the code cleaner and has no impact on the functionality.
Comment #7
salvisThank you, heykarthikwithu and Елин Й.!
Comment #9
salvisWell, I guess I misinterpreted #4.
Comment #11
salvis