Umbraco-CMS icon indicating copy to clipboard operation
Umbraco-CMS copied to clipboard

Editing a document type doesn't always save changes

Open matthewcare opened this issue 3 years ago • 2 comments

Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)

10.2.0-preview.60

Bug summary

Without making the title too long, this issue occurs if you remove a group, and make a new group with the same name.

content-bug

Specifics

No response

Steps to reproduce

Delete a group from a document type, and then make a new group with the same name.

Expected result / actual result

Expected: The original properties on the group should be deleted, and the new properties should exist. Actual: The newly added properties aren't saved, and the original group is retained.

matthewcare avatar Sep 03 '22 20:09 matthewcare

Hi there @matthewcare!

Firstly, a big thank you for raising this issue. Every piece of feedback we receive helps us to make Umbraco better.

We really appreciate your patience while we wait for our team to have a look at this but we wanted to let you know that we see this and share with you the plan for what comes next.

  • We'll assess whether this issue relates to something that has already been fixed in a later version of the release that it has been raised for.
  • If it's a bug, is it related to a release that we are actively supporting or is it related to a release that's in the end-of-life or security-only phase?
  • We'll replicate the issue to ensure that the problem is as described.
  • We'll decide whether the behavior is an issue or if the behavior is intended.

We wish we could work with everyone directly and assess your issue immediately but we're in the fortunate position of having lots of contributions to work with and only a few humans who are able to do it. We are making progress though and in the meantime, we will keep you in the loop and let you know when we have any questions.

Thanks, from your friendly Umbraco GitHub bot :robot: :slightly_smiling_face:

github-actions[bot] avatar Sep 03 '22 20:09 github-actions[bot]

Hi @matthewcare,

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 :-)

github-actions[bot] avatar Sep 07 '22 13:09 github-actions[bot]

I've had a quick test and I've found a potential cause. If you look in the ContentTypeRepositoryBase.cs on line 436, it does a check if (entity.IsPropertyDirty("PropertyGroups")). This check turns out false in this case, while it probably should be true. I'd like to investigate this further and try to make a fix.

D-Inventor avatar Oct 05 '22 15:10 D-Inventor

Upon further inspection, I think the issue is in ContentTypeMapDefinition.cs around line 699. The target property groups and destGroups are clearly different, but the equality comparer only compares on alias and id and not on the containing properties. I'm not 100% sure yet what's wrong here, because I would expect if this was the error, then simply adding new properties to an existing group also wouldn't work, but that clearly does work. I'll keep investigating.

D-Inventor avatar Oct 05 '22 19:10 D-Inventor