Skip to content

Commit

Permalink
Check $DECODED_ARGS for ReverseTxns URL parameter
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bkembreeBPS authored and sunnavy committed Mar 26, 2024
1 parent cf34cad commit 18e5e4b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion share/html/Elements/ShowHistoryHeader
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
1 change: 1 addition & 0 deletions share/html/Elements/ShowHistoryPage
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ $PathPrefix => ''
my $trans_content = {};
my $trans_attachments = {};

$ARGS{'ReverseTxns'} ||= $DECODED_ARGS->{ReverseTxns};
if ( $ARGS{'ReverseTxns'} ) {
$Transactions = $Object->SortedTransactions($ARGS{'ReverseTxns'});
}
Expand Down

0 comments on commit 18e5e4b

Please sign in to comment.