From ab18bbcde5dee36010161202b67ce1389c60b7a1 Mon Sep 17 00:00:00 2001 From: Sho Uemura Date: Fri, 9 Jun 2017 20:54:30 -0500 Subject: [PATCH 1/3] use array instead of hash for radio button group On any of the administration pages with new/delete/modify radio buttons (e.g. AdministerForm), our DocDB installation (DocDB 8.8.6) orders the radio buttons randomly. I don't think this can be intended behavior, and AuthorAdminDisable.js expects a consistent ordering of [new, delete, modify]. I think this is a bug in the AdministerActions method of AdministerElements.pm, which exists in trunk as well as in 8.8.6. The button names are stored in a hash when an array is appropriate. This commit fixes the bug. --- DocDB/cgi/AdministerElements.pm | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/DocDB/cgi/AdministerElements.pm b/DocDB/cgi/AdministerElements.pm index 4e34e59e..552d041d 100644 --- a/DocDB/cgi/AdministerElements.pm +++ b/DocDB/cgi/AdministerElements.pm @@ -32,17 +32,14 @@ sub AdministerActions (%) { my $Form = $Params{-form} || ""; my $AddTransfer = $Params{-addTransfer} || $FALSE; - my %Action = (); + my @Action = ('New', 'Delete', 'Modify'); - $Action{Delete} = "Delete"; - $Action{New} = "New"; - $Action{Modify} = "Modify"; if ($AddTransfer) { $Action{Transfer} = "Transfer"; } print FormElementTitle(-helplink => "admaction", -helptext => "Action"); print $query -> radio_group(-name => "admaction", - -values => \%Action, -default => "-", + -values => \@Action, -default => "-", -onclick => "disabler_$Form();"); }; From bec122cda36070da445eb8be19e17406a41abe71 Mon Sep 17 00:00:00 2001 From: "Marc W. Mengel" Date: Mon, 27 Nov 2023 14:01:55 -0600 Subject: [PATCH 2/3] change from upstream #13 --- DocDB/cgi/AdministerElements.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DocDB/cgi/AdministerElements.pm b/DocDB/cgi/AdministerElements.pm index 552d041d..3a8c19d8 100644 --- a/DocDB/cgi/AdministerElements.pm +++ b/DocDB/cgi/AdministerElements.pm @@ -35,7 +35,7 @@ sub AdministerActions (%) { my @Action = ('New', 'Delete', 'Modify'); if ($AddTransfer) { - $Action{Transfer} = "Transfer"; + unshift( @Action, "Transfer" ); } print FormElementTitle(-helplink => "admaction", -helptext => "Action"); print $query -> radio_group(-name => "admaction", From 0e8648c3235acecf667af5291e5fd8839233bbc8 Mon Sep 17 00:00:00 2001 From: Sho Uemura Date: Wed, 6 Mar 2024 15:05:39 -0600 Subject: [PATCH 3/3] use push instead of unshift --- DocDB/cgi/AdministerElements.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DocDB/cgi/AdministerElements.pm b/DocDB/cgi/AdministerElements.pm index 3a8c19d8..7149a793 100644 --- a/DocDB/cgi/AdministerElements.pm +++ b/DocDB/cgi/AdministerElements.pm @@ -35,7 +35,7 @@ sub AdministerActions (%) { my @Action = ('New', 'Delete', 'Modify'); if ($AddTransfer) { - unshift( @Action, "Transfer" ); + push( @Action, "Transfer" ); } print FormElementTitle(-helplink => "admaction", -helptext => "Action"); print $query -> radio_group(-name => "admaction",