Closed (outdated)
Project:
Ad Flash
Version:
6.x-2.6
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
8 Jun 2010 at 08:08 UTC
Updated:
21 Apr 2016 at 15:23 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
zoo33 commentedThat would remove the error messages, but I'm not sure it's the whole solution, since ad_flash_adapi() seems to expect to be able to alter the passed $node object:
The _adapi hook gets invoked in ad.module:
module_invoke() doesn't support arguments as references, which makes ad_flash_adapi()'s changes to $node futile if I understand correctly. The error messages introduced in php 5.3 only puts the finger on an existing problem. So with that in mind, the change suggested by kobee shouldn't introduce any new problems.
Question is, can ad_flash_adapi() do without altering the $node object? I think that's a question for the module author. If not, ad.module has to be modified to invoke this hook in a way that supports references, similar to how node_invoke_nodeapi() does it.
Comment #2
Alex Andrascu commentedThanks for the solution. It's been awhile since i haven't updated this module. I'm looking to do a cummulative update this month tough.
Thanks again.
Comment #3
ionmedia commentedi changed line 211
function ad_flash_adapi($op, &$node) {to
function ad_flash_adapi($op, $node) {error disappear, is this correct fix of this issue ?
Comment #4
john franklin commentedThat fixes it for me.
$nodeis an object, and objects are (effectively) passed by reference. Patch attached that accomplishes #3.Comment #5
kurkuma commentedCheck http://php.net/manual/en/language.oop5.references.php
Comment #6
span commentedWorks for me.
Comment #7
osopolarThe hook ad_flash_adapi is sometimes its called directly, where a reference may be ok, but sometimes with module_invoke which can't pass arguments by reference.
See also drupal API module_invoke.
Looking on all other implementations of hook_adapi the arguments never will be passed by reference, so it shouldn't be done here neither.
Comment #8
kenorb commentedClosed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.