Skip to content

Attachments are not sorted by ordinal #8010

@grantfitzsimmons

Description

@grantfitzsimmons

Describe the bug
Currently, attachments are ordered by the attachment ID (e.g. CollectionObjectAttachmentID), in ascending order. This is not configurable via the form meta menu either. This makes it so the only option to reorder attachments is to update the ID behind-the-scenes or for the user to delete and reupload an attachment.

To Reproduce
Steps to reproduce the behavior:

  1. Add 3 attachments
  2. Update the ordinal value to change the order
  3. See that the ordinal is not respected

Happens in both v7.11.4 and v7.12.0.4

Expected behavior
The attachments should be organized by ordinal (as it was in Specify 6).

Screenshots

Image
SELECT
  coa.CollectionObjectAttachmentID,
  coa.TimestampCreated,
  coa.Ordinal,
  a.origFilename
FROM collectionobjectattachment AS coa
LEFT JOIN attachment AS a
  ON a.AttachmentID = coa.AttachmentID
WHERE coa.CollectionObjectID = 1062
ORDER BY coa.Ordinal;

Reported By
Fedor at NHMD on BoldDesk (#840)

Image Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    2 - AttachmentsIssues that are related to attachments2 - FormsIssues that are related to the form system

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions