Skip to content
This repository has been archived by the owner on Aug 16, 2024. It is now read-only.

fix: fix TypeError when selectedSectionsArray is null #180

Merged
merged 1 commit into from
May 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions module/Olcs/view/sections/cases/pages/submission.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@ $isInternalReadOnly = $this->placeholder('isInternalReadOnly')->getValue();

$freetext = '';

if (is_array($selectedSectionsArray)) {
$selectedIds = array_column($selectedSectionsArray, 'sectionId');
} else {
$selectedIds = [];
}
$selectedSectionsArray = is_array($selectedSectionsArray) ? $selectedSectionsArray : [];

$selectedIds = array_column($selectedSectionsArray, 'sectionId');

foreach ($allSections as $sectionId => $sectionDescription) {
if (array_key_exists($sectionId, $selectedSectionsArray))
{
Expand Down
Loading