From 7ed8c4b9ba8f7114a7ff4668fdd01fe747c94e5e Mon Sep 17 00:00:00 2001
From: Mikael Meulle <21535-just_like_good_vibes@users.noreply.drupalcode.org>
Date: Thu, 1 Aug 2024 16:04:52 +0000
Subject: [PATCH] Issue #3465262 by just_like_good_vibes: Incorect rendering of
 data in views-related sources

---
 .../src/Plugin/UiPatterns/Source/ViewsSourceBase.php      | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/modules/ui_patterns_views/src/Plugin/UiPatterns/Source/ViewsSourceBase.php b/modules/ui_patterns_views/src/Plugin/UiPatterns/Source/ViewsSourceBase.php
index 0829cc54c..9b82d0ac4 100644
--- a/modules/ui_patterns_views/src/Plugin/UiPatterns/Source/ViewsSourceBase.php
+++ b/modules/ui_patterns_views/src/Plugin/UiPatterns/Source/ViewsSourceBase.php
@@ -111,12 +111,14 @@ abstract class ViewsSourceBase extends SourcePluginBase {
     if (empty($output)) {
       return ['#markup' => ''];
     }
-    // Value needs to be render array so slots can handle multiple sources.
+    // We use #children to avoir filtering.
     if ($output instanceof MarkupInterface) {
-      return ['#markup' => $output->__toString()];
+      return [
+        '#children' => (string) $output,
+      ];
     }
     if (is_scalar($output)) {
-      return ['#markup' => $output];
+      return ['#children' => $output];
     }
     return $output;
   }
-- 
GitLab