Search by

perspeqtive / sulu-bulk-move-bundle

MarkusHolstein

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

Statistics

Installs: 596

Dependents: 0

Suggesters: 0

Stars: 5

Open Issues: 0

3.0.0 2026-09-16 18:12 UTC

This package is auto-updated.

Last update: 2026-09-16 18:15:37 UTC


README

Packagist Version Static Badge

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\PageMovedEvent is 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.