#110589Record history creation and deletion lookups return an arbitrary entry
Description
RecordHistory::getCreationInformationForRecord() and RecordHistory::getUserIdFromDeleteActionForRecord() both use setMaxResults(1) without an ORDER BY and without a workspace restriction.
For a record that was deleted, undeleted and deleted again, or that exists in more than one workspace, the returned row is whichever one the DBMS happens to deliver first. These two methods feed the “deleted by” column of the recycler and the “created by” line of the element information modal, so both can show the wrong user.
Expected: order the queries explicitly — the first ACTION_ADD entry and the latest ACTION_DELETE entry — and restrict them to the relevant workspace.
Reviews 2
History 25
-
Gerrit Code Review pushed patch set 1 for main to change 95563 status
NewUnder Review <span data-processor="relativetime" data-value="2026-09-02T13:08:36+00:00" > 09/02/26, 13:08 </span> -
Gerrit Code Review pushed patch set 2 for main to change 95563 <span data-processor="relativetime" data-value="2026-09-02T13:09:16+00:00" > 09/02/26, 13:09 </span>
-
Gerrit Code Review pushed patch set 1 for 14.3 to change 95568 <span data-processor="relativetime" data-value="2026-09-02T14:39:47+00:00" > 09/02/26, 14:39 </span>
-
Benni Mack commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2026-09-02T14:45:08+00:00" > 09/02/26, 14:45 </span> -
Benni Mack changed status
ResolvedClosed <span data-processor="relativetime" data-value="2026-09-08T10:03:19+00:00" > 09/08/26, 10:03 </span>
Applied in changeset commit:46b24200b84a0cd935f579905a4a0c3d1daccb6c.