diff --git a/app/Filament/Components/Actions/UpdateEggBulkAction.php b/app/Filament/Components/Actions/UpdateEggBulkAction.php index d2d26a32c..19fa89ced 100644 --- a/app/Filament/Components/Actions/UpdateEggBulkAction.php +++ b/app/Filament/Components/Actions/UpdateEggBulkAction.php @@ -49,9 +49,15 @@ class UpdateEggBulkAction extends BulkAction $success = 0; $failed = 0; + $skipped = 0; /** @var Egg $egg */ foreach ($records as $egg) { + if ($egg->update_url === null) { + $skipped++; + + continue; + } try { $eggImporterService->fromUrl($egg->update_url, $egg); @@ -67,7 +73,12 @@ class UpdateEggBulkAction extends BulkAction Notification::make() ->title(trans_choice('admin/egg.updated', 2, ['count' => $success, 'total' => $records->count()])) - ->body($failed > 0 ? trans('admin/egg.updated_failed', ['count' => $failed]) : null) + ->body( + collect([ + $failed > 0 ? trans('admin/egg.updated_failed', ['count' => $failed]) : null, + $skipped > 0 ? trans('admin/egg.updated_skipped', ['count' => $skipped]) : null, + ])->filter()->join(' ') + ) ->status($failed > 0 ? 'warning' : 'success') ->persistent() ->send(); diff --git a/lang/en/admin/egg.php b/lang/en/admin/egg.php index 7fd9d3a07..69532e399 100644 --- a/lang/en/admin/egg.php +++ b/lang/en/admin/egg.php @@ -101,6 +101,7 @@ return [ 'update' => 'Update|Update selected', 'updated' => 'Egg updated|:count/:total Eggs updated', 'updated_failed' => ':count failed', + 'updated_skipped' => ':count skipped', 'update_question' => 'Are you sure you want to update this egg?|Are you sure you want to update the selected eggs?', 'update_description' => 'If you made any changes to the egg they will be overwritten!|If you made any changes to the eggs they will be overwritten!', 'no_updates' => 'No updates for the selected eggs available',