diff --git a/src/Entity/Paragraph.php b/src/Entity/Paragraph.php index 2fbe8dd..7681a71 100644 --- a/src/Entity/Paragraph.php +++ b/src/Entity/Paragraph.php @@ -475,6 +475,18 @@ class Paragraph extends ContentEntityBase implements ParagraphInterface { $summary[] = $block_admin_label; } } + + if ($field_definition->getType() == 'link') { + if (!empty($this->get($field_name)->first())) { + // If no title is set, fallback to the uri. + if ($title = $this->get($field_name)->first()->getProperties()['title']->getValue()) { + $summary[] = $title; + } + else { + $summary[] = $this->get($field_name)->first()->get('uri')->getValue(); + } + } + } } if ($show_behavior_summary) { diff --git a/src/Tests/Experimental/ParagraphsExperimentalEditModesTest.php b/src/Tests/Experimental/ParagraphsExperimentalEditModesTest.php index d1f4d6a..2a2dee3 100644 --- a/src/Tests/Experimental/ParagraphsExperimentalEditModesTest.php +++ b/src/Tests/Experimental/ParagraphsExperimentalEditModesTest.php @@ -21,6 +21,7 @@ class ParagraphsExperimentalEditModesTest extends ParagraphsExperimentalTestBase public static $modules = [ 'image', 'block_field', + 'link' ]; /** @@ -135,6 +136,30 @@ class ParagraphsExperimentalEditModesTest extends ParagraphsExperimentalTestBase ]; $this->drupalPostAjaxForm(NULL, $edit, 'field_paragraphs_0_collapse'); $this->assertRaw('