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.
Hi @all, I just wanted to notice a little bug I encountered:
function system_clear_cache_submit(&$form_state, $form) {
drupal_flush_all_caches();
drupal_set_message('Caches cleared.');
}
should be:
function system_clear_cache_submit($form, &$form_state) {
drupal_flush_all_caches();
drupal_set_message('Caches cleared.');
}
The arguments are swapped :-)
Cheers
hctom
Comment | File | Size | Author |
---|---|---|---|
#2 | 236657.patch | 715 bytes | swentel |
#2 | 236657-D6.patch | 733 bytes | swentel |
Comments
Comment #1
brianV CreditAttribution: brianV commentedThis is a simple novice task - needs to be patched in both D6 & D7.
Comment #2
swentel CreditAttribution: swentel commentedSimple patch, attached for both D6 and HEAD.
Comment #3
brianV CreditAttribution: brianV commentedLooks good!
Comment #4
webchickYay. :) I love squeaky clean code!
Committed to HEAD! Moving to 6.x.
Comment #5
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks.
Comment #6
webchickOh. Maybe I didn't then. :D
Restoring status.
Comment #7
hctomThanx @all
Next time I'll provide a patch directly, so thing work out a little faster :)
Cheers
hctom
Comment #8
Gábor HojtsyCommitted to Drupal 6, thanks.
Comment #9
sunThis broke D6 modules invoking system_clear_cache_submit().
Comment #10
brianV CreditAttribution: brianV commentedcan someone with the proper access grep contrib to find out where this function is called?
Comment #11
sunWell, there are probably not many, and I'd guess it's rather limited to administration/developer/utility modules, but in the case of admin_menu, it's a bit tricky, because I didn't plan to create a new official release for 1.x, but 3.x is still under development.
And now that I think about it -- I need to fix it once more, because I can't presume that people installing admin_menu today will have this version of Drupal core installed.
Comment #13
Ersin Beyret CreditAttribution: Ersin Beyret commentedJust wanted to report that, since this bug is now fixed, after upgrading to 6.13, 6.x-1.4 version of admin_menu module emits fatal error "Fatal error: Only variables can be passed by reference" for line 539 of admin_menu.inc, which is:
system_clear_cache_submit($form_state, NULL);
This seems to have been fixed at 6.x-3.0-alpha1 of admin_menu, however since it is in alpha state people may not want to upgrade to it yet. As a temporary solution, until a stable admin_menu is available, one can simply swap the arguments in admin_menu.inc.
Comment #14
Dave ReidBTW I have no idea why we had to put the referencing on $form_state since the parameter is never used. Not using the reference would not have caused severe breakage in D6 contrib, only major breakage. :)
Comment #15
Pedro Lozano CreditAttribution: Pedro Lozano commentedFor me, this is a Drupal WTF! Parameters never used. Nice. :-)
Comment #16
mcrittenden CreditAttribution: mcrittenden commentedRe: #13, admin_menu 1.5 is now released which fixes it.