Skip to content

Commit

Permalink
Merge pull request #709 from helsingborg-stad/fix/menu-module-classes
Browse files Browse the repository at this point in the history
fix: menu module classes null
  • Loading branch information
NiclasNorin authored Nov 19, 2024
2 parents b015b6c + 3e8185b commit bac61a4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion source/php/Module/Menu/Decorator/Listing.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ private function tryGetColumns(bool $wrapped, int $columns, int $amountOfItems):
* @param int $amountOfItems The amount of items.
* @return array The array of grid classes.
*/
private function getGridColumnsCompabilityClasses (bool $wrapped, int $columns, int $amountOfItems)
private function getGridColumnsCompabilityClasses (bool $wrapped, int $columns, int $amountOfItems): array
{
if (!$wrapped) {
return [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
'display' => 'grid',
'classList' => array_merge([
'mod-menu__container',
], $gridClasses)
], $gridClasses ?? [])
])
@foreach ($menu['items'] as $menuItem)
<div class="mod-menu__item {{$menuItem['post_type'] ? 's-post-type-' . $menuItem['post_type'] : ''}}">
Expand Down

0 comments on commit bac61a4

Please sign in to comment.