https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44063 --- Comment #1 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211465 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211465&action=edit Bug 44063: Apply ComponentSortField and ComponentSortOrder to the component parts search get_components_query returns ( $query, $query_str, $sort ), but get_marc_components only unpacked two of them: my ( $searchstr, $sort ) = $self->get_components_query; so $sort held the query string instead of the sort, and the component parts were never sorted by the preferences. Take the sort from the right place. To test: 1. Set UseControlNumber to Use and ShowComponentRecords to both 2. Create a host record with a 001 and a 003, and three records linked to it: Leader position 7 'a' and a 773 $w with the host's control number, with titles that sort differently from the order they were created in 3. Set ComponentSortField to title and ComponentSortOrder to 'from Z to A' 4. Open the host record in the staff interface and look at the Components tab => The components are not sorted from Z to A 5. Apply the patch and reload => The components are sorted from Z to A 6. Set ComponentSortOrder to 'from A to Z' => The components are sorted from A to Z 7. Run $ prove t/db_dependent/Koha/Biblio.t => SUCCESS: Tests pass! 8. Sign off -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.