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

CommentFileSizeAuthor
#2 236657.patch715 bytesswentel
#2 236657-D6.patch733 bytesswentel
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

brianV’s picture

Version: 6.1 » 7.x-dev
Issue tags: +Novice

This is a simple novice task - needs to be patched in both D6 & D7.

swentel’s picture

Status: Active » Needs review
FileSize
733 bytes
715 bytes

Simple patch, attached for both D6 and HEAD.

brianV’s picture

Status: Needs review » Reviewed & tested by the community

Looks good!

webchick’s picture

Version: 7.x-dev » 6.x-dev

Yay. :) I love squeaky clean code!

Committed to HEAD! Moving to 6.x.

Dries’s picture

Version: 6.x-dev » 7.x-dev
Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks.

webchick’s picture

Version: 7.x-dev » 6.x-dev
Status: Fixed » Reviewed & tested by the community

Oh. Maybe I didn't then. :D

Restoring status.

hctom’s picture

Thanx @all

Next time I'll provide a patch directly, so thing work out a little faster :)

Cheers

hctom

Gábor Hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Committed to Drupal 6, thanks.

sun’s picture

This broke D6 modules invoking system_clear_cache_submit().

brianV’s picture

can someone with the proper access grep contrib to find out where this function is called?

sun’s picture

Well, 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.

Status: Fixed » Closed (fixed)

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

Ersin Beyret’s picture

Just 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.

Dave Reid’s picture

BTW 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. :)

Pedro Lozano’s picture

For me, this is a Drupal WTF! Parameters never used. Nice. :-)

mcrittenden’s picture

Re: #13, admin_menu 1.5 is now released which fixes it.