Steps to reproduce:

  1. On the Views list page, click the Add new view button
  2. Configure a basic view
  3. Click the Save & edit button
  4. Make a change but don't save the view
  5. Go back to the Views list page
  6. Delete the view created above
  7. Click the Add new view button
  8. Create a new, different view (like a block instead of a page, or using a different display format) with the same name (actually, with the same machine name)
  9. Click the Save & edit button
  10. You'll be looking at the first view that was deleted

I suspect the initial view is still saved in the object cache and then that is what is being displayed when creating the second view.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pplantinga’s picture

Just tried this and got the expected error:

The machine-readable name is already in use. It must be unique.

oadaeh’s picture

You didn't perform step #6.

pplantinga’s picture

Ah. So I didn't. You're definitely right about this one.

damiankloip’s picture

Status: Active » Needs review
FileSize
1.92 KB
1.05 KB

Yep, this is definitely a problem. Should be pretty easy to fix, we don't inject stuff from the container for configuration entities so I think we have to do something like this. Here is failing test and with fix.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

Perfect

oadaeh’s picture

Yes, the patch does correct the problem.

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 8.x. Thanks.

effulgentsia’s picture

I just noticed in #1901100: Make Edit module work with TempStore, so revisions are not saved on all atomic field edits that in that issue, the 'edit' collection indexes by uuid() rather than id(). Would it make sense to switch Views to do that as well?

damiankloip’s picture

We could, I would be happy either way. The main reason not to is that we upcast the tempstore data in the views UI with a param converter, which obviously uses the view name from the path to do its thing. So on that basis I would say maybe its better how it is? not sure.

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

Anonymous’s picture

Issue summary: View changes

Updated issue summary. Added a missing step.