Skip to content

Commit 784629e

Browse files
committed
Check if copy possible before adding action
1 parent 937c6be commit 784629e

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/elements/Variant.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1369,7 +1369,12 @@ protected static function defineActions(string $source): array
13691369
]);
13701370

13711371
$actions[] = ['type' => SetDefaultVariant::class];
1372-
$actions[] = ['type' => Copy::class];
1372+
1373+
// In case they are not running Craft 5.7+
1374+
if (class_exists(Copy::class)) {
1375+
$actions[] = ['type' => Copy::class];
1376+
}
1377+
13731378
return $actions;
13741379
}
13751380

0 commit comments

Comments
 (0)