the batchUpdateMetadataField function is responsible for managing metadata changes (by delegating to updateMetadataField) and propagating those changes back into the model. If you've selected several images and change a field in such a way that one image has no change to be applied, then updateMetadataField will return false for that image ( this communicates "no change" to angular-xeditable - see this comment https://github.com/guardian/grid/blob/51734b8443d1cafd246818eddde4ea3c36e4a86a/kahuna/public/js/edits/service.js#L257-L269 ). This meant that we now tried to replace the image model with false, which is missing all of the expected fields of an image object causing some UI breakage and some very noisy console logs.
we now catch this case, and return the original image unchanged instead of the false
What does this change?
the
batchUpdateMetadataField
function is responsible for managing metadata changes (by delegating toupdateMetadataField
) and propagating those changes back into the model. If you've selected several images and change a field in such a way that one image has no change to be applied, thenupdateMetadataField
will returnfalse
for that image ( this communicates "no change" to angular-xeditable - see this comment https://github.com/guardian/grid/blob/51734b8443d1cafd246818eddde4ea3c36e4a86a/kahuna/public/js/edits/service.js#L257-L269 ). This meant that we now tried to replace the image model withfalse
, which is missing all of the expected fields of an image object causing some UI breakage and some very noisy console logs.we now catch this case, and return the original image unchanged instead of the
false
cc @paperboyo