Hi,
I'm running drupal 6.14 on the latest xampp (php 5.3, mysql 5.1.37) and I found a problem with realname (1.3).
To be sure I've done a clean installation where I installed only drupal and realname.
Realname is using a single text field in core profile module.

When I activate realname, I report this error:
warning: Parameter 1 to profile_load_profile() expected to be a reference, value given in C:\xampp\htdocs\prove\includes\module.inc on line 450

I'm completely newbie, but I think the problem is related to this one --> http://drupal.org/node/360605

In particular they speak about realname here --> http://drupal.org/node/360605#comment-1689842

The patch they talk about is already committed in core 6.14, but the realname problem seems not related to core (as stated in the post linked above) and so the patch doesn't fix it.

I reported this error thinking is a bug, but, as stated before, I'm newbie so delete this post with no problem ;)

Thx

CommentFileSizeAuthor
#6 realname_php53fix.patch765 bytesBerdir
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Sera’s picture

*deleting wrong "solution"*

Thx diggemall (see #2) for clarification.

digemall’s picture

Changing the line

      module_invoke($module, 'load_profile', $account, $type);

to

      module_invoke($module, '_load_profile', $account, $type);

in realname.module, you skip the warning simply because the function that you call with module_invoke ( = profile__load_profile) doesn't exist.
So you don't get the warning but you don't obtain an overriden realname too (i've tested it).

The only change that really works, is removing the "&" from the line

function profile_load_profile(&$user) {

in core profile.module

I don't know how this could be fixed by realname module, probably it's not possible...
I really think it's a core problem but probably drupal 6 aims to be compatible with php4 so the & won't be removed...

VM’s picture

Drupal 6.x core is aimed at PHP 4.3.5 to PHP 5.2.x

PHP 5.3 didn't exist when Drupal 6.x was released. PHP 5.3 deprecated a function or two which causes issue with core and contrib where this functions are used. Best bet is to roll back to PHP 5.2.x unless you have the skillset to patch core and contrib modules and hopefully contribute the patches back to the community.

for more info on the PHP and drupal requirements and reccomendations see: http://drupal.org/requirements

digemall’s picture

Ok thx for the clarification VM ;)

oriol_e9g’s picture

Issue tags: +PHP 5.3

tagged

Berdir’s picture

Status: Active » Needs review
FileSize
765 bytes

This can be fixed. It is not correct to use module_invoke or module_invoke_all() for functions that have by reference arguments. (the by reference in profile_load_profile is needed for PHP 4 compatibility btw). Instead, the correct way is to call $load_func($account, $type). $load_func is already created and checked above, so this is a oneliner...

JohannE’s picture

I run Drupal 6.15 with UberDrupal 6.14. I am not sure how to tackle the original error.

"warning: Parameter 1 to profile_load_profile() expected to be a reference, value given in E:\www\mysite.com\includes\module.inc on line 462."

I am not a programmer/developer and I rely completely on this site.
Thank You

digemall’s picture

Probably you are not in the right place (this thread is for realname module issues).

Are you running drupal PHP 5.3 ? There are many problem with that, discussed for example here http://drupal.org/node/360605

I suggest you to switch back to php 5.2 if you can, otherwise you must probably patch your drupal core modules (ask help to that link)

JohannE’s picture

I am running PHP Version 5.3.1.

I suck at this stuff but I am stupid enough/determined enough to keep at it.
It's a home-based server so I have control, when things work out.

Fortunately this is only important to me so no one's freaking out. I'll be asking questions in the wrong area again I suspect.

Thank You

digemall’s picture

Priority: Critical » Normal
Status: Closed (fixed) » Needs review

Sorry, I was wrong stating that you must patch you drupal core...
Actually, I've re-read drupal requirements ( http://drupal.org/requirements ) and they state that drupal core support php 5.3.x from v.6.14 on, but not all core contrib modules do.

I supposed that your problem was in the core, but can actually be in realname (if you have it enable) or in other contrib modules.

Sure, at the link I mentioned above, someone will help you to find a way to fix your problem.

I apologize for my inaccurate answer.

P.S.
if you have realname module enabled, try to disable it and check if the problem disappear... in that case write here with resoluteness ;)

Berdir’s picture

Erm, not sure what you are talking about ;)

