diff --git a/source/php/Module/Contacts/Contacts.php b/source/php/Module/Contacts/Contacts.php index 09acfb25a..13296c0c4 100644 --- a/source/php/Module/Contacts/Contacts.php +++ b/source/php/Module/Contacts/Contacts.php @@ -98,18 +98,18 @@ public function prepareContacts($contacts) case 'user': $info = apply_filters('Modularity/mod-contacts/contact-info', array( - 'id' => $contact['user']['ID'], + 'id' => !empty($contact['user']['ID']) ? $contact['user']['ID'] : '', 'image' => null, - 'first_name' => $contact['user']['user_firstname'], - 'last_name' => $contact['user']['user_lastname'], + 'first_name' => !empty($contact['user']['user_firstname']) ? $contact['user']['user_firstname'] : '', + 'last_name' => !empty($contact['user']['user_lastname']) ? $contact['user']['user_lastname'] : '', 'work_title' => null, 'administration_unit' => null, - 'email' => $this->hideField('email') ? null : strtolower($contact['user']['user_email']), + 'email' => $this->hideField('email') ? null : strtolower(!empty($contact['user']['user_email']) ? $contact['user']['user_email'] : ''), 'phone' => null, - 'address' => $this->hideField('address') ? null : strip_tags($contact['address'], '
'), + 'address' => $this->hideField('address') ? null : strip_tags(!empty($contact['address']) ? $contact['address'] : '', '
'), 'visiting_address' => null, 'opening_hours' => null, - 'other' => $contact['user']['user_description'], + 'other' => !empty($contact['user']['user_description']) ? $contact['user']['user_description'] : '', 'hasBody' => $this->hasBody($contact) ), $contact, $contact['acf_fc_layout']); break; diff --git a/source/php/Module/Contacts/views/cards.blade.php b/source/php/Module/Contacts/views/cards.blade.php index fb0ef3bd1..0a1514bab 100644 --- a/source/php/Module/Contacts/views/cards.blade.php +++ b/source/php/Module/Contacts/views/cards.blade.php @@ -1,4 +1,4 @@ -@if (!$hideTitle && !empty($postTitle)) +@if (empty($hideTitle) && !empty($postTitle)) @typography([ 'id' => 'mod-text-' . $ID .'-label', 'element' => 'h2', @@ -26,7 +26,7 @@ 'context' => 'module.contacts.card' ]) - @if($showImages && $contact['image']['inlineStyle']) + @if(!empty($showImages) && !empty($contact['image']['inlineStyle']))
diff --git a/source/php/Module/Contacts/views/partials/information.blade.php b/source/php/Module/Contacts/views/partials/information.blade.php index a994914a4..9d503d6e3 100644 --- a/source/php/Module/Contacts/views/partials/information.blade.php +++ b/source/php/Module/Contacts/views/partials/information.blade.php @@ -15,31 +15,31 @@ @includeWhen((count($title) > 0), 'components.title') {{-- E-mail --}} - @includeWhen($contact['email'], 'components.email', ['icon' => 'email']) + @includeWhen(!empty($contact['email']), 'components.email', ['icon' => 'email']) {{-- Phone --}} - @if ($contact['phone']) + @if (!empty($contact['phone'])) @foreach ($contact['phone'] as $phone) @include('components.phone', ['icon' => 'phone']) @endforeach @endif {{-- Social Media --}} - @if ($contact['social_media']) + @if (!empty($contact['social_media'])) @foreach ($contact['social_media'] as $media) @include('components.social_media') @endforeach @endif {{-- Opening Hours --}} - @includeWhen($contact['opening_hours'], 'components.opening_hours') + @includeWhen(!empty($contact['opening_hours']), 'components.opening_hours') {{-- Address --}} - @includeWhen($contact['address'], 'components.adress') + @includeWhen(!empty($contact['address']), 'components.adress') {{-- Visiting Address --}} - @includeWhen($contact['visiting_address'], 'components.visiting') + @includeWhen(!empty($contact['visiting_address']), 'components.visiting') {{-- Other content data --}} - @includeWhen($contact['other'], 'components.other') + @includeWhen(!empty($contact['other']), 'components.other') @endcollection \ No newline at end of file diff --git a/source/php/Module/Contacts/views/partials/list_info.blade.php b/source/php/Module/Contacts/views/partials/list_info.blade.php index 2ff3cb34a..d97291d0f 100644 --- a/source/php/Module/Contacts/views/partials/list_info.blade.php +++ b/source/php/Module/Contacts/views/partials/list_info.blade.php @@ -17,20 +17,20 @@ @endif {{-- Social Media --}} - @if ($contact['social_media']) + @if (!empty($contact['social_media'])) @foreach ($contact['social_media'] as $media) @include('components.social_media') @endforeach @endif {{-- Opening Hours --}} - @includeWhen($contact['opening_hours'], 'components.opening_hours') + @includeWhen(!empty($contact['opening_hours']), 'components.opening_hours') {{-- Address --}} - @includeWhen($contact['address'], 'components.adress') + @includeWhen(!empty($contact['address']), 'components.adress') {{-- Visiting Address --}} - @includeWhen($contact['visiting_address'], 'components.visiting') + @includeWhen(!empty($contact['visiting_address']), 'components.visiting') @if (!empty($module->post_content)) @collection__item([ @@ -42,7 +42,7 @@ @endcollection @endif - @if ($contact['other']) + @if (!empty($contact['other'])) @collection__item([ 'classList' => ['c-collection__other'] ])