Edit this page |
Blame
Brittle Fix for Editing Metadata
Tags
-
type: bug
-
priority: high
-
assigned: fredm, zachs, bonz
-
keywords: metadata, editing
-
status: open
Description
for the bug where values that were not changed were being deleted/removed works, but feels a tad brittle.
Current Process
There is some javascript code that
when they are focussed and then blurred, whether or not there was an actual change.
On submitting, there is more javascript code that
before submitting the values.
There is still more javascript code that, in the paraphrased words of the original author,
----
The problem with the javascript code above is that it is hacky and the solutions are brittle. For example
-
marking the field as changed on blur rather than actually comparing the values
-
not submitting original values making it impossible to compare values on backend
-
detecting changes by setting a flag: the user can very easily restore the value to original before submitting, making the set flag indicate the wrong thing
Possible Fix
I think, in general, we need to instead set the values based on comparisons:
-
Submit both the old values and new values
-
Compare old value and new value
-
If different, add field/key to "update list"
-
If not, don't add the field/key at all
-
Use final "update list" to build the dictionary or data object to use for the update