Steps to reproduce
- Open the Attachments tab of a page
- Upload several files at once (or have someone else add an attachment to the page) so that an attachment is saved while the attachments table is being refreshed
Expected The attachments table lists the attachments correctly and nothing is logged. Actual The refresh of the attachments table can return a broken row (empty file name, size, date, author, actions), and the following errors are logged:
Cause flamingo/attachmentsjson.vm lists the attachments of the page with a query on the database, then builds each row from $doc.getAttachment($attachmentReference.name), $doc being the document loaded at the beginning of the request. An attachment saved in between is returned by the query but not found in $doc, so the row is built from a null attachment, and #dynamicsize (from macros.vm) is called with a null size. This is visible on CI with LightboxIT#playSlideshow (image-lightbox functional tests), which uploads two images in a row through the attachments pane. |