I use PHP 5.3 and get errors on form submit -

* warning: Parameter 2 to hierarchical_select_form_alter() expected to be a reference, value given in /home/sitedir/includes/common.inc on line 2883.

I found that error is in PHP 5.3 incompatibility. On other site with 5.2 all works fine.

/**
 * Implementation of hook_form_alter().
 */
function hierarchical_select_form_alter(&$form, &$form_state, $form_id) {
  if (_hierarchical_select_form_has_hierarchical_select($form)) {
    $form['#after_build'][] = 'hierarchical_select_after_build';
  }
}

So, I found that to solve this errors the module needs to be pathed like this:

- function hierarchical_select_form_alter(&$form, &$form_state, $form_id) {
+ function hierarchical_select_form_alter($form, $form_state, $form_id) {

am I right?

Comments

Wim Leers’s picture

Assigned: Unassigned » Wim Leers
Priority: Normal » Minor
Status: Active » Reviewed & tested by the community
Issue tags: -reference

No, that's wrong.

This is right:

- function hierarchical_select_form_alter(&$form, &$form_state, $form_id) {
+ function hierarchical_select_form_alter(&$form, $form_state, $form_id) {

I'll get that committed :)

Wim Leers’s picture

No, that's wrong.

This is right:

- function hierarchical_select_form_alter(&$form, &$form_state, $form_id) {
+ function hierarchical_select_form_alter(&$form, $form_state, $form_id) {

I'll get that committed :)

yultyyev’s picture

ok, so I go to open more issues on other modules - when I testing my site on PHP 5.3 and get about 3-5 error for other popular module.

kolyas12’s picture

also:

-function hs_content_taxonomy_form_alter(&$form, &$form_state, $form_id) {
+function hs_content_taxonomy_form_alter(&$form, $form_state, $form_id) {
-function hs_menu_form_alter(&$form, &$form_state, $form_id) {
+function hs_menu_form_alter(&$form, $form_state, $form_id) {
Wim Leers’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)
Issue tags: -PHP 5.3

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