Problem/Motivation
1. install the menu_svg_icon
2. create a new menu
3. export the configuration
4. import the configuration in a new environment
5. change the order of links (optional)
6. save the menu
Expected result is a successfull message.
What happen is this error:
Drupal\Core\Config\ConfigDuplicateUUIDException: Attempt to save a configuration entity 'main-navigation-en' with UUID '' when this entity already exists with UUID 'db2b3f27-8f00-4fbc-ac31-870db710ac72' in Drupal\Core\Config\Entity\ConfigEntityBase->preSave() (line 339 of core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php).
Proposed resolution
On _menu_svg_icons_menu_edit_form_submit is always created a new configuration.
When a configuration entity already exists load it and save a new value, when not exists create it.
Remaining tasks
Write a patch
Comments
Comment #2
ziomizar commentedComment #3
s_leu commentedChange looks good, nice catch.
We should use the static method EntityInterface
::create to create the new entity.
Comment #4
AndersNielsen commentedHi s_leu,
Any chance you could make a patch with the entityInterface::create ? then I'd be happy to put this in the module
Comment #5
ziomizar commentedThis is the patch with the static method entityInterface::create
Comment #7
AndersNielsen commentedFinally got some time. Thank you for the work, pushed to dev.