Fix file attachment revision info with draft updates.
Review Request #14021 — Created July 10, 2024 and submitted — Latest diff uploaded
When a file attachment has an updated revision in a pending draft, that
revision could leak into the page for users not able to see the draft.
If they then moved the revision slider to show the new revision, they'd
get a 404.This change makes it so we check the last attachment in the history to
see if it's a draft, and only include it in the revision list if that
draft should be visible.
- Ran unit tests.
- Created a draft with an updated revision to a file. Saw that the owner
saw two revisions, a regular user saw one, and admins saw either one
or two depending on if they were choosing to view draft data.