Closed (fixed)
Project:
Drupal core
Component:
node system
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
7 Feb 2005 at 22:06 UTC
Updated:
24 Feb 2005 at 21:15 UTC
Jump to comment: Most recent file
The node options settings implemented through the nodeapi 'settings' op is incorrectly invoked. Only the type is passed on as a string, while the nodeapi hook expects a node object. Therefore the type property of the object is not possible to use in the hook, and it is impossible to set and content type options.
One way to fix it is to use $node as a typename inside the nodeapi settings op implementation, and the other way is to really pass an object. A patch for the second option is attached.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | Drupal-fix-node-options-settings1.patch | 1.51 KB | gábor hojtsy |
| Drupal-fix-node-options-settings.patch | 1.38 KB | gábor hojtsy |
Comments
Comment #1
(not verified) commented+1 for this fix, but please change double-quotes to single-quotes before applying it... BTW: There was a duplicate with a similar (although slightly less elegant) patch.
Comment #2
dries commentedAccording to the PHPdoc, a $type-string can be used. If I remember correctly, this used to work?
Comment #3
gábor hojtsyI don't know if it used to work or not, since the drupaldocs.org docs are also a bit behind in following the code (still writing about columns to add to the settings table for nodes). Either way, it is just a question of definition. If we allow type names to be used, then the phpdocs in the contrib/docs needs to be updated, and this bug needs a different fix.
Comment #4
dries commentedI used to work: just check lines 298, 314 and 334 of node.module.
Comment #5
gábor hojtsyOK, attached a different patch, using the $node as type name in case of the settings operation.
Comment #6
dries commentedCommitted to HEAD.
Comment #7
(not verified) commented