Problem/Motivation

Currently, the module only allows exporting menu items for the custom menus which is inconvenient. Since menu items are considered as a content, it would be great to allow exporting custom menus with all there items at once.

CommentFileSizeAuthor
#4 export_mode.png21.28 KBnginex
#4 new_action.png19.5 KBnginex
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

alfattal created an issue. See original summary.

nginex’s picture

Assigned: Unassigned » nginex
Priority: Major » Normal

I will provide a patch, stay tuned

nginex’s picture

Assigned: nginex » Unassigned
Status: Active » Needs review
StatusFileSize
new19.5 KB
new21.28 KB

New action is in place when you go to menu links overview of specific menu

Example

demo

You can also choose a different export mode when exporting whole menu.

export mode

alfattal’s picture

Status: Needs review » Needs work

@nginex Patch failed to apply. Here is the full trace:

composer install -vvv
Running 2.9.2 (2025-11-19 21:57:25) with PHP 8.2.28 on Linux / 6.8.0-117-generic
Reading ./composer.json (/home/ffattal/mndor/composer.json)
Loading config file ./composer.json (/home/ffattal/mndor/composer.json)
Checked CA file /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem does not exist or it is not a file.
Checked directory /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem does not exist or it is not a directory.
Checked CA file /etc/pki/tls/certs/ca-bundle.crt does not exist or it is not a file.
Checked directory /etc/pki/tls/certs/ca-bundle.crt does not exist or it is not a directory.
Checked CA file /etc/ssl/certs/ca-certificates.crt: valid
Executing command (/home/ffattal/mndor): 'git' 'branch' '-a' '--no-color' '--no-abbrev' '-v'
Failed to initialize global composer: Composer could not find the config file: /home/ffattal/.config/composer/composer.json

Reading /home/ffattal/mndor/vendor/composer/installed.json
Loading plugin Composer\Installers\Plugin (from composer/installers)
Loading plugin PHPCSStandards\Composer\Plugin\Installers\PHPCodeSniffer\Plugin (from dealerdirect/phpcodesniffer-composer-installer)
Loading plugin Http\Discovery\Composer\Plugin (from php-http/discovery)
Loading plugin Acquia\Drupal\RecommendedSettings\Plugin (from acquia/drupal-recommended-settings)
Loading plugin cweagans\Composer\Patches (from cweagans/composer-patches)
Loading plugin Drupal\Composer\Plugin\Scaffold\Plugin (from drupal/core-composer-scaffold)
Loading plugin Drupal\Composer\Plugin\ProjectMessage\MessagePlugin (from drupal/core-project-message)
Loading plugin OomphInc\ComposerInstallersExtender\Plugin (from oomphinc/composer-installers-extender)
Loading plugin GrumPHP\Composer\GrumPHPPlugin (from phpro/grumphp)
Loading plugin Wikimedia\Composer\Merge\V2\MergePlugin (from wikimedia/composer-merge-plugin)
> init: Wikimedia\Composer\Merge\V2\MergePlugin->onInit
  [merge-plugin] Loading docroot/modules/contrib/anchor_link/composer.libraries.json...
  [merge-plugin] Adding vardot/ckeditor5-anchor-drupal
  [merge-plugin] Loading docroot/modules/contrib/js_cookie/composer.libraries.json...
  [merge-plugin] Prepending package repository
  [merge-plugin] Adding js-cookie/js-cookie
Reading ./composer.lock (/home/ffattal/mndor/composer.lock)
> command: Drupal\Composer\Plugin\Scaffold\Plugin->onCommand
> pre-install-cmd: Wikimedia\Composer\Merge\V2\MergePlugin->onInstallUpdateOrDump
  [merge-plugin] Loading -dev sections of docroot/modules/contrib/anchor_link/composer.libraries.json...
  [merge-plugin] Loading -dev sections of docroot/modules/contrib/js_cookie/composer.libraries.json...
> pre-install-cmd: cweagans\Composer\Patches->checkPatches
Gathering patches for root package.
Removing package drupal/single_content_sync so that it can be re-installed and re-patched.
  - Removing drupal/single_content_sync (1.4.14)
Executing async command (CWD): 'rm' '-rf' 'docroot/modules/contrib/single_content_sync'
Deleting docroot/modules/contrib/single_content_sync - deleted
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Reading ./composer.lock (/home/ffattal/mndor/composer.lock)
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. It is recommended that you run `composer update` or `composer update <package name>`.
Built pool.
Generating rules
Resolving dependencies through SAT
Looking at all rules.

