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.45k stars 2.68k forks source link

"You have unsaved changes" on media with date picker even though I don't #12617

Closed runegronkjaer closed 1 year ago

runegronkjaer commented 2 years ago

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

9.5.2

Bug summary

We have added some extra properties to a custom media type. To be exact we added a date picker and of course an umbracoFile property. When we create a new one and fill out the properties and then save the "You have unsaved changes" still pops up when leaving the node. It's pretty clear that the date picker is the problem. Just touching it will trigger a change in the UI and that won't be reset when saving.

Specifics

No response

Steps to reproduce

  1. Create Date Picker property on a media type
  2. Create a new node of that type
  3. Touch or change the date picker
  4. Save the media node
  5. Try to leave the node. Should pop up "You have unsaved changes"

Expected result / actual result

When just touching/setting focus in the date picker and then leaving the node, no "You have unsaved changes" pop up should occur. When changing the value of the date picker and saving the node and then leaving the node, no "You have unsaved changes" pop up should occur.

github-actions[bot] commented 2 years ago

Hi @runegronkjaer,

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

Migaroez commented 2 years ago

Reproduction comments Bug happens on media nodes Bug happens on member nodes Bug does not happen on content nodes Bug doesn't always happen when first setting the date Bug never happens when removing the date Bug always happens on date change between saves Bug also happens when just entering the field without changing the date Bug happens with other data fields as well

Confirmed bug exists on 9.5.2 Confirmed bug exists on v10/dev - 78af859 (10.2.0 preview.9)

nul800sebastiaan commented 2 years ago

Thanks for the testing @Migaroez! It sounds like it must be something we at some point fixed in the content views but never in the media/member views.

Looks like something got fixed in v8.0.0 - https://github.com/umbraco/Umbraco-CMS/pull/3788 which might give some inspiration as to where to start debugging. And there's an even older PR for v7 that did something similar: https://github.com/umbraco/Umbraco-CMS/pull/4491

I suspect there's something missing on the scope or whatever is reading the scope that is not setting/removing the dirty flag correctly.

Migaroez commented 2 years ago

Maybe a good candidate to pick up during a thursday colab session. I for one am still very afraid of changing anything in the angular codebase :D

nul800sebastiaan commented 2 years ago

To clarify, we were working on this at UmbraCollab today and Sven got a little excited! ;-)

PR https://github.com/umbraco/Umbraco-CMS/issues/12617

mikecp commented 2 years ago

Reopening the issue because #12721 solves a part of the problem, but not all, e;g. the problem remains when entering and leaving the date field without changing anything.

nul800sebastiaan commented 1 year ago

Fixed for 11.1.0 https://github.com/umbraco/Umbraco-CMS/pull/13262