Commit 36ef945b authored by catch's avatar catch
Browse files

Issue #3344386 by Charlie ChX Negyesi: Add entity to the entity reference...

Issue #3344386 by Charlie ChX Negyesi: Add entity to the entity reference label formatter render array
parent 63e76048
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -95,6 +95,7 @@ public function viewElements(FieldItemListInterface $items, $langcode) {
      else {
        $elements[$delta] = ['#plain_text' => $label];
      }
      $elements[$delta]['#entity'] = $entity;
      $elements[$delta]['#cache']['tags'] = $entity->getCacheTags();
    }

+1 −0
Original line number Diff line number Diff line
@@ -376,6 +376,7 @@ public function testLabelFormatter() {
    // lacking any URL info.
    $expected_item_2 = [
      '#plain_text' => $this->unsavedReferencedEntity->label(),
      '#entity' => $this->unsavedReferencedEntity,
      '#cache' => [
        'contexts' => [
          'user.permissions',