Drush command for Export / Import

Created on 22 November 2022, over 1 year ago
Updated 29 October 2023, 8 months ago

Problem/Motivation

When doing automated deployments of a site using this menu_export, it is very annoying to manually need to trigger the import of the menu items from the configuration in the backend. This leads to potential for human error and should be able to be automated.

Proposed resolution

Add a drush command for the export / import triggers, so this command can be included into the CI pipelines for automated import of the menu items.

Remaining tasks

Build drush command.

User interface changes

None

API changes

None

Data model changes

None

✨ Feature request
Status

Needs work

Version

1.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany fisherman90 Dortmund

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡·πŸ‡ΊRussia alexander.levitsky Omsk

    alexander.levitsky β†’ made their first commit to this issue’s fork.

  • @alexanderlevitsky opened merge request.
  • πŸ‡·πŸ‡ΊRussia alexander.levitsky Omsk

    Hi fisherman90,

    Really thank you for your solution, but let's keep the only drush command in the scope of this issue, without any code style fixes, because it conflicts with other patches.

    I have prepared another PR with your drush command only.

    Btw, it works perfectly for me as well.

  • πŸ‡¨πŸ‡¦Canada liquidcms

    I guess since i dont see UUIDs in the export yml this cant be used to sync existing menus, only to create new ones?

    also, a bit unclear the what this adds with these new commands. The README already stated that the std CEX/CIM works for this. I think CEX sort of works and CIM doesn't.

    I tried the menu_export:import and i get:

    SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '231' for key 'menu_link_content__revisio
    n_id'

    i assume as my menu already exists and i am just trying to update it.

  • πŸ‡©πŸ‡°Denmark ressa Copenhagen

    I can't see why a Drush export command is needed? I just installed the module, added a menu, ran drush config:export, and the menu was exported in a yml file, as expected. I did not need to click the "export" button.

    So I just posted this comment πŸ“Œ Step by Step Instructions Here (I Think) Active , assuming that since drush config:export includes the yml-files without any further steps, I assumed that "drush config:import" would import the menu links ...

    So do you need to manually click "import", but don't need to manually click "export"?

  • Status changed to Needs work 8 months ago
  • πŸ‡©πŸ‡°Denmark ressa Copenhagen

    It does look like the menus are not imported, and you actively need to click the "Import menu links" button. The patch needs a re-roll, so changing Status.

Production build 0.69.0 2024