Closed (duplicate)
Project:
Drupal core
Component:
node system
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
29 Jan 2005 at 07:50 UTC
Updated:
7 Mar 2005 at 04:29 UTC
when the 'settings' nodeapi operation is invoked, a string containing the type of node is sent for the $node argument, instead of an object like the rest of the operations. This breaks comment.module, and is inconsistent with the rest of the operations and documentation.
This small patch fixes the problem.
| Comment | File | Size | Author |
|---|---|---|---|
| node_24.patch | 1.42 KB | crunchywelch |
Comments
Comment #1
dries commentedLooks like the node_invoke_nodeapi function is broken. It used to be possible to pass a $type.
Comment #2
asimmonds commentedThis also affects upload.module and about 6 contributed modules.
What's the best way to fix this?
Change the node_invoke_nodeapi() phpdoc to only accept a node object or change node_invoke_nodeapi() to accept a string or array and convert to object before passing to the _nodeapi hooks.
4.5 worked because a $node object was created and populated with $type before calling node_invoke_nodeapi()
Using upload.module as a example, a side-effect of this bug is that the node type settings are saved as upload_ instead of upload_nodetype into the variables table.
Comment #3
dries commentedOK, so let's go with this (or chx's slightly better fix) and update the PHPdoc accordingly.
Comment #4
chx commentedI have also noted this, even submitted a patch (which I have now marked as duplicate, although I think that was better) and because this breaks two core modules (comment and upload) I mark this critical.
Comment #5
chx commentedOh I have not seen Dries' comment. If he thinks mine is better, then this is duplicate and mine is patch :)
Comment #6
asimmonds commentedI agree, chx's patch in #18216 is better as the $node object is created properly with stdClass()