From 49271509ef91d4d30d679f3cb11aeaa135b05197 Mon Sep 17 00:00:00 2001 From: Timur Tripp Date: Wed, 28 Feb 2024 10:34:50 -0700 Subject: [PATCH] CuBoulder/ucb_migration_shortcodes#15 Updates site contact info block render array --- src/Plugin/Block/SiteInfoBlock.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/Plugin/Block/SiteInfoBlock.php b/src/Plugin/Block/SiteInfoBlock.php index d6577ea..e496f3d 100644 --- a/src/Plugin/Block/SiteInfoBlock.php +++ b/src/Plugin/Block/SiteInfoBlock.php @@ -51,11 +51,23 @@ public static function create(ContainerInterface $container, array $configuratio */ public function build() { $config = $this->configFactory->get('ucb_site_configuration.contact_info'); + $general = array_map(function ($item) { + return [ + 'visible' => $item['visible'], + 'label' => $item['label'], + 'value' => [ + '#type' => 'processed_text', + '#text' => $item['value']['value'], + '#format' => $item['value']['format'], + '#langcode' => 'en', + ], + ]; + }, $config->get('general')); return [ '#data' => [ 'icons_visible' => $config->get('icons_visible'), 'general_visible' => $config->get('general_visible'), - 'general' => $config->get('general'), + 'general' => $general, 'email_visible' => $config->get('email_visible'), 'email' => $config->get('email'), 'phone_visible' => $config->get('phone_visible'),