Comments

swentel’s picture

Status: Needs review » Needs work

Hrm, one second, seems to be wrong, I'll get back to this.

swentel’s picture

Status: Needs work » Needs review
StatusFileSize
new570 bytes

Ok, first patch was wrong, this one is better.

nicholasthompson’s picture

Interesting... When would a form not have an #id?!

swentel’s picture

Hrm, ok did some more debugging and it's actually the fault of the onepageprofile module in onepageprofile_user() where it calls drupal_alter('form') - actually funny looking at that code - http://drupalcode.org/viewvc/drupal/contributions/modules/onepageprofile.... This is obviously more his fault because he's not passing an '#id' here. We should rather file an issue to his module I guess .. :)

swentel’s picture

Project: Page Title » One page profile
Version: 6.x-2.x-dev » 6.x-1.10
StatusFileSize
new557 bytes

Moving this to one page profile. By calling drupal_alter('form') and not supplying a $form['#id'], a lot of other modules trigger PHP notices. I actually made a fool of myself filing already 3 issues for the same problem before I really started debugging ... :) Anyway patch attached, not sure if the '#id' name is ok, maybe this could be something else.

swentel’s picture

Title: PHP notice in hook_form_alter » PHP notice by not passing $form['#id']

changing title

aidanlis’s picture

Good pick up everyone, will get this into the next version.

aidanlis’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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

dontgoquietly’s picture

Status: Closed (fixed) » Needs review

Hi, this error is still occurring with 6.x-1.11. I get the following error:

warning: Parameter 2 to auto_username_form_alter() expected to be a reference, value given in /includes/common.inc on line 2883.
warning: Parameter 2 to date_timezone_form_alter() expected to be a reference, value given in /includes/common.inc on line 2883.
warning: Parameter 2 to video_form_alter() expected to be a reference, value given in /includes/common.inc on line 2883.
warning: Parameter 2 to content_profile_registration_form_alter() expected to be a reference, value given in /includes/common.inc on line 2883.
warning: Parameter 2 to taxonomy_defaults_form_alter() expected to be a reference, value given in /includes/common.inc on line 2883.
warning: Parameter 2 to multistep_form_alter() expected to be a reference, value given in /includes/common.inc on line 2883.
warning: Parameter 2 to rules_forms_form_alter() expected to be a reference, value given in /includes/common.inc on line 2883.

when viewing a user profile.

I checked that $category_form['#id'] = 'profile_form_profile'; was applied to onepageprofile_user().

swentel, you had a question about the #id name. I'm not sure what's happening here, but if you've managed to get this to work, please let me know if this is the same error or if I need to open a new ticket.

Thanks

dontgoquietly’s picture

It may have something to do with date/timezone module, as disabling that module caused this error to go away. Unfortunately, I need that module, so I can not use onepageprofile as it currently works.

fberge’s picture

StatusFileSize
new843 bytes

This is an error with func_get_args() and references
See comments in common.inc

Supplied patch does the trick for me

aidanlis’s picture

Wow, nicely found!

fberge’s picture

Should we set the status for this issue to done or something?
Dont know what the practice says, but it bothers me that this ticket is one of my active ones =)

aidanlis’s picture

I'll set it to fixed once the patch is in CVS, I should have a chance to go through my patch queue this week.

aharown07’s picture

Status: Needs review » Reviewed & tested by the community

Patch "failed"... Applied it manually. Fix works (using D6.20 PHP 5.3.something)
So... will we see this in a new release soon?

carvalhar’s picture

#12 patch worked for me.

hk2000’s picture

Version: 6.x-1.10 » 6.x-1.11
Priority: Minor » Critical

#12 patch worked for me as well.

I was getting mulitple errors along the lines of:
Parameter 2 to hook_form_alter() expected to be a reference, value given in /var/www/includes/common.inc

It is in regards to the way drupal_alter is called on line 82 of 6.11. Recommend updating to this patch as soon as possible to fix this issue.

aidanlis’s picture

Fixed, sorry for the delay in getting this live!

aidanlis’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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