Skip to content
Snippets Groups Projects

Issue #2951294 by joseph.olstad, geek-merlin, joey-santiago, suresh prabhu...

Open Joseph Olstad requested to merge issue/drupal-2951294:2951294-sort-out-and into 11.x
Files
2
@@ -92,7 +92,15 @@ public function loadEntityByConfigTarget($entity_type_id, $target) {
* {@inheritdoc}
*/
public function getTranslationFromContext(EntityInterface $entity, $langcode = NULL, $context = []) {
$translation = $entity;
$context += ['fallback_to_passed_entity' => TRUE];
if ($context['fallback_to_passed_entity']) {
// @todo Consider deprecating this usage.
// @see https://www.drupal.org/project/drupal/issues/2951294
$translation = $entity;
}
else {
$translation = NULL;
}
if ($entity instanceof TranslatableDataInterface && count($entity->getTranslationLanguages()) > 1) {
if (empty($langcode)) {
Loading