In UNIMARC, when creating a list using sort by copyrightdate, it sorts using the MARC21 field "copyrightdate", which is not existing in UNIMARC. Note: the inventory search uses the field publicationyear to sort, which is the correct field to use here.
Created attachment 169885 [details] [review] Bug 37434: Sort by publicationyear when copyrightdate is set in UNIMARC
Created attachment 169886 [details] [review] Bug 37434: Sort by publicationyear when copyrightdate is set in UNIMARC
Created attachment 169888 [details] [review] Bug 37434: Sort by publicationyear when copyrightdate is set in UNIMARC
Created attachment 169889 [details] [review] Bug 37434: Sort by publicationyear when copyrightdate is set in UNIMARC
Created attachment 169891 [details] [review] Bug 37434: Sort by publicationyear when copyrightdate is set in UNIMARC
Created attachment 169892 [details] [review] Bug 37434: Sort by publicationyear when copyrightdate is set in UNIMARC
Created attachment 169997 [details] [review] Bug 37434: Sort by publicationyear when copyrightdate is set in UNIMARC
Created attachment 169998 [details] [review] Bug 37434: Sort by publicationyear when copyrightdate is set in UNIMARC TEST PLAN (on an UNIMARC machine): 1 - Create a list with items with different publicationyear if you do not have one. 2 - Edit the list and select "copyrightdate as date" 3 - See they are not sorted by date 4 - Apply patch 5 - See they are now sorted by date. Note: The transformation of copyrightdate before loading the template is only useful if the list is sorted by copyrightdate, which is quite inconsistent but is actual for every Kohas at the moment.
Created attachment 170614 [details] [review] Bug 37434: Sort by publicationyear when copyrightdate is set in UNIMARC TEST PLAN (on an UNIMARC machine): 1 - Create a list with items with different publicationyear if you do not have one. 2 - Edit the list and select "copyrightdate as date" 3 - See they are not sorted by date 4 - Apply patch 5 - See they are now sorted by date. Note: The transformation of copyrightdate before loading the template is only useful if the list is sorted by copyrightdate, which is quite inconsistent but is actual for every Kohas at the moment. Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Why not display "Publication year" then?
Setting to minor since this is a bug not an enhancement
(In reply to Jonathan Druart from comment #10) > Why not display "Publication year" then? I think the scope of the bug is to harmonize the way it works between UNIMARC and MARC21, hence I'm just translating the field to be the correct one. In both cases date appears to be in field Publication information, am I missing something ?
Do you need these changes: + [% ELSIF shelf.sortfield == "publicationyear" %] + <option value="publicationyear" selected="selected">Copyrightdate</option> and also twice + $sortfield = 'title' unless grep { $_ eq $sortfield } qw( title author copyrightdate publicationyear itemcallnumber dateadded ); Is the test on copyrightdate and UNIMARC not sufficient ?
(In reply to Jonathan Druart from comment #10) > Why not display "Publication year" then? Oh I missinterpreted your comment, I got it, yeah, I'll change it
Hum, I think this needs a rework, setting back to Assigned
Created attachment 177576 [details] [review] Bug 37434: Sort by publicationyear when copyrightdate is set in UNIMARC TEST PLAN (on an UNIMARC machine): 1 - Create a list with items with different publicationyear if you do not have one. 2 - Edit the list and select "copyrightdate as date" 3 - See they are not sorted by date 4 - Apply patch 5 - See they are now sorted by date. Note: The transformation of copyrightdate before loading the template is only useful if the list is sorted by copyrightdate, which is quite inconsistent but is actual for every Kohas at the moment. Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
(In reply to Marcel de Rooy from comment #13) > Do you need these changes: > + [% ELSIF shelf.sortfield == > "publicationyear" %] > + <option value="publicationyear" > selected="selected">Copyrightdate</option> > > and also twice > + $sortfield = 'title' unless grep { $_ eq $sortfield } qw( title > author copyrightdate publicationyear itemcallnumber dateadded ); > > Is the test on copyrightdate and UNIMARC not sufficient ? In fact, they are not used the same way : "copyrightdate" is de facto the name used in database to sort by date of publication, in MARC21, "copyrightdate" and in UNIMARC 'publicationyear'. This is why we need to tell the template "I need to sort by publicationyear" The code added in the template is just the corresponding entry for the sortfield publicationyear, as there is one for each possible sortfield. Or you mean you want to do the test directly on the template ? I don't feel like it would make it more clean, do you ?
Created attachment 177580 [details] [review] Bug 37434: Sort by publicationyear when copyrightdate is set in UNIMARC TEST PLAN (on an UNIMARC machine): 1 - Create a list with items with different publicationyear if you do not have one. 2 - Edit the list and select "copyrightdate as date" 3 - See they are not sorted by date 4 - Apply patch 5 - See they are now sorted by date. Note: The transformation of copyrightdate before loading the template is only useful if the list is sorted by copyrightdate, which is quite inconsistent but is actual for every Kohas at the moment. Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Created attachment 177581 [details] [review] Bug 37434: Sort by publicationyear when copyrightdate is set in UNIMARC TEST PLAN (on an UNIMARC machine): 1 - Create a list with items with different publicationyear if you do not have one. 2 - Edit the list and select "copyrightdate as date" 3 - See they are not sorted by date 4 - Apply patch 5 - See they are now sorted by date. Note: The transformation of copyrightdate before loading the template is only useful if the list is sorted by copyrightdate, which is quite inconsistent but is actual for every Kohas at the moment. Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
(In reply to Baptiste Wojtkowski (bwoj) from comment #17) > > In fact, they are not used the same way : "copyrightdate" is de facto the > name used in database to sort by date of publication, in MARC21, > "copyrightdate" and in UNIMARC 'publicationyear'. This is why we need to > tell the template "I need to sort by publicationyear" > The code added in the template is just the corresponding entry for the > sortfield publicationyear, as there is one for each possible sortfield. > > Or you mean you want to do the test directly on the template ? I don't feel > like it would make it more clean, do you ? Looks better now. Too bad that Koha makes this distinction. It is a potential source of confusion and bugs. Will pass QA now.
Created attachment 177611 [details] [review] Bug 37434: Sort by publicationyear when copyrightdate is set in UNIMARC TEST PLAN (on an UNIMARC machine): 1 - Create a list with items with different publicationyear if you do not have one. 2 - Edit the list and select "copyrightdate as date" 3 - See they are not sorted by date 4 - Apply patch 5 - See they are now sorted by date. Note: The transformation of copyrightdate before loading the template is only useful if the list is sorted by copyrightdate, which is quite inconsistent but is actual for every Kohas at the moment. Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Oops minor detail: Publication Year in wrong case style..
Created attachment 177618 [details] [review] Bug 37434: Sort by publicationyear when copyrightdate is set in UNIMARC TEST PLAN (on an UNIMARC machine): 1 - Create a list with items with different publicationyear if you do not have one. 2 - Edit the list and select "copyrightdate as date" 3 - See they are not sorted by date 4 - Apply patch 5 - See they are now sorted by date. Note: The transformation of copyrightdate before loading the template is only useful if the list is sorted by copyrightdate, which is quite inconsistent but is actual for every Kohas at the moment. Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Removed the capital, Idk if you also wanted to remove the space, tell me :)
Created attachment 177677 [details] [review] Bug 37434: Sort by publicationyear when copyrightdate is set in UNIMARC TEST PLAN (on an UNIMARC machine): 1 - Create a list with items with different publicationyear if you do not have one. 2 - Edit the list and select "copyrightdate as date" 3 - See they are not sorted by date 4 - Apply patch 5 - See they are now sorted by date. Note: The transformation of copyrightdate before loading the template is only useful if the list is sorted by copyrightdate, which is quite inconsistent but is actual for every Kohas at the moment. Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Looks like I did not publish any modification in last upload
I think we might want to just use "Publication year" for MARC21 too, but that can be for later: [% END %] [% IF shelf.sortfield == "copyrightdate" %] <option value="copyrightdate" selected="selected">Copyrightdate</option> + [% ELSIF shelf.sortfield == "publicationyear" %] + <option value="publicationyear" selected="selected">Publication year</option> [% ELSE %]
Pushed for 25.05! Well done everyone, thank you!