umbraco / Umbraco-CMS

Umbraco is a free and open source .NET content management system helping you deliver delightful digital experiences.
https://umbraco.com
MIT License
4.49k stars 2.69k forks source link

Existing Property Disappears #11048

Closed prjseal closed 3 years ago

prjseal commented 3 years ago

Which exact Umbraco version are you using? For example: 8.13.1 - don't just write v8

v9 RC 2

Bug summary

v9 RC 2 with default starter kit installed.

I went to add a new property to the home page, but it had the same alias as an existing property (heroHeader)

When I pressed save it said it can't save because a property already exists with that alias.

I then changed the alias of my new property and pressed save.

This sort of thing happens a lot and doesn't normally cause an issue.

I noticed that the original property has disappeared the page doesn't load on the front end any more, complaining about the missing property Hero Header

Specifics

Please see the bug summary

Steps to reproduce

Please see the bug summary

Expected result / actual result

I expected to get the warning message that i can't save a property with the same alias and nothing bad would happen. I would then rename my new alias and hit save and all be set up correctly.

The original Hero Header property was lost.

Zeegaan commented 3 years ago

Hello there! Thank you for the bug report 🐛

I can't seem to replicate the issue sadly, below I have posted a GIF of me trying to replicate it, can you tell me if I'm doing something wrong ? 🕵️

Animation

Steps I followed

Thanks again for the report! 🐛

prjseal commented 3 years ago

@Zeegaan I was able to replicate it. Try doing it in the same group as the hero header property. Please see the attached gif of me replicating it.

RC2Bug

prjseal commented 3 years ago

@Zeegaan I just tested it in 8.16 and it happens there too 😢

prjseal commented 3 years ago

@Zeegaan I have just tested it in 8.8.4 and it happens there too.

prjseal commented 3 years ago

@Zeegaan as a final test it also happens in 8.0.3 too.

prjseal commented 3 years ago

@Zeegaan Okay Okay I hear you asking for me to test in v7 as well. Sadly it also happens in 7.15.7

I wasn't expecting that at all.

Zeegaan commented 3 years ago

Hi @prjseal, thank you for the thorough investigation, it helped a lot 👏 I have been doing some digging, and I think I have found the issue! 🕵️

It has something to do with how the frontend determines the ID of a given property. When we make a new property with the same alias, the frontend will find the property and try to give it an ID. It will check if there is any properties with the same alias, and if there is, give it the same ID.

Now that the 2 properties have the same ID, they will continue to have the same ID even after we've changed the alias on the new property.

I've passed this on to the front-end team so they can look at it when time is available 💪

My test setup

prjseal commented 3 years ago

@Zeegaan great work in replicating the bug and diagnosing the issue. As it is such a wide reaching bug, I wonder if it will get any priority?

nul800sebastiaan commented 3 years ago

Hi again @prjseal - all great that we've found all this! Since this has been a problem for a long time and you're seemingly one of the first people to encounter it, we'd like to kindly ask you if you would like to help yourself here? When something has been a bug for this long, fixing it usually is pretty far at the bottom of our priority list since (apparently) nobody has encountered it. If you can, it would be great to see a PR for it! Since it's a v8 bug as well, I would say to fix it there, we still merge everything from v8 up top v9.

umbrabot commented 3 years ago

Hi @prjseal,

We're writing to let you know that we would love some help with this issue. We feel that this issue is ideal to flag for a community member to work on it. Once flagged here, folk looking for issues to work on will know to look at yours. Of course, please feel free work on this yourself ;-). If there are any changes to this status, we'll be sure to let you know.

For more information about issues and states, have a look at this blog post

Thanks muchly, from your friendly Umbraco GitHub bot :-)

patrickdemooij9 commented 3 years ago

I really wonder if this is the first time that this has been encountered. I can also reproduce the bug with the groups (as they also get rebound after the save attempt): GroupDeletion

I have a PR coming up for this. Though, I am not sure if it is the best way of doing it. But it does work for the scenarios that I've tested.

nul800sebastiaan commented 3 years ago

Fixed in 8.18 and 9.1.0 by PR https://github.com/umbraco/Umbraco-CMS/pull/11257