manuxi / sulu-bulk-actions-bundle
Bulk actions (publish, unpublish, delete) for lists in the Sulu admin.
Package info
github.com/manuxi/SuluBulkActionsBundle
Type:symfony-bundle
pkg:composer/manuxi/sulu-bulk-actions-bundle
Requires
- php: ^8.2
- sulu/sulu: ^3.0
- symfony/config: ^6.4 | ^7.0
- symfony/dependency-injection: ^6.4 | ^7.0
- symfony/framework-bundle: ^6.4 | ^7.0
- symfony/http-foundation: ^6.4 | ^7.0
- symfony/http-kernel: ^6.4 | ^7.0
- symfony/messenger: ^6.4 | ^7.0
- symfony/translation: ^6.4 | ^7.0
Requires (Dev)
- phpunit/phpunit: ^10.5 | ^11.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-09-29 14:19:01 UTC
README
Bulk actions for lists in the Sulu admin: mark rows, then publish, unpublish or (optionally) delete them in one go. Articles (all groups), snippets, testimonials and events work out of the box (publish and unpublish); other bundles bring their own handler.
This is the 3.x branch for Sulu 3.0. The main branch is the version for Sulu 2.6.
Installation
composer require manuxi/sulu-bulk-actions-bundle:3.x-dev
- Register the bundle in
config/bundles.php:Manuxi\SuluBulkActionsBundle\SuluBulkActionsBundle::class => ['all' => true] - Import the routes in
config/routes_admin.yaml:SuluBulkActionsBundle: resource: '@SuluBulkActionsBundle/Resources/config/routes_admin.yaml'
- Add the JS to
assets/admin/package.json("sulu-bulk-actions-bundle": "file:../../vendor/manuxi/sulu-bulk-actions-bundle/src/Resources/js") andassets/admin/app.js(import 'sulu-bulk-actions-bundle';), thennpm install --force && npm run build. - Give the "Bulk actions" context to a role (see Permissions).
Permissions
Two levels, so nobody can do in bulk what they may not do one by one:
- Switch: the security context
sulu.bulk_actions.actions("BulkActions" in the role form) decides whether a role may use bulk actions at all. "Live" allows publish and unpublish, "Delete" allows delete (only ifdelete_enabledis on, see below). Nobody has it by default; the project fixture gives it to Admin. - Entries: every entry is checked against the security context of the entry itself, with the same permission
("Live" or "Delete"). For articles that is the context of the article group (
sulu.article.articles_blog, ...), for snippetssulu.snippet.snippets. Entries without permission are skipped and reported. The dropdown only shows the actions the user may use in that list (for example only in the Blog tab if they have the right for Blog).
New article groups need nothing: their contexts already exist in the role form.
Configuration
sulu_bulk_actions: delete_enabled: false # bulk delete is off; turning it on also needs the "Delete" permission resources: # optional; articles and snippets are added by default articles: view_prefixes: ['sulu_article.article.list_'] actions: [publish, unpublish]
Handlers for other resources
Implement Manuxi\SuluBulkActionsBundle\Handler\BulkActionHandlerInterface (it is tagged automatically) and add the
resource to sulu_bulk_actions.resources with the names of its list views:
public function supports(string $resourceKey, string $action): bool { return 'testimonials' === $resourceKey && \in_array($action, ['publish', 'unpublish'], true); } public function handle(string $action, array $ids, string $locale): array { // ... return ['done' => [...ids], 'failed' => [id => message]] }
Endpoint
POST /admin/api/bulk-actions/{resourceKey}/{action}?locale=de with {"ids": ["..."]}. The prefix is deliberately not
/admin/api/{resourceKey}/..., which would collide with the routes of the resources themselves.