Drupal 5: CCK fields in custom content type

I have a module that implements a custom content type using NodeAPI interceptors ( hook_insert, hook_updateetc.). I want to add a CCK field to this type of content and populate it with hook_nodeapi calls, such as creating or updating (to display content nodes in views).

The problem is that I cannot access the CCK fields for this content type. Of course, it is included on the "Field Management" page, but when I load any node of this type using the Devel module, I can not see the field attribute ( field_flag) in the node object. I see this under the Demo tab as part of the content attribute, for example $node->content['field_flag']['#value'], but if I assign a value to $node->field_flagor $node->content['field_flag']['#value']and call node_save, the CCK fields will not be saved.

Maybe I need to call some other function to save the CCK fields? Or what could be wrong with this setting?

+3
source share
1 answer

I believe the field

$node->field_flag[0]['value']

Drupal 6 . , , node, , . , node_save. Drupal 5 , . .

+1

Source: https://habr.com/ru/post/1738048/


All Articles