[drupal-devel] [bug] Content type options editing broken
Goba
drupal-devel at drupal.org
Thu Feb 10 19:58:03 UTC 2005
Project: Drupal
Version: cvs
Component: node system
Category: bug reports
Priority: normal
Assigned to: Goba
Reported by: Goba
Updated by: Goba
Status: patch
Attachment: http://drupal.org/files/issues/Drupal-fix-node-options-settings1.patch (1.51 KB)
OK, attached a different patch, using the $node as type name in case of
the settings operation.
Goba
Previous comments:
------------------------------------------------------------------------
February 7, 2005 - 23:06 : Goba
Attachment: http://drupal.org/files/issues/Drupal-fix-node-options-settings.patch (1.38 KB)
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.
------------------------------------------------------------------------
February 8, 2005 - 09:16 : Anonymous
+1 for this fix, but please change double-quotes to single-quotes before
applying it... BTW: There was a duplicate [1] with a similar (although
slightly less elegant) patch.
[1] http://drupal.org/node/16509
------------------------------------------------------------------------
February 8, 2005 - 20:47 : Dries
According to the PHPdoc, a $type-string can be used. If I remember
correctly, this used to work?
------------------------------------------------------------------------
February 9, 2005 - 13:33 : Goba
I don't know if it used to work or not, since the drupaldocs.org docs
[2] 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.
[2] http://drupaldocs.org/api/head/function/hook_nodeapi
------------------------------------------------------------------------
February 10, 2005 - 20:26 : Dries
I used to work: just check lines 298, 314 and 334 of node.module.
--
View: http://drupal.org/node/16960
Edit: http://drupal.org/project/comments/add/16960
More information about the drupal-devel
mailing list