Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Existing Property Disappears #11048

Closed
prjseal opened this issue Sep 7, 2021 · 12 comments · Fixed by #11257
Closed

Existing Property Disappears #11048

prjseal opened this issue Sep 7, 2021 · 12 comments · Fixed by #11257
Labels

Comments

@prjseal
Copy link
Contributor

prjseal commented Sep 7, 2021

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
Copy link
Member

Zeegaan commented Sep 8, 2021

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

  • Install the Umbraco Template using dotnet new -i Umbraco.Templates::9.0.0-*
  • Make a project with the Umbraco template: dotnet new umbraco -n MyTestProj
  • Install the starter kit using dotnet add package Umbraco.TheStarterKit --prerelease
  • Build and run the project
  • Navigate to settings and try making a new property with alias "heroHeader"
  • Get validation error, change alias and save

Thanks again for the report! 🐛

@prjseal
Copy link
Contributor Author

prjseal commented Sep 8, 2021

@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
Copy link
Contributor Author

prjseal commented Sep 8, 2021

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

@prjseal
Copy link
Contributor Author

prjseal commented Sep 8, 2021

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

@prjseal
Copy link
Contributor Author

prjseal commented Sep 8, 2021

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

@prjseal
Copy link
Contributor Author

prjseal commented Sep 8, 2021

@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
Copy link
Member

Zeegaan commented Sep 9, 2021

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

  • Opened the Umbraco.Web.Ui.Client folder in a command prompt and ran gulp dev so it would register my client changes
  • Edited umb-groups-builder.html
  • Insterted This ID: {{property.id}} on line 135
    image
  • Launched umbraco and ran the installer
  • Made an empty Document Type with a property "My Test Property"
    image
  • Opened up dev tools in google chrome and searched "ContentEditingHelper.contentEditorPerformSave" to get the right function
  • Set a breakpoint on line 12927
    image
  • Created a new property with the same alias
  • When you step through the function you will see that we find the property with the alias, but no ID
  • We will find a property with the same alias, and assign the new property with the same ID

@prjseal
Copy link
Contributor Author

prjseal commented Sep 15, 2021

@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
Copy link
Member

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
Copy link

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
Copy link
Contributor

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
Copy link
Member

Fixed in 8.18 and 9.1.0 by PR #11257

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants