From 18e5e4bbee3336502db7ae7ec24de702f9a2720d Mon Sep 17 00:00:00 2001 From: Brad Embree Date: Sun, 10 Mar 2024 15:32:22 -0700 Subject: [PATCH] Check $DECODED_ARGS for ReverseTxns URL parameter Various pages that show the reverse history order option do not actually respect the ReverseTxns parameter when passed in. Updating ShowHistoryHeader and ShowHistoryPage to check for ReverseTxns in DECODED_ARGS fixes these pages without having to fix them all individually. --- share/html/Elements/ShowHistoryHeader | 2 +- share/html/Elements/ShowHistoryPage | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/share/html/Elements/ShowHistoryHeader b/share/html/Elements/ShowHistoryHeader index 4d99cd3d90a..4cb425fcf60 100644 --- a/share/html/Elements/ShowHistoryHeader +++ b/share/html/Elements/ShowHistoryHeader @@ -58,7 +58,7 @@ $Title => loc('History') my $record_type = $Object->RecordType; my $histid = "\L$record_type\E-" . $Object->id . "-history"; -my $reverse_txns = $ARGS{'ReverseTxns'}; +my $reverse_txns = $ARGS{'ReverseTxns'} || $DECODED_ARGS->{ReverseTxns}; if ( $reverse_txns ) { # If we got something, reverse it for the link $reverse_txns = $reverse_txns eq 'ASC' ? 'DESC' : 'ASC'; diff --git a/share/html/Elements/ShowHistoryPage b/share/html/Elements/ShowHistoryPage index f6aa296e872..37c2f0ef1f0 100644 --- a/share/html/Elements/ShowHistoryPage +++ b/share/html/Elements/ShowHistoryPage @@ -59,6 +59,7 @@ $PathPrefix => '' my $trans_content = {}; my $trans_attachments = {}; +$ARGS{'ReverseTxns'} ||= $DECODED_ARGS->{ReverseTxns}; if ( $ARGS{'ReverseTxns'} ) { $Transactions = $Object->SortedTransactions($ARGS{'ReverseTxns'}); }