Skip to content

Commit

Permalink
Fix action check. Only apply to assets in the right container
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvesterdamgaard committed Oct 22, 2024
1 parent db8fed2 commit 24c0829
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Actions/CP/ProcessUpload.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Tv2regionerne\StatamicAssetdrop\Actions\CP;

use Statamic\Actions\Action;
use Statamic\Contracts\Assets\Asset;
use Tv2regionerne\StatamicAssetdrop\Actions\ProcessUpload as ProcessUploadAction;

class ProcessUpload extends Action
Expand All @@ -16,7 +17,7 @@ public static function title()

public function visibleTo($item)
{
return $item->container()->handle() === config('assetdrop.container');
return $item instanceof Asset && $item->container()->handle() === config('assetdrop.container');
}

public function authorize($user, $item)
Expand Down

0 comments on commit 24c0829

Please sign in to comment.