Steps to reproduce:

  1. Install Drupal
  2. Go to /admin/config/development/configuration/single/export
  3. Select 'Configuration type': 'Entity form display'
  4. Select 'Configuration name': 'node.article.default'
  5. Change 'Configuration type' to 'Entity view display'
  6. Actual result: The configuration for 'core.entity_form_display.node.article.default.yml' remains displayed
  7. Expected result: The configuration for 'core.entity_view_display.node.article.default.yml' should be displayed

Workaround: Change the 'Configuration name' option to anything else, then change it back, which forces the configuration to reload.

Proposed resolution: Force the 'Configuration name' selection to clear whenever the 'Configuration type' option is changed.

Original report
---

8.1.0-rc1

Error:

An entity with this machine name already exists but the UUID does not match.

To reproduce:

1. Perform Single item export (from DEV stage) with:

- Configuration type: Entity form display

- Configuration name: node.book.default

- Copy config into clipboard.

2. Perform Single item import ok with that using copy and paste into 'Entity form display' on PROD stage.

3. Perform Single item export (from DEV stage) with:

- Configuration type: Entity _view_ display

- Configuration name: node.book.default [BUG: stays the same name, but does NOT correspond with a view display, is the old form display]

- BUG: the 'Here is your configuration:' field has also not updated.

- Copy (incorrect) config into clipboard.

4. Attempt import into Entity _view_ display on PROD.

Gives error:

An entity with this machine name already exists but the UUID does not match.

Reason: in this pathological case (only) the configuration is not updating on moving from 'Entity form display' to 'Entity view display', it clearly thinks 'node.book.default' stands for the same thing in both cases, but it doesn't, in one case it's for the default edit form, in the other case it's for the default page view.

WORKAROUND: provoke a change bv selecting configuration name 'node.book.teaser' then go back to 'node.book.default', the configuration YAML snippet now updates correctly and copy-and-paste export/import works.

Comments

webel created an issue. See original summary.

webel’s picture

Priority: Normal » Major

The same problem happens under all sorts of different cases. It happens whenever there is a 'Configuration name' that is (by name string only shared) between 'Configuration types'; when one changes the 'Configuration type' if the 'Configuration name' is the same (by chance) it does not update. you have to provoke the update by switching the 'Configuration name' to something else then back.

Version: 8.1.0-rc1 » 8.1.x-dev

Core issues are now filed against the dev versions where changes will be made. Document the specific release you are using in your issue comment. More information about choosing a version.

Version: 8.1.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Branches prior to 8.8.x are not supported, and Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

pameeela’s picture

Title: Single item: Configuration type change does not update Configuration name config content if same name (case: node.book.default) » Single item: Configuration type change does not update Configuration name config content if one exists with the same name
Issue summary: View changes
Priority: Major » Normal

I have come across this myself but never thought of it as a bug, since it's so easy to get around.

This definitely does not meet the criteria for major so moving to normal (Admin- or developer-facing bugs with a workaround).

pameeela’s picture

Issue tags: +Bug Smash Initiative
alison’s picture

Agree -- super annoying bug, and catches people in traps sometimes! I was just explaining to a colleague how to export things, and fortunately he noticed that the "filename" below the export field hadn't changed.

-------
This issue is a duplicate of #3084436: Config export field should be cleared when config type changes -- not sure which issue to keep, someone else can decide.

For now, I'm just posting the same "YAAASSSS" comment on each issue + mentioning the other 👋

longwave’s picture

Status: Active » Closed (duplicate)

I'm closing this as a duplicate of the other issue, as they are describing the same bug. Usually we keep the older issue, but in this case the other issue already has a working patch attached.