Call-time pass-by-reference has been deprecated
alanic - August 3, 2007 - 21:59
| Project: | Links Package |
| Version: | 5.x-1.7 |
| Component: | Code: links_related.module |
| Category: | bug report |
| Priority: | normal |
| Assigned: | syscrusher |
| Status: | duplicate |
Description
I get this when I enable links_related.module:
Warning: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of links_save_links_for_node(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. in sites/all/modules/links/links_related.module on line 745
This is the line:
links_save_links_for_node(&$node, 'links_related');
The current return value of links_save_links_for_node() is never used in the modules, so I suggest it should return the $node to get rid of the call by reference.

#1
Ok now that I actually know better about the issue, I can say that the function definition is already made for call-by-reference and the reference sign in the function call is redundant. So, the "&" in the function call needs to go and all will be marry.
#2
Could this be patched to the links_related.module please?
I also got this error.
Thanks in advance!
greetings,
Martijn
#3
I just got the same error, and applied the fix above.
The odd thing is, this error only began occurring after I moved the site over to a new server. When on the old server, this error wasn't present (or at least not visible to me).
#4
It happened because either your PHP version changed or maybe the php.ini had a configuration that suppressed this warning. The fix is simple as in my reply #1. It does not change any functionality whatsoever. I'm attaching a patch that does this and I hope it makes its way into the next release.
If you don't know how to apply a patch, just edit links_related.module file and remove the & on line 745. The & is right before $node.
#5
This bug duplicates #195430, and both of them are getting fixed tonight in a new CVS commit. Thanks for the report!
Syscrusher