Today I upgraded drupal from version 6.12 to 6.13 and it ended up with a nice error message:
Fatal error: Only variables can be passed by reference in /drupal-6.13/sites/all/modules/admin_menu/admin_menu.inc on line 536
At first, I thought it was an error in admin_menu 3rd-party module, but after looking at it more closely, it appeared to be a drupal bug.
system_clear_cache_submit() signature changed from drupal-6.12 to drupal-6.13 with no obvious reason.
Below are the signatures in both drupal-6.12 & drupal-6.13 (system_clear_cache_submit function is declared in /drupal/components/system/system.admin.inc:1360):
function system_clear_cache_submit(&$form_state, $form) { // drupal-6.12
function system_clear_cache_submit($form, &$form_state) { // drupal-6.13
Arguments have been switched, making other third party modules, such as ‘admin_menu’, crash php with above error message.
solution
Proposed patch is simply to restore previous signature of system_clear_cache_submit function so that all previous modules based on it will continue to work properly (moreover since this variable switch looks unjustified by the function’s body).
--- system.admin.inc 2009-06-09 12:58:09.000000000 +0200
+++ system.admin.inc.new 2009-07-21 00:27:49.000000000 +0200
@@ -1357,7 +1357,7 @@
*
* @ingroup forms
*/
- function system_clear_cache_submit($form, &$form_state) {
+ function system_clear_cache_submit(&$form_state, $form) {
drupal_flush_all_caches();
drupal_set_message(t('Caches cleared.'));
}
sources