Hi first I must say nice module just having one small problem here I have this message on all my pages.
• warning: Parameter 2 to ed_classified_link_alter() expected to be a reference, value given in C:\wamp\www\drupal-6.16\includes\common.inc on line 2839.
• warning: Parameter 2 to ed_classified_link_alter() expected to be a reference, value given in C:\wamp\www\drupal-6.16\includes\common.inc on line 2839.
I am running drupal 6.16
Apache 2.2.11
PHP 5.3.0
MySQL 5.1.36
I have included file with a break down of the modules I am using. Any ideas what may be causing this problem.
Thanks for your time and effort.
Comments
Comment #1
bobdalob commentedI came across this too. I'm simply transposing the solution to the same problem but with another module, found here.
So you need to edit the ed_classified.module and locate the line "function ed_classified_link_alter(&$node, &$links) {" which appears to be line 226 in the current release. Delete the 2 ampersands ("&"), save and go.
Comment #2
Road Kill commentedHi thanks I will give that a try thank for your time enjoy the day further.
Comment #3
freelockHI,
This error is due to PHP 5.3 being more strict. However, there's a bigger issue here: it looks like ed_classified_link_alter uses the parameter signature for Drupal 5, and never got updated to Drupal 6.
So here's the fix:
... in other words, put the &$links before $node on line 226, and remove the ampersand in front of $node.
Cheers,
John
Comment #4
freelockThis should get fixed, BTW...
Comment #5
zyxware commentedI have converted the fix by freelock into a patch. The change works fine for me on PHP 5.3.
Comment #6
verta commentedI manually made the change from
function ed_classified_link_alter(&$node, &$links) {
to
function ed_classified_link_alter($links, $node) {
(I am using
// $Id: ed_classified.module,v 1.1.4.45.2.35 2009/08/13 02:12:27 milesgillham Exp $
which is the current alpha.)
and confirm that it cures this error message. If there is another alpha or a beta maybe this can make it in there?
Comment #7
fgmThis patch fixes 6.2 for Drupal 6, but breaks it for Drupal 5, and the hallmark of the 6.2 branch is/was compatibility with both 5.x and 6.x.
Branch 6.3 does not have this issue, as it does not implement hook_link_alter() anyway.
Comment #8
freelock@fgm see http://api.drupal.org/api/drupal/developer--hooks--core.php/function/hoo... .
The API for hook_link_alter changed between Drupal 5 and Drupal 6. This patch is appropriate, and matches the new API for D6, which makes it necessary! (Actually there is now a 3rd optional parameter passed, $comment = null).
The links won't function in the 6.x branch properly unless the code is updated for the Drupal 6 api.
Comment #10
fgm@freelock: yes that's what I wrote: this patch fixes the 6.2 branch, but breaks 5.x compatibility and 5.2/6.2/7.2 strove to be one code for all three versions. But since 5.x is no longer supported and 7.2 is likely to be replaced by 7.3 too, this /could/ no longer be a problem.
However, going all the way in that direction would mean removing all the code dedicated to 5.x in the 6.2 branch since it no longer serves any purpose, and that's a big change, and actually the origin of the 6.3 branch. See #777734: De-merge versions for more about this.
I think this is just too big a change for a small issue like this, and a patch for this issue should do just as the 6.2 code does elsewhere: define the function signature depending on the current Drupal version, to remain 5.x-compatible. This is how hook_menu() is implemented in 6.x-2.x-dev, for instance:
Comment #11
fgmPatch fixes issue as suggested, and a few others as well.
Comment #12
fgmFixed included in 6.x-2,x commit 75f15a044 on 2011-07-31, thanks.