using custom CCK fields in node + Drupal 6 for some reason not accessible by $node ->field_name

StackOverflow https://stackoverflow.com/questions/11258992

  •  18-06-2021
  •  | 
  •  

سؤال

I have created a custom CCK field and gave proper permission to users, but
for some reason I cannot access the field by using $node->field_name does anybody have Idea about this ?

Thanks In advance -S

هل كانت مفيدة؟

المحلول 2

I found that for some reason, in drupal 6 if we are using same CCK field for different content types, Nodes that had already created may not have the newly created field. When you edit and save the node. you will get the value for the new field.

نصائح أخرى

print_r($node->field_machine_readable_name) and see what it prints. You can use the devel module to see deep information about various fields and functions.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top