[drupal-devel] [bug] nodeapi 'settings' call sends string instead of object for $node value
Project: Drupal Version: cvs Component: node system Category: bug reports Priority: normal Assigned to: crunchywelch Reported by: crunchywelch Updated by: crunchywelch Status: patch Attachment: http://drupal.org/files/issues/node_24.patch (1.42 KB) 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. crunchywelch -- View: http://drupal.org/node/16384 Edit: http://drupal.org/project/comments/add/16384
Project: Drupal Version: cvs Component: node system Category: bug reports Priority: normal Assigned to: crunchywelch Reported by: crunchywelch Updated by: Dries Status: patch * Invoke a hook_nodeapi() operation in all modules. * * @param &$node * Either a node object, node array, or a string containing the node type. Looks like the node_invoke_nodeapi function is broken. It used to be possible to pass a $type. Dries Previous comments: ------------------------------------------------------------------------ January 29, 2005 - 09:50 : crunchywelch Attachment: http://drupal.org/files/issues/node_24.patch (1.42 KB) 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. -- View: http://drupal.org/node/16384 Edit: http://drupal.org/project/comments/add/16384
Issue status update for http://drupal.org/node/16384 Project: Drupal Version: cvs Component: node system Category: bug reports Priority: normal Assigned to: crunchywelch Reported by: crunchywelch Updated by: asimmonds Status: patch This 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. asimmonds Previous comments: ------------------------------------------------------------------------ January 29, 2005 - 20:50 : crunchywelch Attachment: http://drupal.org/files/issues/node_24.patch (1.42 KB) 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. ------------------------------------------------------------------------ February 1, 2005 - 08:39 : Dries * Invoke a hook_nodeapi() operation in all modules. * * @param &$node * Either a node object, node array, or a string containing the node type. Looks like the node_invoke_nodeapi function is broken. It used to be possible to pass a $type.
Issue status update for http://drupal.org/node/16384 Project: Drupal Version: cvs Component: node system Category: bug reports Priority: normal Assigned to: crunchywelch Reported by: crunchywelch Updated by: Dries Status: patch OK, so let's go with this (or chx's slightly better fix) and update the PHPdoc accordingly. Dries Previous comments: ------------------------------------------------------------------------ January 29, 2005 - 09:50 : crunchywelch Attachment: http://drupal.org/files/issues/node_24.patch (1.42 KB) 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. ------------------------------------------------------------------------ January 31, 2005 - 21:39 : Dries * Invoke a hook_nodeapi() operation in all modules. * * @param &$node * Either a node object, node array, or a string containing the node type. Looks like the node_invoke_nodeapi function is broken. It used to be possible to pass a $type. ------------------------------------------------------------------------ March 6, 2005 - 08:38 : asimmonds This 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.
Issue status update for http://drupal.org/node/16384 Project: Drupal Version: cvs Component: node system Category: bug reports -Priority: normal +Priority: critical Assigned to: crunchywelch Reported by: crunchywelch Updated by: chx Status: patch I 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. chx Previous comments: ------------------------------------------------------------------------ January 29, 2005 - 08:50 : crunchywelch Attachment: http://drupal.org/files/issues/node_24.patch (1.42 KB) 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. ------------------------------------------------------------------------ January 31, 2005 - 20:39 : Dries * Invoke a hook_nodeapi() operation in all modules. * * @param &$node * Either a node object, node array, or a string containing the node type. Looks like the node_invoke_nodeapi function is broken. It used to be possible to pass a $type. ------------------------------------------------------------------------ March 6, 2005 - 07:38 : asimmonds This 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. ------------------------------------------------------------------------ March 6, 2005 - 11:04 : Dries OK, so let's go with this (or chx's slightly better fix) and update the PHPdoc accordingly.
participants (4)
-
asimmonds -
chx -
crunchywelch -
Dries