Sometimes I've got following errors:

    * Warning: Parameter 2 to date_form_alter() expected to be a reference, value given in drupal_alter() (line 2880 of /home/kenorb/websites/doc/trunk/src/includes/common.inc).
    * Warning: Parameter 2 to date_timezone_form_alter() expected to be a reference, value given in drupal_alter() (line 2880 of /home/kenorb/websites/doc/trunk/src/includes/common.inc).
    * Warning: Parameter 2 to fivestar_form_alter() expected to be a reference, value given in drupal_alter() (line 2880 of /home/kenorb/websites/doc/trunk/src/includes/common.inc).
    * Warning: Parameter 2 to flag_form_alter() expected to be a reference, value given in drupal_alter() (line 2880 of /home/kenorb/websites/doc/trunk/src/includes/common.inc).
    * Warning: Parameter 2 to og_form_alter() expected to be a reference, value given in drupal_alter() (line 2880 of /home/kenorb/websites/doc/trunk/src/includes/common.inc).
    * Warning: Parameter 2 to wysiwyg_form_alter() expected to be a reference, value given in drupal_alter() (line 2880 of /home/kenorb/websites/doc/trunk/src/includes/common.inc).
    * Warning: Parameter 2 to collection_plus_form_alter() expected to be a reference, value given in drupal_alter() (line 2880 of /home/kenorb/websites/doc/trunk/src/includes/common.inc).
    * Warning: Parameter 2 to file_asset_form_alter() expected to be a reference, value given in drupal_alter() (line 2880 of /home/kenorb/websites/doc/trunk/src/includes/common.inc).
    * Warning: Parameter 2 to privatemsg_plus_form_alter() expected to be a reference, value given in drupal_alter() (line 2880 of /home/kenorb/websites/doc/trunk/src/includes/common.inc).
    * Warning: Parameter 2 to node_export_post_form_alter() expected to be a reference, value given in drupal_alter() (line 2880 of /home/kenorb/websites/doc/trunk/src/includes/common.inc).
    * Warning: Parameter 2 to og_plus_form_alter() expected to be a reference, value given in drupal_alter() (line 2880 of /home/kenorb/websites/doc/trunk/src/includes/common.inc).
    * Warning: Parameter 2 to tagfields_form_alter() expected to be a reference, value given in drupal_alter() (line 2880 of /home/kenorb/websites/doc/trunk/src/includes/common.inc).
    * Warning: Parameter 2 to taxonomy_plus_form_alter() expected to be a reference, value given in drupal_alter() (line 2880 of /home/kenorb/websites/doc/trunk/src/includes/common.inc).
    * Warning: Parameter 2 to taxonomy_xml_plus_form_alter() expected to be a reference, value given in drupal_alter() (line 2880 of /home/kenorb/websites/doc/trunk/src/includes/common.inc).
    * Warning: Parameter 2 to lib_core_hooks_form_alter() expected to be a reference, value given in drupal_alter() (line 2880 of /home/kenorb/websites/doc/trunk/src/includes/common.inc).
    * Warning: Parameter 2 to og_access_form_alter() expected to be a reference, value given in drupal_alter() (line 2880 of /home/kenorb/websites/doc/trunk/src/includes/common.inc).
    * Warning: Parameter 2 to og_forum_form_alter() expected to be a reference, value given in drupal_alter() (line 2880 of /home/kenorb/websites/doc/trunk/src/includes/common.inc).
    * Warning: Parameter 2 to content_profile_registration_form_alter() expected to be a reference, value given in drupal_alter() (line 2880 of /home/kenorb/websites/doc/trunk/src/includes/common.inc).
    * Warning: Parameter 2 to tac_lite_form_alter() expected to be a reference, value given in drupal_alter() (line 2880 of /home/kenorb/websites/doc/trunk/src/includes/common.inc).
    * Warning: Parameter 2 to nodewords_form_alter() expected to be a reference, value given in drupal_alter() (line 2880 of /home/kenorb/websites/doc/trunk/src/includes/common.inc).
    * Warning: Parameter 2 to formfilter_ui_form_alter() expected to be a reference, value given in drupal_alter() (line 2880 of /home/kenorb/websites/doc/trunk/src/includes/common.inc).
    * Warning: Parameter 2 to rules_forms_form_alter() expected to be a reference, value given in drupal_alter() (line 2880 of /home/kenorb/websites/doc/trunk/src/includes/common.inc).
    * Warning: Parameter 2 to notifications_content_form_alter() expected to be a reference, value given in drupal_alter() (line 2880 of /home/kenorb/websites/doc/trunk/src/includes/common.inc).
    * Warning: Parameter 2 to late_form_alter_form_alter() expected to be a reference, value given in drupal_alter() (line 2880 of /home/kenorb/websites/doc/trunk/src/includes/common.inc).

