Skip to content

Commit

Permalink
Merge pull request #1646 from danskernesdigitalebibliotek/DDFHER-99-o…
Browse files Browse the repository at this point in the history
…pening-hours-modal-fails

DDFHER-99 - Fix issue caused by preserved opening hours referencing deleted branches
  • Loading branch information
kasperbirch1 authored Oct 11, 2024
2 parents 54690dd + 222a4ea commit 0f44dd4
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@ public function loadMultiple(int $branchId = NULL, \DateTimeInterface $fromDate
}
}, $result->fetchAll(\PDO::FETCH_ASSOC));

return array_filter($possible_objects);
// Using array_values to reindex the array after filtering out NULL values.
// This is necessary because we don't handle the deletion of opening hour
// instances that reference a branch which has been deleted.
return array_values(array_filter($possible_objects));
}

/**
Expand Down

0 comments on commit 0f44dd4

Please sign in to comment.