Skip to content

Commit

Permalink
int cast for media id check removed (#292)
Browse files Browse the repository at this point in the history
  • Loading branch information
koslo authored Feb 17, 2022
1 parent 89c972b commit 7c32be7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Fields/HandlesExistingMediaTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ private function addExistingMedia(NovaRequest $request, $data, HasMedia $model,
->filter(function ($value) use ($addedMediaIds) {
// New files will come in as UploadedFile objects,
// whereas Vapor-uploaded files will come in as arrays.
return (! ($value instanceof UploadedFile)) && (! (is_array($value))) && ! (in_array((int) $value, $addedMediaIds));
return (! ($value instanceof UploadedFile)) && (! (is_array($value))) && ! (in_array($value, $addedMediaIds));
})->map(function ($model_id, int $index) use ($request, $model, $collection) {
$mediaClass = config('media-library.media_model');
$existingMedia = $mediaClass::find($model_id);
Expand Down

0 comments on commit 7c32be7

Please sign in to comment.