perspeqtive / sulu-bulk-move-bundle
Moves all children of one structure element to another
Package info
github.com/perspeqtive/sulu-bulk-move-bundle
Type:sulu-bundle
pkg:composer/perspeqtive/sulu-bulk-move-bundle
Requires
- php: ^8.2
- sulu/messenger: ^0.2 || ^1.0
- sulu/sulu: ^3.0
- symfony/console: ^6.4 || ^7.1 || ^8.0
- symfony/dependency-injection: ^6.4 || ^7.1 || ^8.0
- symfony/event-dispatcher: ^6.4 || ^7.1 || ^8.0
- symfony/http-kernel: ^6.4 || ^7.1 || ^8.0
- symfony/messenger: ^6.4 || ^7.1 || ^8.0
Requires (Dev)
- php-cs-fixer/shim: ^3.75
- phpstan/phpstan: ^2.1
- phpstan/phpstan-phpunit: ^2.0
- phpstan/phpstan-symfony: ^2.0
- phpunit/phpunit: ^11
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-09-16 18:15:37 UTC
README
The Sulu Bulk Move Bundle moves all child pages from one Sulu navigation node to another. Perfect for reorganizing whole parts of your page tree in one command.
๐ Compatibility
| branch | Sulu | releases |
|---|---|---|
main |
^3.0 |
current and newer |
2.6-compat |
^2.6 |
0.5.x |
There is nothing to configure: composer require perspeqtive/sulu-bulk-move-bundle resolves to the
releases of the 2.6-compat branch in a Sulu 2.6 project and to the main releases in a Sulu 3
project, because each branch constrains sulu/sulu accordingly.
๐ ๏ธ Installation
Install the bundle via composer:
composer require perspeqtive/sulu-bulk-move-bundle
Enable the bundle
Add the bundle to your config/bundles.php:
return [ // ... PERSPEQTIVE\SuluBulkMoveBundle\SuluBulkMoveBundle::class => ['all' => true], ];
Sulu\Page\Infrastructure\Symfony\HttpKernel\SuluPageBundle must be enabled as well โ this bundle
uses its page repository and message handlers.
Usage
Run the bulk move via Symfony command:
bin/console perspeqtive:sulu:bulk-move <source-uuid> <target-uuid> <locale>
| parameter | description |
|---|---|
| source-uuid | UUID of the parent page whose children you want to move |
| target-uuid | UUID of the target parent page |
| locale | The page locale (e.g. de, en) |
Example:
bin/console perspeqtive:sulu:bulk-move 123e4567-e89b-12d3-a456-426614174000 123e4567-e89b-12d3-a456-426614174999 de
โ๏ธ How it works
The bundle reads the children of the source page from Sulu's page repository and then dispatches one
Sulu\Page\Application\Message\MovePageMessage per child on the sulu_message_bus โ exactly the
way Sulu's own admin API moves a page. Going through the message bus instead of writing to the
entities means Sulu does all the follow-up work for you:
- the routes of the moved page and all of its descendants are re-anchored under the new parent, including the route history,
- an entry is written to the activity log,
- a
Sulu\Page\Domain\Event\PageMovedEventis dispatched, which the command listens to in order to print one line per moved page.
The Sulu 3 page tree itself is not localized, so a page is moved for all locales at once. The
locale argument only selects the language used to resolve the page titles of the dispatched
PageMovedEvent โ and therefore the titles shown in the command output and in the activity log.
Since all of the Sulu API is confined to src/Adapter/Sulu/, BulkMover itself only depends on the
PageChildrenProviderInterface and PageMoverInterface ports.
๐งช Development
ddev composer install ddev exec vendor/bin/phpunit ddev exec vendor/bin/phpstan ddev exec vendor/bin/php-cs-fixer fix
๐ฉโ๐ณ Contribution
Please feel free to fork and extend existing or add new features and send a pull request with your changes! To establish a consistent code quality, please provide unit tests for all your changes and adapt the documentation.