Problem/Motivation

When token value is empty, settingsSummary() returns an non-empty array.

Proposed resolution

diff --git a/src/Plugin/UiPatterns/Source/TokenSource.php b/src/Plugin/UiPatterns/Source/TokenSource.php
index 0275bc96..baaf3d4a 100644
--- a/src/Plugin/UiPatterns/Source/TokenSource.php
+++ b/src/Plugin/UiPatterns/Source/TokenSource.php
@@ -146,6 +146,9 @@ class TokenSource extends SourcePluginBase {
    * {@inheritdoc}
    */
   public function settingsSummary(): array {
+    if (empty($this->getSetting('value'))) {
+      return [];
+    }
     return [
       $this->getSetting('value'),
     ];
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

pdureau created an issue. See original summary.

pdureau’s picture

Assigned: pdureau » Unassigned
Status: Active » Needs review

  • pdureau committed 26a6e6be on 2.0.x
    Issue #3528093 by pdureau: Empty summary in TokenSource
    
pdureau’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.