Please do not set this issue to Drupal 8.x to be back-ported later as the function "hook_nodeapi()" does not exist in Drupal 7.x or 8.x.

When using Drupal 6 with PHP 5.3 we get the error below when we pass the $node object by reference to hook_nodeapi().

"warning: Parameter 1 on my_module_nodeapi() expected to be a reference"

In the documentation for hook_nodeapi() we are having $node passed by reference. With Drupal 6 supporting PHP 5.3 we need to remove the & from $node since PHP 5 always passes objects into functions by reference. Which means if we remove this it will not affect our users on PHP 5.2.

Patches will need to be made for contrib modules as they rear their heads with this error. I know I've come across a couple and am going to make patches for them.

CommentFileSizeAuthor
#1 remove_reference-1710770-1.patch875 bytesSteven Brown

Comments

Steven Brown’s picture

StatusFileSize
new875 bytes

Here's the patch to remove the reference.

Steven Brown’s picture

Status: Active » Needs review

Forgot to set the status.

Status: Needs review » Needs work

The last submitted patch, remove_reference-1710770-1.patch, failed testing.

tim.plunkett’s picture

Project: Drupal core » Documentation
Version: 6.x-dev »
Component: documentation » Correction/Clarification
Steven Brown’s picture

Status: Needs work » Needs review

The patch in #1 was made against documentation.git repository version 6.x-1.x. I had unfortunately file this originally under the wrong project. So used to the docs being inside the module files and not stand alone :)

jhodgdon’s picture

Component: Correction/Clarification » API documentation files
Issue summary: View changes
jhodgdon’s picture

Status: Needs review » Closed (won't fix)

We are not fixing Drupal 6 hook docs any more.