Skip to content

Commit 5c5696c

Browse files
committed
Save re-ordering
1 parent 1651f79 commit 5c5696c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Resources/MenuResource/Pages/ManageMenuItems.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -294,21 +294,21 @@ public function reorderMenuItems(array $orderedItems): void
294294

295295
// Validate that all items belong to this menu
296296
$itemIds = array_column($orderedItems, 'id');
297-
297+
298298
// Filter out null IDs
299299
$itemIds = array_filter($itemIds, function($id) {
300300
return $id !== null && is_numeric($id);
301301
});
302-
302+
303303
if (empty($itemIds)) {
304304
Notification::make()
305305
->title(flexiblePagesTrans('menu_items.errors.no_items_to_reorder'))
306306
->danger()
307307
->send();
308-
308+
309309
return;
310310
}
311-
311+
312312
$validItems = $menuItemModel::whereIn('id', $itemIds)
313313
->where('menu_id', $this->record->id)
314314
->count();
@@ -418,7 +418,7 @@ protected function processNestedSetReorder(array $orderedItems): void
418418

419419
// Process items with parents
420420
foreach ($itemsByParent as $parentId => $children) {
421-
if ($parentId !== null) {
421+
if ($parentId) {
422422
$parent = $this->getMenuItemSecurely($parentId);
423423
if ($parent) {
424424
// Move items to the correct parent first

0 commit comments

Comments
 (0)