Quantcast
Viewing all articles
Browse latest Browse all 292486

Getting a translated field value sometimes fails

#1969728: Implement Field API "field types" as TypedData Plugins stumbled over this problem and had to create the following work-a-round:

<?php
         
if ($entity instanceof EntityNG || $entity instanceof EntityBCDecorator) {
           
// @todo $entity->getTranslation()->get($name) sometimes fails,
            // because Entity\Translation::getPropertyDefinitions() is empty() ??
           
try {
             
$entities_items[$id] = $entity->getTranslation($langcode)->get($field_name);
            }
            catch (\
InvalidArgumentException $e) {
              break;
            }
          }
?>

Let's fix this here once the issue is done.


Viewing all articles
Browse latest Browse all 292486

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>