[2.0.5] Empty summary in TokenSource

Created on 3 June 2025, 4 days ago

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'),
     ];
🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇫🇷France pdureau Paris

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024