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.
Problem/Motivation
EntityNG::language() returns NULL even when a language has been set for the entity.
Proposed resolution
Switch ->language to ->value.
return $this->get('langcode')->value;
Comment | File | Size | Author |
---|---|---|---|
#1 | 1823584-language.patch | 463 bytes | linclark |
Comments
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous commentedComment #3
Anonymous (not verified) CreditAttribution: Anonymous commentedIt was actually FALSE, not NULL that it was returning for me. It still does return FALSE, I'm not sure how these tests are using it differently.
Comment #4
Anonymous (not verified) CreditAttribution: Anonymous commentedNevermind, this is because the entity_test entity has a langcode field and I copied that to jsonld_test without copying the attachPropertyData function.