in Pressflow.

Reproducible steps:
1. Press 'Cancel' on Authentication Required popup.
You should see those errors.
Or I have something wrong.
Doesn't happen when already logged-in, so I assuming that's related to Securesite module.

CommentFileSizeAuthor
#6 930992-securesite.patch943 bytessolotandem
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

janton’s picture

yes i have the same after update php to 5.3.3

plopesc’s picture

Hello!
me too with PHP 5.3.3

basvredeling’s picture

Subscribing

DigitalForce’s picture

Title: hook_form_alter compability with PHP 5.3 » Solution
janton’s picture

Yes perfect Solution DigitalForce!

I solved almost all.. only i can´t find the date_timezone_form_alter()
In which module is this used... ? Do you have any idee?

Ok Just found it..stuppid.. i was looking on my local machine for this file.. but i did not have module date on my localmachine :)
So of course this function is in the module "date"

solotandem’s picture

Title: Not passing $form_state by reference to hook_form_alter » Solution
FileSize
943 bytes

Respectfully, deleting the ampersands on those called functions is not the solution. This module is invoking hook_form_alter() but is not passing $form_state by reference, as expected by those functions. Take a look at drupal_prepare_form() in form.inc.

  $data = &$form;
  $data['__drupal_alter_by_ref'] = array(&$form_state);
  drupal_alter('form_'. $form_id, $data);

  // __drupal_alter_by_ref is unset in the drupal_alter() function, we need
  // to repopulate it to ensure both calls get the data.
  $data['__drupal_alter_by_ref'] = array(&$form_state);
  drupal_alter('form', $data, $form_id);

This module needs to do the same with its two calls to drupal_alter('form',...) in securesite_user_login() and securesite_user_pass(). The current code is like: drupal_alter('form', $form, $form_state, 'user_pass'). Simply do what core does above as in the attached patch.

solotandem’s picture

Title: Solution » Not passing $form_state by reference to hook_form_alter
Version: 6.x-2.4 » 6.x-2.x-dev
Priority: Minor » Normal

A better title.

voxpelli’s picture

Title: Solution » Not passing $form_state by reference to hook_form_alter
Status: Active » Reviewed & tested by the community

This seems to fix it for me.

basvredeling’s picture

the patch form #6 works for me too.

Darren Oh’s picture

Status: Reviewed & tested by the community » Fixed

Fixed in commit bb4af38. Thanks to voxpelli and basvredeling for reviewing this patch.

Status: Fixed » Closed (fixed)

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

memcinto’s picture

I'm having trouble figuring out what is calling drupal_alter incorrectly. According to a backtrace on wysiwyg_form_alter, the module calling drupal_alter is includes/form.inc, and it is calling drupal_alter correctly (complete with a double call). It would be great if someone could slip me a hint as to what module or file is actually messing up.

Hanno’s picture

@Darren Oh Is it possible to have this patch included in the latest stable version 6.2.4 ?

  • Commit bb4af38 on 6.x-2.x, 7.x-2.x, 8.x-1.x by Darren Oh:
    Issue #930992 by solotandem: Fixed reference errors.
    
    
Francewhoa’s picture

+1 to make a new stable release with this patch. Last Drupal 6 stable release was in 2009.