From 9102108bf678154bae70519a61a4b0572de4b211 Mon Sep 17 00:00:00 2001 From: Niclas Norin Date: Tue, 29 Aug 2023 11:31:34 +0200 Subject: [PATCH 1/2] Fix: Map error notices --- source/php/Module/Map/Map.php | 14 +++++++------- source/php/Module/Map/views/default.blade.php | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/source/php/Module/Map/Map.php b/source/php/Module/Map/Map.php index ea52b67e7..c698175cf 100644 --- a/source/php/Module/Map/Map.php +++ b/source/php/Module/Map/Map.php @@ -71,14 +71,14 @@ private function defaultTemplateData($data, $fields) { //Create data array $data['map_url'] = $map_url; - $data['map_description'] = $fields['map_description']; + $data['map_description'] = !empty($fields['map_description']) ? $fields['map_description'] : ''; - $data['show_button'] = $fields['show_button']; - $data['button_label'] = $fields['button_label']; - $data['button_url'] = $fields['button_url']; - $data['more_info_button'] = $fields['more_info_button']; - $data['more_info'] = $fields['more_info']; - $data['more_info_title'] = $fields['more_info_title']; + $data['show_button'] = !empty($fields['show_button']) ? $fields['show_button'] : false; + $data['button_label'] = !empty($fields['button_label']) ? $fields['button_label'] : false; + $data['button_url'] = !empty($fields['button_url']) ? $fields['button_url'] : false; + $data['more_info_button'] = !empty($fields['more_info_button']) ? $fields['more_info_button'] : false; + $data['more_info'] = !empty($fields['more_info']) ? $fields['more_info'] : false; + $data['more_info_title'] = !empty($fields['more_info_title']) ? $fields['more_info_title'] : false; $data['cardMapCss'] = ($data['more_info_button']) ? 'o-grid-12@xs o-grid-8@md' : 'o-grid-12@md'; $data['cardMoreInfoCss'] = ($data['more_info_button']) ? 'o-grid-12@xs o-grid-4@md' : ''; diff --git a/source/php/Module/Map/views/default.blade.php b/source/php/Module/Map/views/default.blade.php index 7865cf9aa..0482314ba 100644 --- a/source/php/Module/Map/views/default.blade.php +++ b/source/php/Module/Map/views/default.blade.php @@ -1,4 +1,4 @@ - {{$cardMoreCardCss}} +
@card([ From a968524219b9136320f8b1d81f1ac23353b7202d Mon Sep 17 00:00:00 2001 From: Niclas Norin Date: Tue, 29 Aug 2023 13:41:54 +0200 Subject: [PATCH 2/2] Fix: height bug caused by inconsistency unit value handling --- source/php/Module/Map/Map.php | 2 +- source/php/Module/Map/views/default.blade.php | 2 +- source/php/Module/Map/views/openStreetMap.blade.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/php/Module/Map/Map.php b/source/php/Module/Map/Map.php index c698175cf..e4107003e 100644 --- a/source/php/Module/Map/Map.php +++ b/source/php/Module/Map/Map.php @@ -24,7 +24,7 @@ public function data() : array $data = array(); //Shared template data - $data['height'] = !empty($fields['height']) ? $fields['height'] . 'px' : '400px'; + $data['height'] = !empty($fields['height']) ? $fields['height'] : '400'; $this->template = $fields['map_type']; if ($fields['map_type'] == 'openStreetMap') { diff --git a/source/php/Module/Map/views/default.blade.php b/source/php/Module/Map/views/default.blade.php index 0482314ba..df55075cb 100644 --- a/source/php/Module/Map/views/default.blade.php +++ b/source/php/Module/Map/views/default.blade.php @@ -8,7 +8,7 @@ ], 'attributeList' => [ 'aria-labelledby' => 'mod-map-' . $id .'-label', - 'style' => 'min-height: ' . $height . ';' + 'style' => 'min-height: ' . $height . 'px;' ], 'context' => 'module.map' ]) diff --git a/source/php/Module/Map/views/openStreetMap.blade.php b/source/php/Module/Map/views/openStreetMap.blade.php index 29bb970ef..a377f318b 100644 --- a/source/php/Module/Map/views/openStreetMap.blade.php +++ b/source/php/Module/Map/views/openStreetMap.blade.php @@ -11,6 +11,6 @@ @openStreetMap([ 'startPosition' => $startPosition, 'pins' => $pins, - 'height' => $height + 'height' => $height . 'px' ]) @endopenStreetMap \ No newline at end of file