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

v8: Rollback clear image cropper and grid #5791

Closed
bjarnef opened this issue Jul 4, 2019 · 4 comments · Fixed by #5792
Closed

v8: Rollback clear image cropper and grid #5791

bjarnef opened this issue Jul 4, 2019 · 4 comments · Fixed by #5792

Comments

@bjarnef
Copy link
Contributor

bjarnef commented Jul 4, 2019

In Umbraco v8 with latest changes in v8/dev branch, when I select rollback and select an older version, but without clicking submit button (rollback), but just close the dialog and go back to the content tab the image cropper and grid no longer shows any values.

But when I refresh the page the values image cropper image and grid data are shown.

2019-07-04_22-18-07

@PerplexDaniel
Copy link
Contributor

Yes, excellent @bjarnef! I was about to make a new issue and PR with essentially the same but thought "let's see if someone else already did this" ;-)

This applies to all property editors that have their value stored as JSON, so it's quite a big deal.
It it still present in 8.6.1 and the latest v8/contrib.

@nul800sebastiaan Can we please merge the linked PR into v8 soon-ish? Mainly it's about this commit which does an angular.copy of the original property. There are 4 other commits in there with useful stuff but the core bug is fixed by just doing an angular.copy, which therefore could also be cherry-picked instead.

Full commit of @bjarnef with the fix is below (just to show it's tiny):

// copy existing properties, so it doesn't manipulate existing properties on page
oldProperty = angular.copy(oldProperty);
property = angular.copy(property);

Considering #7950 we would just have to change that to Utilities.copy instead and we're good to go.

@bjarnef
Copy link
Contributor Author

bjarnef commented May 13, 2020

Oh, it has been a while since I submitted that PR.. almost forgot about it 🙈

It seems Utilities.copy still use angular.copy() under the hood, but sure it would be great to use the utility function here instead.
https://github.com/umbraco/Umbraco-CMS/blob/v8/contrib/src/Umbraco.Web.UI.Client/src/utilities.js#L21

@nul800sebastiaan
Copy link
Member

Fixed in #5792

@nul800sebastiaan
Copy link
Member

Ah forgot to update to Utilities.copy - done in 9be4775

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

Successfully merging a pull request may close this issue.

3 participants