Dependency resolution completed in 0.001 seconds
Package operations: 1 install, 0 updates, 0 removals
Installs: drupal/single_content_sync:1.4.14
Reading /home/ffattal/.cache/composer/files/drupal/single_content_sync/c50940a8b0680b16ab22f2f95b6edd9a0e878f88.zip from cache
  - Loading drupal/single_content_sync (1.4.14) from cache
> pre-package-install: cweagans\Composer\Patches->gatherPatches
Gathering patches for root package.
Gathering patches for dependencies. This might take a minute.
Found 8 patches for drupal/core.
Found 1 patches for ckeditor/liststyle.
Found 2 patches for drupal/site_alert.
Found 1 patches for drupal/block_content_permissions.
Found 1 patches for drupal/conditional_fields.
Found 1 patches for drupal/scheduled_transitions.
Found 1 patches for drupal/panelizer.
Found 1 patches for drupal/panels.
Found 1 patches for drupal/webform_encrypt.
Found 1 patches for drupal/smtp.
Found 1 patches for drupal/webform_jqueryui_datepicker.
Found 1 patches for drupal/yoast_seo.
Found 2 patches for drupal/entity_diff_ui.
Found 1 patches for drupal/cshs.
Found 1 patches for drupal/single_content_sync.
> pre-package-install: GrumPHP\Composer\GrumPHPPlugin->detectGrumphpAction
  - Installing drupal/single_content_sync (1.4.14): Extracting archive
Executing async command (CWD): '/usr/bin/unzip' '-qq' '/home/ffattal/mndor/vendor/composer/tmp-56d6717c6c4789cde34f8b1be54c7ca5.zip' '-d' '/home/ffattal/mndor/vendor/composer/88c5f766'
Executing async command (CWD): 'rm' '-rf' '/home/ffattal/mndor/vendor/composer/88c5f766'
> post-package-install: Wikimedia\Composer\Merge\V2\MergePlugin->onPostPackageInstall
> post-package-install: cweagans\Composer\Patches->postInstall
  - Applying patches for drupal/single_content_sync
    patches/3589975.patch (3589975: Allow exporting custom menus as a whole)
patch '-p1' --no-backup-if-mismatch -d 'docroot/modules/contrib/single_content_sync' < '/home/ffattal/mndor/patches/3589975.patch'
Executing command (CWD): patch '-p1' --no-backup-if-mismatch -d 'docroot/modules/contrib/single_content_sync' < '/home/ffattal/mndor/patches/3589975.patch'
patching file single_content_sync.services.yml

Hunk #1 FAILED at 77.

1 out of 1 hunk FAILED -- saving rejects to file single_content_sync.services.yml.rej

patching file src/EventSubscriber/MenuBulkExportRoutesSubscriber.php

can't find file to patch at input line 56
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------

|diff --git a/src/Form/ContentBulkExportForm.php b/src/Form/ContentBulkExportForm.php
|index 05baee4c8ade03fd2c2c879fe4b9badd6c1e1dd7..8e81be35336436499ed42fb2487a8716cfb2c990 100644
|--- a/src/Form/ContentBulkExportForm.php
|+++ b/src/Form/ContentBulkExportForm.php
--------------------------
File to patch: 
Skip this patch? [y] 
Skipping patch.

7 out of 7 hunks ignored

can't find file to patch at input line 204
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/src/Plugin/Menu/LocalAction/ContentBulkExportLocalAction.php b/src/Plugin/Menu/LocalAction/ContentBulkExportLocalAction.php
|index 67264f1131e1fe5c91871fdef577c015a39c833a..b4aec4a0cc1b401f8810c5ef26c4605ecfc34761 100644
|--- a/src/Plugin/Menu/LocalAction/ContentBulkExportLocalAction.php
|+++ b/src/Plugin/Menu/LocalAction/ContentBulkExportLocalAction.php
--------------------------
File to patch: 
Skip this patch? [y] 
Skipping patch.

2 out of 2 hunks ignored

patching file src/Plugin/SingleContentSyncBaseFieldsProcessor/MenuLinkContent.php

patching file src/Utility/CommandHelper.php

patch unexpectedly ends in middle of line

