Closed mhl closed 9 years ago
Looking at the code it seems that it will deal with casting the images _id
fields to a MongoDB ObjectId. So the actual issue here seems to be https://github.com/mysociety/popit/issues/470, which is causing problems when PUTing the images array back again.
The
_id
field in each image inimages
is currently broken (see https://github.com/mysociety/popit/issues/470) in that one can'tPUT
back a version of the images array that contains those"_bsontype": "ObjectID
' IDs - I found that you'll get a "Argument passed in must be a single String of 12 bytes or a string of 24 hex characters" error. I understand from what @chrismytton said that even if you PUT an_id
with the 24 hex character ID, this still wouldn't work currently. If you don't include the_id
then the images array will be updated, but the ID will be lost which creates problems for PopIt hosted images. (@chrismytton did a workaround so now such images don't 404, but other things are still broken, e.g. deleting such images by ID). This basically means that there's currently no way to safely PUT an update toimages
.In user story terms: as a developer, I want to be able to PUT updates to the images array so that I can correct image metadata and reorder the images.