Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have a entity with two text fields- one of type "text" and the second of type "text_with_summary". Unfortunately I'm not able to set/get the fields values with entity_metadata_wrapper. See post #2 for updated information.
Any help would be very appreciated, thanks!
Comments
Comment #0.0
haggins CreditAttribution: haggins commentedAdditional information
Comment #0.1
haggins CreditAttribution: haggins commentedUpdated issue summary.
Comment #0.2
haggins CreditAttribution: haggins commentedUpdated issue summary.
Comment #1
haggins CreditAttribution: haggins commentedI'm getting closer to the problem:
This does not work:
This does:
Also, when I try to access the fields data, I'm forced to tell the language:
What's going on here? Do you need more information?
Comment #2
haggins CreditAttribution: haggins commentedComment #2.0
haggins CreditAttribution: haggins commentedUpdated issue summary.
Comment #3
haggins CreditAttribution: haggins commentedThe behavior seems to come from the translatable property of a field. If I set a field to non-translatable it works as intended. On translatable fields you are forced to define a language code to work on.
So I mark this as bug since the language should be
LANGUAGE_NONE
if not explicitly declared.Comment #4
kle CreditAttribution: kle commentedthis must be a bug, I wonder I didn't recognized this before.
Workaround 2: use of
field_get_items()
returns the correct language.Comment #4.0
kle CreditAttribution: kle commentedUpdated issue summary.
Comment #5
DamienMcKennaYou might try the patch in #2335885: 'langcode' option in info array is not applied to see if it helps.