patch '-p0' --no-backup-if-mismatch -d 'docroot/modules/contrib/single_content_sync' < '/home/ffattal/mndor/patches/3589975.patch'
Executing command (CWD): patch '-p0' --no-backup-if-mismatch -d 'docroot/modules/contrib/single_content_sync' < '/home/ffattal/mndor/patches/3589975.patch'
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/single_content_sync.services.yml b/single_content_sync.services.yml
|index 07a86f8d47537ef47e60b3ef0adbd6f37e812263..4e209c4e1447f4b91f9d4cf59f64e0d67ea5092d 100644
|--- a/single_content_sync.services.yml
|+++ b/single_content_sync.services.yml
--------------------------
File to patch: 
Skip this patch? [y] 
Skipping patch.
1 out of 1 hunk ignored
patching file b/src/EventSubscriber/MenuBulkExportRoutesSubscriber.php
can't find file to patch at input line 56
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/src/Form/ContentBulkExportForm.php b/src/Form/ContentBulkExportForm.php
|index 05baee4c8ade03fd2c2c879fe4b9badd6c1e1dd7..8e81be35336436499ed42fb2487a8716cfb2c990 100644
|--- a/src/Form/ContentBulkExportForm.php
|+++ b/src/Form/ContentBulkExportForm.php
--------------------------
File to patch: 
Skip this patch? [y] 
Skipping patch.
7 out of 7 hunks ignored
can't find file to patch at input line 204
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/src/Plugin/Menu/LocalAction/ContentBulkExportLocalAction.php b/src/Plugin/Menu/LocalAction/ContentBulkExportLocalAction.php
|index 67264f1131e1fe5c91871fdef577c015a39c833a..b4aec4a0cc1b401f8810c5ef26c4605ecfc34761 100644
|--- a/src/Plugin/Menu/LocalAction/ContentBulkExportLocalAction.php
|+++ b/src/Plugin/Menu/LocalAction/ContentBulkExportLocalAction.php
--------------------------
File to patch: 
Skip this patch? [y] 
Skipping patch.
2 out of 2 hunks ignored
can't find file to patch at input line 244
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/src/Plugin/SingleContentSyncBaseFieldsProcessor/MenuLinkContent.php b/src/Plugin/SingleContentSyncBaseFieldsProcessor/MenuLinkContent.php
|index cb560e249019a1fdb6cc67ad7edaae8e15b37545..bd5ba04d13e4ab480d1aa81325a23e36e3dc913c 100644
|--- a/src/Plugin/SingleContentSyncBaseFieldsProcessor/MenuLinkContent.php
|+++ b/src/Plugin/SingleContentSyncBaseFieldsProcessor/MenuLinkContent.php
--------------------------
File to patch: 
Skip this patch? [y] 
Skipping patch.
2 out of 2 hunks ignored
can't find file to patch at input line 295
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/src/Utility/CommandHelper.php b/src/Utility/CommandHelper.php
|index 6496c1f804c2f3adc57577d02aa04499edaf2286..2934270676c1c0a7c88955f37d20382499d6f7d5 100644
|--- a/src/Utility/CommandHelper.php
|+++ b/src/Utility/CommandHelper.php
--------------------------
File to patch: 
Skip this patch? [y] 
Skipping patch.
3 out of 3 hunks ignored
patch unexpectedly ends in middle of line

