Skip to content

feat(forms): use ordinal for attachment ordering#8017

Open
grantfitzsimmons wants to merge 2 commits intomainfrom
issue-8010
Open

feat(forms): use ordinal for attachment ordering#8017
grantfitzsimmons wants to merge 2 commits intomainfrom
issue-8010

Conversation

@grantfitzsimmons
Copy link
Copy Markdown
Member

Fixes #8010

This PR orders attachments by ordinal rather than sorting them by ID.

image 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;

Checklist

  • Self-review the PR after opening it to make sure the changes look good and
    self-explanatory (or properly documented)
  • Add automated tests

Testing instructions

  • Find or create an object (e.g. Collection Object, Agent, etc.) with multiple attachments
  • Modify the ordinal field values in the *attachment records to new values so that they are in a different position (e.g. change 0 to 5, 1 to 2, 3 to 1) then save
  • Reload the page
  • Verify that the attachments appear in ascending order based on the ordinal values

@github-project-automation github-project-automation Bot moved this to 📋Back Log in General Tester Board Apr 23, 2026
@grantfitzsimmons grantfitzsimmons added this to the 7.12.2 milestone Apr 23, 2026
@grantfitzsimmons grantfitzsimmons marked this pull request as ready for review April 23, 2026 20:15
@grantfitzsimmons grantfitzsimmons requested review from a team and CarolineDenis April 23, 2026 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 📋Back Log

Development

Successfully merging this pull request may close these issues.

Attachments are not sorted by ordinal

2 participants