and they state that drupal core support php 5.3.x from v.6.14 on, but not all core modules do.

There is a bug remaining, but except of that, all core modules support PHP 5.3. They are talking about contrib modules on that page.

"warning: Parameter 1 to profile_load_profile() expected to be a reference, value given in E:\www\mysite.com\includes\module.inc on line 462."

Yes and the patch to fix this is in comment #6 above.

digemall’s picture

Erm, not sure what you are talking about ;)

and they state that drupal core support php 5.3.x from v.6.14 on, but not all core modules do.

Sorry I wrote in a hurry... actually I meant, "but not all contrib modules do."

YK85’s picture

subscribing

marvil07’s picture

Priority: Normal » Critical
Status: Needs review » Reviewed & tested by the community

I should search before making patches :-p

After reading #360605: PHP 5.3 Compatibility I came to the same patch and conclusion Berdir propose here. And I can confirm it works fine :-)

For more reference about this, take a look to a gpk comment on that issue

I'm marking this as critical since this bug broke the main functionality of the module in PHP 5.3

abbasmousavi’s picture

The patch by Berdir works. please commit the patch to CVS.

thanks

daltonparsons’s picture

The patch by Berdir works +1

Thank you, Berdir...saved us tonight.

Andrew Schulman’s picture

Confirmed that Berdir's patch fixes this error. Thanks!

NancyDru’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 6.x-1.x-dev.

Status: Fixed » Closed (fixed)

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

verta’s picture

I can confirm that installing the dev release corrects this error message when using PHP 5.3 and the Drupal 6.19 core profile module with Realnames. Thanks for the fix!

Slovak’s picture

Priority: Normal » Critical
Status: Needs review » Closed (fixed)

Had the same issue. Installed the 6.x-1.x-dev release from 2010-Jul-11 and the errors went away.

Briscoe’s picture

Same issue with PHP 5.3 and Drupal 6.20. The installation of the last 6.x-1.x-dev release fix it.

Stalski’s picture

Subscribing, patch fixes it

Andrew Schulman’s picture

Since this has been fixed in -dev for about 7 months, can we please have a new release?

penguintrax’s picture

I'm new with this, so can you provide some clearer instructions on how to apply this patch code? My attempts have not been successful.

Thank you very much.
Barbara

verta’s picture

You won't need to apply the patch to get the fix discussed in this thread, it's been rolled into the module you get when you get the dev release from the module page. Development releases are listed after the "recommended" releases.

But if you want to learn about applying patches, http://drupal.org/patch/apply is the official page.

+1 for a 1.4 release.

John Franklin’s picture

I'd be happy with a 1.3.1 release that had only bugfixes like this one pulled into it.

scotwith1t’s picture

in case anyone ends up here and wonders, 1.4 was released and includes this fix.

sbogner@insightcp.com’s picture

Status: Closed (fixed) » Needs work

Hi all - I have PHP 5.3.3 and version 1.5 of Real Name, and still get this error:

Parameter 1 to profile_load_profile() expected to be a reference, value given in includes/module.inc on line 476

I see people report that it was fixed with release 1.4, but maybe something broke it in 1.5?

puddyglum’s picture

It could be a different module causing that error. I'm not getting that error though I'm running 5.3.3 and 1.5 of Real Name. Have you upgraded the Profile module?

sbogner@insightcp.com’s picture

Hi jmonkfish - Thanks for the reply. I'm on Drupal 6.26 - and Profile is part of core so that's the latest at this point, I believe.

NancyDru’s picture

Priority: Critical » Major

The error message would indicate a core problem (includes/module.inc).

puddyglum’s picture

Sorry, I got Profile mixed up with Content Profile, which is what we use with Real Name (and may be why we're not getting that error).

sbogner@insightcp.com’s picture

Hi jmonkfish - Thanks for the info, but I don't have Content Profile installed... maybe that's the problem? I will get that installed and report back on how that impacts the error.

sbogner@insightcp.com’s picture

I installed the Content Profile module and still get the same error as before:

Parameter 1 to profile_load_profile() expected to be a reference, value given in .../htdocs/includes/module.inc on line 476.

hass’s picture

Issue summary: View changes
Status: Needs work » Closed (outdated)