You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Improve logic to restore changes on the share object when cancelling the edition in SharingDetailsTab #63756
While reviewing the backport of #63227, I had a thought: could we snapshot and restore share.attributes, as we already do for permissions? Restoring only hasDownloadPermission may add an attribute that did not previously exist (its setter calls setAttribute()) and misses others such as config/grid_view.
Alternatively, could we keep a single snapshot of all editor-owned share properties and restore it on cancel, rather than maintaining separate initial* fields? That would make future editable properties less likely to be missed.
Additional comment by @danxuliu:
What I originally tried to implement was copying the provided share object, working with the copy in the SharingDetailsTab view and, then, once it was successfully saved, "commit" the changes back to the original share object (or maybe even replace it).
Unfortunately I did not manage to do that and went the easy (and problematic) way, but it could be an alternative implementation to the above.
Activity