1

For some fields, not all, the language index is missing from the field array. For example, here is the body field of the packaged blog content type (using print_r):

[body] => Array
    (
        [0] => Array
            (
                [value] => <p>Shirley Temple[...]
                [summary] => <p>Shirley Temple[...]
                [format] => html_raw
                [safe_value] => <p>Shirley Temple[...]
                [safe_summary] => <p>Shirley Temple[...]
            )
    )

Expected structure:

[body] => Array
        (
            [und] => Array
                (
                    [0] => Array
                        (
                            [value] => <p>Shirley Temple[...]
                            [summary] => <p>Shirley Temple[...]
                            [format] => html_raw
                            [safe_value] => <p>Shirley Temple[...]
                            [safe_summary] => <p>Shirley Temple[...]
                        )
                )
        )

I have only ever seen this happen on two fields (the one above and another field from a different content type). Other fields on the blog content type are fine. It looks like it is only happening on my development environment, production seems to be fine. If I set $reset to true when calling node_load() then the structure is fine.

field_get_items() returns false and wrapping the node using the Entity API's entity_metadata_wrapper() and calling $wrapped_node->body->value() I gives the following PHP error:

EntityMetadataWrapperException: Missing data values. in EntityMetadataWrapper->value() (line 83 of /vagrant/web/sites/all/modules/entity/includes/entity.wrapper.inc).

Setup:

Drupal 7.28
PHP 5.3.10
MySQL 5.5.34
Apache 2.2.22
memcached 1.4.13

0

I haven't run into this issue again. I think a Drupal update resolved the problem.

| 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.