diff --git a/core/permissions.php b/core/permissions.php index aedf3a5c..0cf1d9c4 100644 --- a/core/permissions.php +++ b/core/permissions.php @@ -118,5 +118,5 @@ abstract class Permissions public const BULK_IMPORT = "bulk_import"; public const BULK_EXPORT = "bulk_export"; public const BULK_DOWNLOAD = "bulk_download"; - public const BULK_PARENT_CHILD = "bulk_parent_child"; + public const BULK_PARENT_CHILD = "bulk_parent_child"; } diff --git a/core/userclass.php b/core/userclass.php index 5e66256c..22d2f698 100644 --- a/core/userclass.php +++ b/core/userclass.php @@ -223,7 +223,7 @@ new UserClass("admin", "base", [ Permissions::BULK_IMPORT =>true, Permissions::BULK_EXPORT =>true, Permissions::BULK_DOWNLOAD => true, - Permissions::BULK_PARENT_CHILD => true, + Permissions::BULK_PARENT_CHILD => true, Permissions::SET_PRIVATE_IMAGE => true, Permissions::SET_OTHERS_PRIVATE_IMAGES => true, diff --git a/ext/bulk_parent_child/main.php b/ext/bulk_parent_child/main.php index 296c9af8..b7eda773 100644 --- a/ext/bulk_parent_child/main.php +++ b/ext/bulk_parent_child/main.php @@ -27,15 +27,15 @@ class BulkParentChild extends Extension public function onBulkAction(BulkActionEvent $event) { global $user, $page, $config; - if ($user->can(Permissions::BULK_PARENT_CHILD)&& + if ($user->can(Permissions::BULK_PARENT_CHILD)&& ($event->action == BulkParentChild::PARENT_CHILD_ACTION_NAME)) { - $prev_id = null; - foreach ($event->items as $image) { - if ($prev_id != null) { - send_event(new ImageRelationshipSetEvent($image->id, $prev_id)); - } - $prev_id = $image->id; - } - } + $prev_id = null; + foreach ($event->items as $image) { + if ($prev_id != null) { + send_event(new ImageRelationshipSetEvent($image->id, $prev_id)); + } + $prev_id = $image->id; + } + } } }