File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -909,11 +909,12 @@ public function moveItemUp(int $itemId): void
909909 {
910910 try {
911911 $ item = $ this ->getMenuItemSecurely ($ itemId );
912- if (!$ item ) {
912+ if (! $ item ) {
913913 Notification::make ()
914914 ->title (flexiblePagesTrans ('menu_items.errors.item_not_found ' ))
915915 ->danger ()
916916 ->send ();
917+
917918 return ;
918919 }
919920
@@ -922,15 +923,15 @@ public function moveItemUp(int $itemId): void
922923 if ($ previousSibling ) {
923924 $ item ->beforeNode ($ previousSibling )->save ();
924925 $ this ->refreshTree ();
925-
926+
926927 Notification::make ()
927928 ->title ('Menu item moved up successfully. ' )
928929 ->success ()
929930 ->send ();
930931 }
931932 } catch (Exception $ e ) {
932933 Notification::make ()
933- ->title ('Failed to move menu item: ' . $ e ->getMessage ())
934+ ->title ('Failed to move menu item: ' . $ e ->getMessage ())
934935 ->danger ()
935936 ->send ();
936937 }
@@ -940,11 +941,12 @@ public function moveItemDown(int $itemId): void
940941 {
941942 try {
942943 $ item = $ this ->getMenuItemSecurely ($ itemId );
943- if (!$ item ) {
944+ if (! $ item ) {
944945 Notification::make ()
945946 ->title (flexiblePagesTrans ('menu_items.errors.item_not_found ' ))
946947 ->danger ()
947948 ->send ();
949+
948950 return ;
949951 }
950952
@@ -953,15 +955,15 @@ public function moveItemDown(int $itemId): void
953955 if ($ nextSibling ) {
954956 $ item ->afterNode ($ nextSibling )->save ();
955957 $ this ->refreshTree ();
956-
958+
957959 Notification::make ()
958960 ->title ('Menu item moved down successfully. ' )
959961 ->success ()
960962 ->send ();
961963 }
962964 } catch (Exception $ e ) {
963965 Notification::make ()
964- ->title ('Failed to move menu item: ' . $ e ->getMessage ())
966+ ->title ('Failed to move menu item: ' . $ e ->getMessage ())
965967 ->danger ()
966968 ->send ();
967969 }
You can’t perform that action at this time.
0 commit comments