That's not a hook implementation or a function calling a hook, it's just a regular function used to load data from profile.module's tables, called directly by profile.module itself. No other functions named MODULENAME_load_profile will be called in this process.
Quite. Rather than start a new issue, the namespace collision seems to be with the Google Analytics module. To expand:
1) Bug report:
Google Analytics provides a hook called hook_load_profile() - see line 93 of googleanalytics.module 6.x-3.x-dev or/and line 101 of googleanalytics.module 6.x-2.2. This is a problem because there is a core function in the Profile module, linked to by hass above, that is *not* in fact a hook, but Google Analytics attempts to invoke it as though it were. Causing...
2) The error message:
Parameter 1 to profile_load_profile() expected to be a reference ... etc.
3) I think it's fairly obvious now, but it's not with WYSIWYG and it took me a while to understand what was going on. ;-)
The solution is to rename the Google Analytics hook to something else that does not interfere with a core function. I'm surprised we don't see stuff like this more often, actually, given the number of lines of code being written. Edit: or if this is not supposed to be a hook at all, but merely an attempt to load profile_load_profile(), then just call it directly - the intended use - no need to 'invoke' it.
Comments
Comment #1
hass commented+
Comment #2
hass commentedChanged topic. Unverified bugreport, but this is what has been reported in the referenced case.
Comment #3
hass commentedComment #4
twodDrupal Core (profile.module) does not provide hook_profile_load(), nor does Content profile module as far as I can tell.
Comment #5
hass commentedhttp://api.drupal.org/api/function/profile_load_profile/6
Comment #6
twodThat's not a hook implementation or a function calling a hook, it's just a regular function used to load data from profile.module's tables, called directly by profile.module itself. No other functions named MODULENAME_load_profile will be called in this process.
Comment #7
sunLike TwoD, I fail to see 1) a proper bug report 2) an actual error message and lastly 3) evidence for the hypothetical namespace collision here.
Comment #8
greg.harveyQuite. Rather than start a new issue, the namespace collision seems to be with the Google Analytics module. To expand:
1) Bug report:
Google Analytics provides a hook called
hook_load_profile()- see line 93 of googleanalytics.module 6.x-3.x-dev or/and line 101 of googleanalytics.module 6.x-2.2. This is a problem because there is a core function in the Profile module, linked to by hass above, that is *not* in fact a hook, but Google Analytics attempts to invoke it as though it were. Causing...2) The error message:
Parameter 1 to profile_load_profile() expected to be a reference ... etc.
3) I think it's fairly obvious now, but it's not with WYSIWYG and it took me a while to understand what was going on. ;-)
The solution is to rename the Google Analytics hook to something else that does not interfere with a core function. I'm surprised we don't see stuff like this more often, actually, given the number of lines of code being written. Edit: or if this is not supposed to be a hook at all, but merely an attempt to load
profile_load_profile(), then just call it directly - the intended use - no need to 'invoke' it.Comment #9
greg.harveyAnd this patch against 6.x-2.2, #8 here: #679404: Warning: Parameter 1 to profile_load_profile() expected to be a reference, value given in module_invoke(), was on the right track - in fact, that probably *is* the patch for 6.x-2.2, unless the intention was to provide a hook (but I don't think it was). You just need something similar for 6.x-3.x-dev:
http://drupal.org/files/issues/google-analytics-679404.patch
Comment #10
hass commentedStopped hook'ing other module functions not officially documented as hooks.
Comment #11
greg.harveyAwesome, thanks. =)