patch '-p2' --no-backup-if-mismatch -d 'docroot/modules/contrib/single_content_sync' < '/home/ffattal/mndor/patches/3589975.patch'
Executing command (CWD): patch '-p2' --no-backup-if-mismatch -d 'docroot/modules/contrib/single_content_sync' < '/home/ffattal/mndor/patches/3589975.patch'
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/single_content_sync.services.yml b/single_content_sync.services.yml
|index 07a86f8d47537ef47e60b3ef0adbd6f37e812263..4e209c4e1447f4b91f9d4cf59f64e0d67ea5092d 100644
|--- a/single_content_sync.services.yml
|+++ b/single_content_sync.services.yml
--------------------------
File to patch: 
Skip this patch? [y] 
Skipping patch.
1 out of 1 hunk ignored
patching file EventSubscriber/MenuBulkExportRoutesSubscriber.php
can't find file to patch at input line 56
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/src/Form/ContentBulkExportForm.php b/src/Form/ContentBulkExportForm.php
|index 05baee4c8ade03fd2c2c879fe4b9badd6c1e1dd7..8e81be35336436499ed42fb2487a8716cfb2c990 100644
|--- a/src/Form/ContentBulkExportForm.php
|+++ b/src/Form/ContentBulkExportForm.php
--------------------------
File to patch: 
Skip this patch? [y] 
Skipping patch.
7 out of 7 hunks ignored
can't find file to patch at input line 204
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/src/Plugin/Menu/LocalAction/ContentBulkExportLocalAction.php b/src/Plugin/Menu/LocalAction/ContentBulkExportLocalAction.php
|index 67264f1131e1fe5c91871fdef577c015a39c833a..b4aec4a0cc1b401f8810c5ef26c4605ecfc34761 100644
|--- a/src/Plugin/Menu/LocalAction/ContentBulkExportLocalAction.php
|+++ b/src/Plugin/Menu/LocalAction/ContentBulkExportLocalAction.php
--------------------------
File to patch: 
Skip this patch? [y] 
Skipping patch.
2 out of 2 hunks ignored
can't find file to patch at input line 244
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/src/Plugin/SingleContentSyncBaseFieldsProcessor/MenuLinkContent.php b/src/Plugin/SingleContentSyncBaseFieldsProcessor/MenuLinkContent.php
|index cb560e249019a1fdb6cc67ad7edaae8e15b37545..bd5ba04d13e4ab480d1aa81325a23e36e3dc913c 100644
|--- a/src/Plugin/SingleContentSyncBaseFieldsProcessor/MenuLinkContent.php
|+++ b/src/Plugin/SingleContentSyncBaseFieldsProcessor/MenuLinkContent.php
--------------------------
File to patch: 
Skip this patch? [y] 
Skipping patch.
2 out of 2 hunks ignored
can't find file to patch at input line 295
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/src/Utility/CommandHelper.php b/src/Utility/CommandHelper.php
|index 6496c1f804c2f3adc57577d02aa04499edaf2286..2934270676c1c0a7c88955f37d20382499d6f7d5 100644
|--- a/src/Utility/CommandHelper.php
|+++ b/src/Utility/CommandHelper.php
--------------------------
File to patch: 
Skip this patch? [y] 
Skipping patch.
3 out of 3 hunks ignored
patch unexpectedly ends in middle of line

patch '-p4' --no-backup-if-mismatch -d 'docroot/modules/contrib/single_content_sync' < '/home/ffattal/mndor/patches/3589975.patch'
Executing command (CWD): patch '-p4' --no-backup-if-mismatch -d 'docroot/modules/contrib/single_content_sync' < '/home/ffattal/mndor/patches/3589975.patch'
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/single_content_sync.services.yml b/single_content_sync.services.yml
|index 07a86f8d47537ef47e60b3ef0adbd6f37e812263..4e209c4e1447f4b91f9d4cf59f64e0d67ea5092d 100644
|--- a/single_content_sync.services.yml
|+++ b/single_content_sync.services.yml
--------------------------
File to patch: 
Skip this patch? [y] 
Skipping patch.
1 out of 1 hunk ignored
can't find file to patch at input line 19
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/src/EventSubscriber/MenuBulkExportRoutesSubscriber.php b/src/EventSubscriber/MenuBulkExportRoutesSubscriber.php
|new file mode 100644
|index 0000000000000000000000000000000000000000..cf46b218f1a9091db3fdd1c8cf4c957a28021c7d
|--- /dev/null
|+++ b/src/EventSubscriber/MenuBulkExportRoutesSubscriber.php
--------------------------
File to patch: 
Skip this patch? [y] 
Skipping patch.
1 out of 1 hunk ignored
can't find file to patch at input line 56
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/src/Form/ContentBulkExportForm.php b/src/Form/ContentBulkExportForm.php
|index 05baee4c8ade03fd2c2c879fe4b9badd6c1e1dd7..8e81be35336436499ed42fb2487a8716cfb2c990 100644
|--- a/src/Form/ContentBulkExportForm.php
|+++ b/src/Form/ContentBulkExportForm.php
--------------------------
File to patch: 
Skip this patch? [y] 
Skipping patch.
7 out of 7 hunks ignored
can't find file to patch at input line 204
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/src/Plugin/Menu/LocalAction/ContentBulkExportLocalAction.php b/src/Plugin/Menu/LocalAction/ContentBulkExportLocalAction.php
|index 67264f1131e1fe5c91871fdef577c015a39c833a..b4aec4a0cc1b401f8810c5ef26c4605ecfc34761 100644
|--- a/src/Plugin/Menu/LocalAction/ContentBulkExportLocalAction.php
|+++ b/src/Plugin/Menu/LocalAction/ContentBulkExportLocalAction.php
--------------------------
File to patch: 
Skip this patch? [y] 
Skipping patch.
2 out of 2 hunks ignored
can't find file to patch at input line 244
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/src/Plugin/SingleContentSyncBaseFieldsProcessor/MenuLinkContent.php b/src/Plugin/SingleContentSyncBaseFieldsProcessor/MenuLinkContent.php
|index cb560e249019a1fdb6cc67ad7edaae8e15b37545..bd5ba04d13e4ab480d1aa81325a23e36e3dc913c 100644
|--- a/src/Plugin/SingleContentSyncBaseFieldsProcessor/MenuLinkContent.php
|+++ b/src/Plugin/SingleContentSyncBaseFieldsProcessor/MenuLinkContent.php
--------------------------
File to patch: 
Skip this patch? [y] 
Skipping patch.
2 out of 2 hunks ignored
can't find file to patch at input line 295
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/src/Utility/CommandHelper.php b/src/Utility/CommandHelper.php
|index 6496c1f804c2f3adc57577d02aa04499edaf2286..2934270676c1c0a7c88955f37d20382499d6f7d5 100644
|--- a/src/Utility/CommandHelper.php
|+++ b/src/Utility/CommandHelper.php
--------------------------
File to patch: 
Skip this patch? [y] 
Skipping patch.
3 out of 3 hunks ignored
patch unexpectedly ends in middle of line

   Could not apply patch! Skipping. The error was: Cannot apply patch patches/3589975.patch
