Skip to content

Commit

Permalink
pkp/pkp-lib#10511 Avoid running queries if there's nothing to process
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasraoni authored Nov 29, 2024
1 parent b740084 commit dc49076
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ public function up(): void
$query->select('series_id')->from('series');
})->pluck('navigation_menu_item_id');

if (!$invalidNavigationMenuItemIds->count()) {
return;
}

DB::table('navigation_menu_item_assignments')
->whereIn('parent_id', $invalidNavigationMenuItemIds)
->update(['parent_id' => null]);
Expand Down

0 comments on commit dc49076

Please sign in to comment.