Hi

As discussed with @mglaman in IRC buildPaneSummary() should return rander arrays insteard raw html

Comments

niko- created an issue. See original summary.

niko-’s picture

StatusFileSize
new8.76 KB
bojanz’s picture

Status: Active » Needs review
bojanz’s picture

We should add some code for BC so that if buildPaneSummary of a pane returns a string, we wrap it into a '#type' => 'markup' element. That way we don't break existing panes.

-    return $this->order->getEmail();
+    return [
+      '#type' => 'inline_template',
+      '#template' => '{{ email }}',
+      '#context' => [
+        'email' => $this->order->getEmail(),
+      ],
+    ];

What is the reasoning for using an inline_template here? I'd expect a markup element.

mglaman’s picture

StatusFileSize
new8.56 KB

Here's an updated patch.

mglaman’s picture

bojanz’s picture

Title: Support render array in buildPaneSummary() » CheckoutPane::buildPaneSummary() should return renderable arrays
Category: Bug report » Feature request

  • bojanz committed 5a8fbbe on 8.x-2.x authored by niko-
    Issue #2854425 by niko-, mglaman, bojanz: CheckoutPane::buildPaneSummary...
bojanz’s picture

Status: Needs review » Fixed

Thanks, guys.

Status: Fixed » Closed (fixed)

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