Bug 14621: Messaging preferences table needs to be sorted

I have been working with messaging preferences and I noticed a weird issue in Firefox on Ubuntu.

On messaging preferences page, the table is unsorted and the content in rows are generated randomly
on every page refresh. When you select/deselect checkboxes and refresh the page (without posting the changes),
Firefox will remember your choices. Now the issue is that when the table is unsorted and the rows keep
changing on page refresh, Firefox has trouble remembering your choices. This makes it appear as if the
checkboxes are magically changing values on each page refresh.

Here is a patch that prevents this problem by sorting the messaging settings.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 46ac35f8e1)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
(cherry picked from commit 6c44d1f464)
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
This commit is contained in:
Lari Taskula 2015-07-30 18:34:49 +03:00 committed by Mason James
parent 499bb94087
commit f8472ef26c
1 changed files with 3 additions and 0 deletions

View File

@ -217,6 +217,9 @@ END_SQL
}
my @return = values %$choices;
@return = sort { $a->{message_attribute_id} <=> $b->{message_attribute_id} } @return;
# warn( Data::Dumper->Dump( [ \@return ], [ 'return' ] ) );
return \@return;
}