1

i dont know why

the script node_load(7) output is :

public 'field_tags' => 
    array (size=1)
      'und' => 
        array (size=2)
          0 => 
            array (size=1)
              'tid' => string '2' (length=1)
          1 => 
            array (size=1)
              'tid' => string '3' (length=1)

why the field tags not filled with tag title ! it only shows tid's

does this is a normal behavior of Drupal node_laod that it only load's primary id's of relational contents like taxonomy terms ?

0

Yes, that is the correct and expected behaviour. Loading every entity referenced by a node every time it loads, could potentially get very heavy on the server very quickly. That's why referenced entities are lazy-loaded (albeit manually as far as core is concerned).

To load taxonomy term entities from the tid, you can use taxonomy_term_load(). If you want an (arguably) slightly more pleasant experience when working with entities/fields on code, check out the EntityMetadataWrapper class, which is part of the Entity API module.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.