Project:RealName
Version:6.x-1.3
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed (fixed)
Issue tags:PHP 5.3

Issue Summary

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

Comments

#1

*deleting wrong "solution"*

Thx diggemall (see #2) for clarification.

#2

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...

#3

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

#4

Ok thx for the clarification VM ;)

#5

tagged

#6

Status:active» needs review

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...

AttachmentSizeStatusTest resultOperations
realname_php53fix.patch765 bytesIgnored: Check issue status.NoneNone

#7

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

#8

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)

#9

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

#10

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 ;)

#11

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.

#12

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."

#13

subscribing

#14

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

#15

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

thanks

#16

The patch by Berdir works +1

Thank you, Berdir...saved us tonight.

#17

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

#18

Status:reviewed & tested by the community» fixed

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

#19

Status:fixed» closed (fixed)

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

#20

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!

#21

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

#22

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

#23

Subscribing, patch fixes it

#24

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

#25

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

#26

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.

#27

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

#28

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