In suggestions datatable one can sort on colums "Suggested by" or "Managed by". Those columns may contain HTML tags. Use datatable sorting type html to have a correct sorting.
Created attachment 63960 [details] [review] Bug 18728 - use html filter in suggestions datatable sort In suggestions datatable one can sort on colums "Suggested by" or "Managed by". Those columns may contain HTML tags. Use datatable sorting type html to have a correct sorting. Test plan : - Be sure to have some suggestions asked and managed - Go to Acquisitions > Suggestions - Click on "Suggested by" to sort => Table is sorted by the user name - Click on "Managed by" to sort => Table is sorted by the user name
Created attachment 64018 [details] [review] [SIGNED-OFF] Bug 18728 - use html filter in suggestions datatable sort In suggestions datatable one can sort on colums "Suggested by" or "Managed by". Those columns may contain HTML tags. Use datatable sorting type html to have a correct sorting. Test plan : - Be sure to have some suggestions asked and managed - Go to Acquisitions > Suggestions - Click on "Suggested by" to sort => Table is sorted by the user name - Click on "Managed by" to sort => Table is sorted by the user name Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
> Those columns may contain HTML tags. How?
The user name in each column is a link: <td> <a href="mailto:oleonard@example.com">Smith, Dave (0123456)</a> - 09/08/2016 </td> ...so there is definitely HTML, but I don't find that it sorts incorrectly. Are there only certain circumstances which trigger a bug?
(In reply to Owen Leonard from comment #4) > The user name in each column is a link: > > <td> > <a href="mailto:oleonard@example.com">Smith, Dave (0123456)</a> - > 09/08/2016 > </td> > > ...so there is definitely HTML, but I don't find that it sorts incorrectly. > Are there only certain circumstances which trigger a bug? Try with some users without email and some with email : Doe, John Smith, John <a href="mailto:jannesmith@example.com">Smith, Jane</a>
Sounds like it is already correctly sorted without the patch. Asking for another signoff.
I used the following script to generate the data: use Modern::Perl; use t::lib::TestBuilder; my $builder = t::lib::TestBuilder->new; my $type = 'Suggestion'; my $number = 100; if ( $type eq 'Suggestion' ) { for ( 1 .. $number ) { my $managed_by = $builder->build({ source => 'Borrower' }); my $suggested_by = $builder->build({ source => 'Borrower' }); $builder->build({ source => 'Suggestion', value => { STATUS => 'pending', managedby => $managed_by->{borrowernumber}, suggestedby => $suggested_by->{borrowernumber} } }); } }
(In reply to Jonathan Druart from comment #6) > Sounds like it is already correctly sorted without the patch. > > Asking for another signoff. Indeed, I can't reproduce. Maybe something changed in DataTable JS.
Ah when it does not work, sort is on member email (that is inside href) instead of name. Even with all cells with html <a></a>
(In reply to Fridolin SOMERS from comment #9) > Ah when it does not work, sort is on member email (that is inside href) > instead of name. > Even with all cells with html <a></a> I can reproduce on 3.22. I can reproduce now on master : Suggested by : <a href="mailto:zzz@xxx.fr">DIFRON, Daniel (90519000019877)</a> <a href="mailto:aaa@xxx.fr">NAPISTE, Nicole (90519000014977)</a> It is well sorted : DIFRON than NAPISTE. If anyone can confirm I'll set has resolved.
I still can't reproduce, even after remove some email addresses from patron records, adding different email addresses to identically-named patrons, etc. I think this is resolved.
Oki, thanks all for testing. I mark as resolved.
Next time please confirm the bug before fixing it ;)