Downloading https://packages.drupal.org/8/downloads
[200] https://packages.drupal.org/8/downloads

In Patches.php line 331:
                                                                                                
  [Exception]                                                                                   
  Cannot apply patch 3589975: Allow exporting custom menus as a whole (patches/3589975.patch)!  
                                                                                                

Exception trace:
  at /home/ffattal/mndor/vendor/cweagans/composer-patches/src/Patches.php:331
 cweagans\Composer\Patches->postInstall() at phar:///usr/local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:232
 Composer\EventDispatcher\EventDispatcher->doDispatch() at phar:///usr/local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:161
 Composer\EventDispatcher\EventDispatcher->dispatchPackageEvent() at phar:///usr/local/bin/composer/src/Composer/Installer/InstallationManager.php:400
 Composer\Installer\InstallationManager::Composer\Installer\{closure}() at phar:///usr/local/bin/composer/src/Composer/Installer/InstallationManager.php:415
 Composer\Installer\InstallationManager->executeBatch() at phar:///usr/local/bin/composer/src/Composer/Installer/InstallationManager.php:323
 Composer\Installer\InstallationManager->downloadAndExecuteBatch() at phar:///usr/local/bin/composer/src/Composer/Installer/InstallationManager.php:221
 Composer\Installer\InstallationManager->execute() at phar:///usr/local/bin/composer/src/Composer/Installer.php:847
 Composer\Installer->doInstall() at phar:///usr/local/bin/composer/src/Composer/Installer.php:304
 Composer\Installer->run() at phar:///usr/local/bin/composer/src/Composer/Command/InstallCommand.php:143
 Composer\Command\InstallCommand->execute() at phar:///usr/local/bin/composer/vendor/symfony/console/Command/Command.php:298
 Symfony\Component\Console\Command\Command->run() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:1040
 Symfony\Component\Console\Application->doRunCommand() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:301
 Symfony\Component\Console\Application->doRun() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:418
 Composer\Console\Application->doRun() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:171
 Symfony\Component\Console\Application->run() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:138
 Composer\Console\Application->run() at phar:///usr/local/bin/composer/bin/composer:112
 require() at /usr/local/bin/composer:29

install [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--download-only] [--dev] [--no-suggest] [--no-dev] [--no-autoloader] [--no-progress] [--no-install] [--audit] [--audit-format AUDIT-FORMAT] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--] [<packages>...]
nginex’s picture

Status: Needs work » Needs review

Please use latest version of the module 1.4.15

alfattal’s picture

Status: Needs review » Reviewed & tested by the community

@nginex Worked like a charm. Thank you!

  • nginex committed cbe04696 on 1.4.x
    Issue #3589975 Export all links of specific menu
    
nginex’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.