Bug 9472 - Improve sequence of subfields used and unused while cataloguing
Summary: Improve sequence of subfields used and unused while cataloguing
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Galen Charlton
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-23 20:42 UTC by Nicole C. Engard
Modified: 2019-04-28 08:22 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 9472: Order subfields alphabeticaly when cataloging (1.80 KB, patch)
2015-04-08 10:28 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nicole C. Engard 2013-01-23 20:42:20 UTC
When clicking "Edit Record" if a subfield doesn't have data the subfields are out of order.  For example, the subfields are showing as 'a,' then 'c' because those two had data in them, and then the rest of the empty subfields were listed below those two in alphabetical order. It would be nice if the subfields were displayed in alphabetical order in record editing mode regardless of whether the subfields have data in them or not (so subfield 'b' should be in there).
Comment 1 Jonathan Druart 2015-04-08 10:28:36 UTC Comment hidden (obsolete)
Comment 2 Marcel de Rooy 2015-04-08 11:14:35 UTC
I have only glanced at your solution, but if this is a general sort of all subfields, it is not the right solution.
Comment 3 Jonathan Druart 2015-04-08 11:19:34 UTC
(In reply to M. de Rooy from comment #2)
> I have only glanced at your solution, but if this is a general sort of all
> subfields, it is not the right solution.

Sort of all subfields for a tag, and not for all tags.
What is the right solution if this is not the one?
Comment 4 Marcel de Rooy 2015-04-08 11:32:02 UTC
(In reply to Jonathan Druart from comment #3)
> Sort of all subfields for a tag, and not for all tags.
> What is the right solution if this is not the one?

Good question :)
I am not aware of UNIMARC specifics here, but in MARC21 there are quite some fields with constructions like this:
100a - 100q - 100d
The order should not be alphabetical by default and for all tags.
Comment 5 Jonathan Druart 2015-04-08 12:09:56 UTC
(In reply to M. de Rooy from comment #4)
> (In reply to Jonathan Druart from comment #3)
> > Sort of all subfields for a tag, and not for all tags.
> > What is the right solution if this is not the one?
> 
> Good question :)
> I am not aware of UNIMARC specifics here, but in MARC21 there are quite some
> fields with constructions like this:
> 100a - 100q - 100d
> The order should not be alphabetical by default and for all tags.

Yes, I am aware of that.
But actually, against master, the display is:
  all subfields, alphabetically sorted, present in the record
followed by:
  all subfields, alphabetically sorted, non present in the record.

(search for foreach my $subfield ( sort( keys %{ $tagslib->{$tag} } ) ) ~ l.600-700)

This patch just suggests to display all subfields, alphabetically sorted.
Which makes more sense.

If my dsecription of how it works on master is wrong, my patch is certainly wrong.
Comment 6 Marcel de Rooy 2015-04-15 13:29:51 UTC
(In reply to Jonathan Druart from comment #5)
> Yes, I am aware of that.
> But actually, against master, the display is:
>   all subfields, alphabetically sorted, present in the record
> followed by:
>   all subfields, alphabetically sorted, non present in the record.
> 
> (search for foreach my $subfield ( sort( keys %{ $tagslib->{$tag} } ) ) ~
> l.600-700)
> 
> This patch just suggests to display all subfields, alphabetically sorted.
> Which makes more sense.
> 
> If my dsecription of how it works on master is wrong, my patch is certainly
> wrong.

Yes, I am still afraid that your patch is actually "wrong" ;) I am not sure if you understood my point too. Hope the following clarifies:

I tested this:
I had a tag 100 with a 9 4 q d e  (4 and e were empty) 
Without your patch, I look in catalogue marc detail, I see: 100 a q d. Fine!
Without your patch, I look in opac marc detail, I see: 100 a 9 q d. Fine too.

Now with your patch, I edit the record:
The order is now: 4-9-a-d-e-q
Catalogue marc detail gives: a-d-q CHANGED !
Opac marc detail: 9-a-d-q  CHANGED AGAIN !

Failed QA
Comment 7 Jonathan Druart 2015-04-15 13:43:25 UTC
(In reply to M. de Rooy from comment #6)
Ok so the fields should not sorted alphabetically.
In this case, the naive approach cannot work, a much more complicated patch must be provided.
Comment 8 Jonathan Druart 2015-04-15 13:43:58 UTC
Reset assignee to default.
Comment 9 Marcel de Rooy 2015-04-15 13:52:04 UTC
(In reply to Jonathan Druart from comment #8)
> Reset assignee to default.

Should your patch be obsoleted too?
Comment 10 Jonathan Druart 2015-04-15 14:05:37 UTC
(In reply to M. de Rooy from comment #9)
> (In reply to Jonathan Druart from comment #8)
> > Reset assignee to default.
> 
> Should your patch be obsoleted too?

Yes, done.