Problem/Motivation

When I import a config with new items or title change for exemple, the modification are done correctly in Drupal. But when I remove some items from the config, thoses items are not removed from the menu in Drupal when I import.

Comments

redzeuf created an issue. See original summary.

redzeuf’s picture

Issue summary: View changes
hardikpandya’s picture

Priority: Normal » Major

subscribe

sershevchyk’s picture

I had the same problem with the project. After investigation, I found duplicates in the database, and next update code help me:

function hook_update_9001() {
  $query = \Drupal::database()->delete('menu_link_content_data');
  $query->execute();

  $splitFiles = [
    'menu_export.export_data',
  ];

  $config_path = realpath('../config/sync');
  $source = new FileStorage($config_path);
  $config_storage = \Drupal::service('config.storage');

  foreach ($splitFiles as $splitFile) {
    $config_storage->write($splitFile, $source->read($splitFile));
  }
}
delalis’s picture

same issue for me. new Menu items added manually do not get removed when re-importing the menu. Anyone have a patch?

In the mean time, Im reading that you could add this update hook to a custom module and just run drush updb, hopefully that works

https://www.drupal.org/project/menu_export/issues/3109214#comment-14340438