Bug 8976 - Default sequence of subfields in cataloguing and item editor
Summary: Default sequence of subfields in cataloguing and item editor
Status: Pushed to master
Alias: None
Product: Koha
Classification: Unclassified
Component: MARC Bibliographic data support (show other bugs)
Version: master
Hardware: All All
: P1 - high new feature (vote)
Assignee: Jonathan Druart
QA Contact: Tomás Cohen Arazi
URL:
Keywords: Manual
: 9594 17051 (view as bug list)
Depends on:
Blocks: 27526 27775 27831
  Show dependency treegraph
 
Reported: 2012-10-28 18:25 UTC by Kwascow
Modified: 2021-05-25 14:09 UTC (History)
17 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: ---
Text to go in the release notes:
This new enhancement adds the ability to change the default order of the subfields. Both bibliographic and authority MARC subfield structure are taken into account. And so the item edition as well. This will answer, for instance, the following needs: - $i in 7xx fields should be the first subfield in the sequence - 300 fields are sorted number first when cataloguers enter the letter fields first - 100 field, it's commonly $a, $q, $d.
Version(s) released in:
21.05.00


Attachments
Bug 8976: Add marc_subfield_structure.display_order (1.75 KB, patch)
2020-12-11 14:42 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 8976: Add the ability to sort subfields for the MARC frameworks (14.31 KB, patch)
2020-12-11 14:42 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 8976: Sort subfields for authority records (12.75 KB, patch)
2020-12-11 14:42 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 8976: Change for the item forms (13.58 KB, patch)
2020-12-11 14:42 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 8976: Add Koha::AuthSubfieldStructure[s] (3.42 KB, patch)
2020-12-11 14:42 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 8976: Code cleaning (37.82 KB, patch)
2020-12-11 14:42 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 8976: Sort subfields for authority records (12.68 KB, patch)
2020-12-11 14:43 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 8976: Change for the item forms (13.58 KB, patch)
2020-12-11 14:43 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 8976: Add Koha::AuthSubfieldStructure[s] (3.42 KB, patch)
2020-12-11 14:44 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 8976: Code cleaning (37.77 KB, patch)
2020-12-11 14:44 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 8976: DBIC schema changes (2.78 KB, patch)
2020-12-11 14:44 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 8976: Add marc_subfield_structure.display_order (1.79 KB, patch)
2020-12-17 20:31 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 8976: Add the ability to sort subfields for the MARC frameworks (14.39 KB, patch)
2020-12-17 20:31 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 8976: Sort subfields for authority records (12.77 KB, patch)
2020-12-17 20:31 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 8976: Change for the item forms (13.64 KB, patch)
2020-12-17 20:31 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 8976: Add Koha::AuthSubfieldStructure[s] (3.49 KB, patch)
2020-12-17 20:31 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 8976: Code cleaning (37.85 KB, patch)
2020-12-17 20:31 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 8976: DBIC schema changes (2.82 KB, patch)
2020-12-17 20:31 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 8976: Add marc_subfield_structure.display_order (1.84 KB, patch)
2021-02-22 13:16 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 8976: Add the ability to sort subfields for the MARC frameworks (14.36 KB, patch)
2021-02-22 13:17 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 8976: Sort subfields for authority records (12.82 KB, patch)
2021-02-22 13:17 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 8976: Change for the item forms (13.63 KB, patch)
2021-02-22 13:17 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 8976: Add Koha::AuthSubfieldStructure[s] (3.47 KB, patch)
2021-02-22 13:17 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 8976: Code cleaning (37.82 KB, patch)
2021-02-22 13:17 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 8976: DBIC schema changes (2.82 KB, patch)
2021-02-22 13:17 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 8976: Add marc_subfield_structure.display_order (1.90 KB, patch)
2021-02-24 15:26 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 8976: Add the ability to sort subfields for the MARC frameworks (14.42 KB, patch)
2021-02-24 15:26 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 8976: Sort subfields for authority records (12.88 KB, patch)
2021-02-24 15:27 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 8976: Change for the item forms (13.69 KB, patch)
2021-02-24 15:27 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 8976: Add Koha::AuthSubfieldStructure[s] (3.53 KB, patch)
2021-02-24 15:27 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 8976: Code cleaning (37.88 KB, patch)
2021-02-24 15:27 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 8976: DBIC schema changes (2.88 KB, patch)
2021-02-24 15:27 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 8976: (QA follow-up) Add a better feature decription (934 bytes, patch)
2021-02-24 15:27 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 8976: (QA follow-up) Trivial POD fixes (1.58 KB, patch)
2021-02-24 15:27 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 8976: Use existing Koha::Authority::Subfield[s] (5.61 KB, patch)
2021-03-02 09:19 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 8976: (follow-up) Code cleaning (3.08 KB, patch)
2021-03-02 09:38 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 Kwascow 2012-10-28 18:25:45 UTC
Hello,

I have got one problem with MARC framework structure. Is it possible to change default sequence of subfield in framework?

For example:

In my framework default sequence for subfields 110 is
110a 110b 110c 110d 110n (alfabetical sort)

I would like to have this:

110a 110b 110n 110d 110c.

Have you got any ideas?

sincerly
Jakub Kalinowski
National Library of Poland
Comment 1 Katrin Fischer 2015-01-06 19:36:25 UTC
It's currently not possible to change the sequence the subfields appear in in a framework.
Comment 2 Katrin Fischer 2016-08-23 11:49:13 UTC
Still valid in current versions - it would be nice to be able to change the default sequence of subfields appearing in the editor. Another example is $i in 7xx fields which usually should be the first subfield in the sequence.
Comment 3 Lisette Scheer 2017-08-16 16:43:35 UTC
Today my cataloger mentioned that the 300 fields we put the RDA in are sorted number first, then letters (3xx 1,3xx 2, 3xx a) but they enter the letter fields first, then the number fields. 
Every time she opens a new record she fixes the order of all the 3xx fields and she requested if we could change this.

Lisette
Comment 4 Marjorie Barry-Vila 2017-11-24 18:42:17 UTC
*** Bug 17051 has been marked as a duplicate of this bug. ***
Comment 5 Heather 2020-02-14 16:53:10 UTC
This would be SO useful and would save me SO much time if I could set the order of subfields in each MARC field in the framework for bibs, but especially for authorities, since there is only a basic editor for authorities, and I spend a lot of time going, "click, click, click, click..." to put the subfield in the correct order, e.g., in a 100 field, it's commonly $a, $q, $d...

It would also encourage correct cataloging for those who use the basic bib editor because the the most commonly correct order of subfields could be set at the framework level, encouraging more correct input.
Comment 6 Michal Denar 2020-10-06 19:01:02 UTC
+1
Comment 7 Jonathan Druart 2020-12-11 14:42:33 UTC
Created attachment 114345 [details] [review]
Bug 8976: Add marc_subfield_structure.display_order

Sponsored-by: Orex Digital
Comment 8 Jonathan Druart 2020-12-11 14:42:37 UTC
Created attachment 114346 [details] [review]
Bug 8976: Add the ability to sort subfields for the MARC frameworks

This new enhancement adds the ability to change the default order the subfields.

Both bibliographic and authority MARC subfield structure are taken into
account. And so the item edition as well (in the different screens when
item can be added/edited).

This will answer the following needs that have been listed in the
comments of the bug report:
- $i in 7xx fields should be the first subfield in the sequence
- 300 fields are sorted number first when cataloguers enter the letter fields first
- 100 field, it's commonly $a, $q, $d.

Test plan:
1. Edit a MARC frameworks, field 300
2. Resort the subfield (drag and drop the tab of the subfield) as you
like
3. Save
=> Notice that the list of fields are displayed following the order you
chose
4. Edit it again
=> The order is correctly kept!
5. Create a new bibliographic record
6. Notice that the subfields are order in the same sequence
7. Fill different subfields, not all
8. Save, edit again
9. Note that the subfields that have been filled are listed first, then
the empty ones. But the sequence defined at the framework level is kept.
10. Do the same for an authority framework and create/edit an authority
record
11. Modify item (952) subfields order
12. Create an item and confirm that the order is correct
13. Modify the ACQ framework, 952, modify the order of the subfield
14. Create a new order and confirm that the item form has the subfield
ordered following the sequence defined at the framework level

QA: Note that this patch is about bibliographic records only, next
patches deal with authotiries and items.

Sponsored-by: Orex Digital
Comment 9 Jonathan Druart 2020-12-11 14:42:41 UTC
Created attachment 114347 [details] [review]
Bug 8976: Sort subfields for authority records

Same patch for the authority frameworks/records

Sponsored-by: Orex Digital
Comment 10 Jonathan Druart 2020-12-11 14:42:45 UTC
Created attachment 114348 [details] [review]
Bug 8976: Change for the item forms

Sponsored-by: Orex Digital
Comment 11 Jonathan Druart 2020-12-11 14:42:49 UTC
Created attachment 114349 [details] [review]
Bug 8976: Add Koha::AuthSubfieldStructure[s]

Sponsored-by: Orex Digital
Comment 12 Jonathan Druart 2020-12-11 14:42:53 UTC
Created attachment 114350 [details] [review]
Bug 8976: Code cleaning

It was tricky to write the previous patch so I decided to clean the
ground (a bit) for later, taking advantage of having people who are
going to test the whole area.
We can move it to its own bug report if QA wants to.

Sponsored-by: Orex Digital
Comment 13 Jonathan Druart 2020-12-11 14:43:53 UTC
Created attachment 114351 [details] [review]
Bug 8976: Sort subfields for authority records

Same patch for the authority frameworks/records

Sponsored-by: Orex Digital
Comment 14 Jonathan Druart 2020-12-11 14:43:57 UTC
Created attachment 114352 [details] [review]
Bug 8976: Change for the item forms

Sponsored-by: Orex Digital
Comment 15 Jonathan Druart 2020-12-11 14:44:01 UTC
Created attachment 114353 [details] [review]
Bug 8976: Add Koha::AuthSubfieldStructure[s]

Sponsored-by: Orex Digital
Comment 16 Jonathan Druart 2020-12-11 14:44:05 UTC
Created attachment 114354 [details] [review]
Bug 8976: Code cleaning

It was tricky to write the previous patch so I decided to clean the
ground (a bit) for later, taking advantage of having people who are
going to test the whole area.
We can move it to its own bug report if QA wants to.

Sponsored-by: Orex Digital
Comment 17 Jonathan Druart 2020-12-11 14:44:09 UTC
Created attachment 114355 [details] [review]
Bug 8976: DBIC schema changes

Sponsored-by: Orex Digital
Comment 18 Jonathan Druart 2020-12-11 14:52:40 UTC
Some screenshots:

Before the sequence change: https://snipboard.io/7ACU0L.jpg
During the sequence change: https://snipboard.io/NUXbTY.jpg
After the sequence change:  https://snipboard.io/tbJYlO.jpg

List of the subfields with the new sequence: https://snipboard.io/v3V9tJ.jpg

Edition of a new bibliographic record: https://snipboard.io/RlEeV0.jpg
Comment 19 Michal Denar 2020-12-11 21:10:44 UTC
Hi Jonathan,
I'm testing this patch. I think the testplan works, but I found a problem if I pull record from z39.50. Subfields order doesn't correspond to framework settings. 
What about the Batch item modification tool? Or the item editing form? How will we display the subfields order there? Alphabetically or based on the framework definition?
Comment 20 Jonathan Druart 2020-12-17 13:38:03 UTC
(In reply to Michal Denar from comment #19)
> Hi Jonathan,
> I'm testing this patch. I think the testplan works, but I found a problem if
> I pull record from z39.50. Subfields order doesn't correspond to framework
> settings. 

In that case we are pulling the record with the subfields ordered like they are coming from the z3950 server. I don't think we should reprocess them when importing them.

> What about the Batch item modification tool? Or the item editing form? How
> will we display the subfields order there? Alphabetically or based on the
> framework definition?

I am not sure I understand. How would the batch modification tools modify the order of the subfields?

The item edition form is following the sequence of the framework.
Comment 21 Katrin Fischer 2020-12-17 19:11:30 UTC
I agree with Jonathan in that we should never change the sequence of subfields in an existing bibliographic record - imported or already in Koha. MARC requires some subfields to be in a specific sequence that is not alphabetical or easy to guess.

I am not sure how the item forms are build in several places - only that the ones in acq and serials are "different" and have not all features from the frameworks. Maybe worth checking those for a separate bug. But I think this one here aims mostly at bibliographic and authority records?
Comment 22 Michal Denar 2020-12-17 20:31:30 UTC
Created attachment 114492 [details] [review]
Bug 8976: Add marc_subfield_structure.display_order

Sponsored-by: Orex Digital

Signed-off-by: Michal Denar <black23@gmail.com>
Comment 23 Michal Denar 2020-12-17 20:31:35 UTC
Created attachment 114493 [details] [review]
Bug 8976: Add the ability to sort subfields for the MARC frameworks

This new enhancement adds the ability to change the default order the subfields.

Both bibliographic and authority MARC subfield structure are taken into
account. And so the item edition as well (in the different screens when
item can be added/edited).

This will answer the following needs that have been listed in the
comments of the bug report:
- $i in 7xx fields should be the first subfield in the sequence
- 300 fields are sorted number first when cataloguers enter the letter fields first
- 100 field, it's commonly $a, $q, $d.

Test plan:
1. Edit a MARC frameworks, field 300
2. Resort the subfield (drag and drop the tab of the subfield) as you
like
3. Save
=> Notice that the list of fields are displayed following the order you
chose
4. Edit it again
=> The order is correctly kept!
5. Create a new bibliographic record
6. Notice that the subfields are order in the same sequence
7. Fill different subfields, not all
8. Save, edit again
9. Note that the subfields that have been filled are listed first, then
the empty ones. But the sequence defined at the framework level is kept.
10. Do the same for an authority framework and create/edit an authority
record
11. Modify item (952) subfields order
12. Create an item and confirm that the order is correct
13. Modify the ACQ framework, 952, modify the order of the subfield
14. Create a new order and confirm that the item form has the subfield
ordered following the sequence defined at the framework level

QA: Note that this patch is about bibliographic records only, next
patches deal with authotiries and items.

Sponsored-by: Orex Digital

Signed-off-by: Michal Denar <black23@gmail.com>
Comment 24 Michal Denar 2020-12-17 20:31:39 UTC
Created attachment 114494 [details] [review]
Bug 8976: Sort subfields for authority records

Same patch for the authority frameworks/records

Sponsored-by: Orex Digital

Signed-off-by: Michal Denar <black23@gmail.com>
Comment 25 Michal Denar 2020-12-17 20:31:44 UTC
Created attachment 114495 [details] [review]
Bug 8976: Change for the item forms

Sponsored-by: Orex Digital

Signed-off-by: Michal Denar <black23@gmail.com>
Comment 26 Michal Denar 2020-12-17 20:31:48 UTC
Created attachment 114496 [details] [review]
Bug 8976: Add Koha::AuthSubfieldStructure[s]

Sponsored-by: Orex Digital

Signed-off-by: Michal Denar <black23@gmail.com>
Comment 27 Michal Denar 2020-12-17 20:31:52 UTC
Created attachment 114497 [details] [review]
Bug 8976: Code cleaning

It was tricky to write the previous patch so I decided to clean the
ground (a bit) for later, taking advantage of having people who are
going to test the whole area.
We can move it to its own bug report if QA wants to.

Sponsored-by: Orex Digital

Signed-off-by: Michal Denar <black23@gmail.com>
Comment 28 Michal Denar 2020-12-17 20:31:57 UTC
Created attachment 114498 [details] [review]
Bug 8976: DBIC schema changes

Sponsored-by: Orex Digital

Signed-off-by: Michal Denar <black23@gmail.com>
Comment 29 Jonathan Druart 2020-12-18 09:03:03 UTC
(In reply to Katrin Fischer from comment #21)
> I agree with Jonathan in that we should never change the sequence of
> subfields in an existing bibliographic record - imported or already in Koha.
> MARC requires some subfields to be in a specific sequence that is not
> alphabetical or easy to guess.

Thanks for the confirmation.

> I am not sure how the item forms are build in several places - only that the
> ones in acq and serials are "different" and have not all features from the
> frameworks. Maybe worth checking those for a separate bug. But I think this
> one here aims mostly at bibliographic and authority records?

Items as well. Item add/mod form from cataloguing and acq are taken into account in those patches.

Thanks Michal for the signoff!
Comment 30 Tomás Cohen Arazi 2021-02-22 11:50:45 UTC
Can you please rebase?
Comment 31 Jonathan Druart 2021-02-22 13:16:59 UTC
Created attachment 117147 [details] [review]
Bug 8976: Add marc_subfield_structure.display_order

Sponsored-by: Orex Digital

Signed-off-by: Michal Denar <black23@gmail.com>
Comment 32 Jonathan Druart 2021-02-22 13:17:04 UTC
Created attachment 117148 [details] [review]
Bug 8976: Add the ability to sort subfields for the MARC frameworks

This new enhancement adds the ability to change the default order the subfields.

Both bibliographic and authority MARC subfield structure are taken into
account. And so the item edition as well (in the different screens when
item can be added/edited).

This will answer the following needs that have been listed in the
comments of the bug report:
- $i in 7xx fields should be the first subfield in the sequence
- 300 fields are sorted number first when cataloguers enter the letter fields first
- 100 field, it's commonly $a, $q, $d.

Test plan:
1. Edit a MARC frameworks, field 300
2. Resort the subfield (drag and drop the tab of the subfield) as you
like
3. Save
=> Notice that the list of fields are displayed following the order you
chose
4. Edit it again
=> The order is correctly kept!
5. Create a new bibliographic record
6. Notice that the subfields are order in the same sequence
7. Fill different subfields, not all
8. Save, edit again
9. Note that the subfields that have been filled are listed first, then
the empty ones. But the sequence defined at the framework level is kept.
10. Do the same for an authority framework and create/edit an authority
record
11. Modify item (952) subfields order
12. Create an item and confirm that the order is correct
13. Modify the ACQ framework, 952, modify the order of the subfield
14. Create a new order and confirm that the item form has the subfield
ordered following the sequence defined at the framework level

QA: Note that this patch is about bibliographic records only, next
patches deal with authotiries and items.

Sponsored-by: Orex Digital

Signed-off-by: Michal Denar <black23@gmail.com>
Comment 33 Jonathan Druart 2021-02-22 13:17:10 UTC
Created attachment 117149 [details] [review]
Bug 8976: Sort subfields for authority records

Same patch for the authority frameworks/records

Sponsored-by: Orex Digital

Signed-off-by: Michal Denar <black23@gmail.com>
Comment 34 Jonathan Druart 2021-02-22 13:17:15 UTC
Created attachment 117150 [details] [review]
Bug 8976: Change for the item forms

Sponsored-by: Orex Digital

Signed-off-by: Michal Denar <black23@gmail.com>
Comment 35 Jonathan Druart 2021-02-22 13:17:19 UTC
Created attachment 117151 [details] [review]
Bug 8976: Add Koha::AuthSubfieldStructure[s]

Sponsored-by: Orex Digital

Signed-off-by: Michal Denar <black23@gmail.com>
Comment 36 Jonathan Druart 2021-02-22 13:17:24 UTC
Created attachment 117152 [details] [review]
Bug 8976: Code cleaning

It was tricky to write the previous patch so I decided to clean the
ground (a bit) for later, taking advantage of having people who are
going to test the whole area.
We can move it to its own bug report if QA wants to.

Sponsored-by: Orex Digital

Signed-off-by: Michal Denar <black23@gmail.com>
Comment 37 Jonathan Druart 2021-02-22 13:17:29 UTC
Created attachment 117153 [details] [review]
Bug 8976: DBIC schema changes

Sponsored-by: Orex Digital

Signed-off-by: Michal Denar <black23@gmail.com>
Comment 38 Tomás Cohen Arazi 2021-02-24 15:26:53 UTC
Created attachment 117268 [details] [review]
Bug 8976: Add marc_subfield_structure.display_order

Sponsored-by: Orex Digital

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 39 Tomás Cohen Arazi 2021-02-24 15:26:59 UTC
Created attachment 117269 [details] [review]
Bug 8976: Add the ability to sort subfields for the MARC frameworks

This new enhancement adds the ability to change the default order the subfields.

Both bibliographic and authority MARC subfield structure are taken into
account. And so the item edition as well (in the different screens when
item can be added/edited).

This will answer the following needs that have been listed in the
comments of the bug report:
- $i in 7xx fields should be the first subfield in the sequence
- 300 fields are sorted number first when cataloguers enter the letter fields first
- 100 field, it's commonly $a, $q, $d.

Test plan:
1. Edit a MARC frameworks, field 300
2. Resort the subfield (drag and drop the tab of the subfield) as you
like
3. Save
=> Notice that the list of fields are displayed following the order you
chose
4. Edit it again
=> The order is correctly kept!
5. Create a new bibliographic record
6. Notice that the subfields are order in the same sequence
7. Fill different subfields, not all
8. Save, edit again
9. Note that the subfields that have been filled are listed first, then
the empty ones. But the sequence defined at the framework level is kept.
10. Do the same for an authority framework and create/edit an authority
record
11. Modify item (952) subfields order
12. Create an item and confirm that the order is correct
13. Modify the ACQ framework, 952, modify the order of the subfield
14. Create a new order and confirm that the item form has the subfield
ordered following the sequence defined at the framework level

QA: Note that this patch is about bibliographic records only, next
patches deal with authotiries and items.

Sponsored-by: Orex Digital

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 40 Tomás Cohen Arazi 2021-02-24 15:27:05 UTC
Created attachment 117270 [details] [review]
Bug 8976: Sort subfields for authority records

Same patch for the authority frameworks/records

Sponsored-by: Orex Digital

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 41 Tomás Cohen Arazi 2021-02-24 15:27:15 UTC
Created attachment 117271 [details] [review]
Bug 8976: Change for the item forms

Sponsored-by: Orex Digital

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 42 Tomás Cohen Arazi 2021-02-24 15:27:23 UTC
Created attachment 117272 [details] [review]
Bug 8976: Add Koha::AuthSubfieldStructure[s]

Sponsored-by: Orex Digital

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 43 Tomás Cohen Arazi 2021-02-24 15:27:31 UTC
Created attachment 117273 [details] [review]
Bug 8976: Code cleaning

It was tricky to write the previous patch so I decided to clean the
ground (a bit) for later, taking advantage of having people who are
going to test the whole area.
We can move it to its own bug report if QA wants to.

Sponsored-by: Orex Digital

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 44 Tomás Cohen Arazi 2021-02-24 15:27:38 UTC
Created attachment 117274 [details] [review]
Bug 8976: DBIC schema changes

Sponsored-by: Orex Digital

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 45 Tomás Cohen Arazi 2021-02-24 15:27:45 UTC
Created attachment 117275 [details] [review]
Bug 8976: (QA follow-up) Add a better feature decription

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 46 Tomás Cohen Arazi 2021-02-24 15:27:51 UTC
Created attachment 117276 [details] [review]
Bug 8976: (QA follow-up) Trivial POD fixes

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 47 Tomás Cohen Arazi 2021-02-24 15:32:29 UTC
I love this feature.

I tested all the use cases and things work as expected. Specially, respecting existing auth/biblio subfield orderings. Changing the framework preserves ordering as well.

The only thing this lacks, is some visible explanation about the drag and drop feature. I will file a dependent bug requesting that added.
Comment 48 Jonathan Druart 2021-03-01 14:24:00 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 49 Jonathan Druart 2021-03-01 16:15:57 UTC
Hum, there is a test failing that may be related to this, but I don't recreate locally (D9_My8):

16:25:53 koha_1       |         #   Failed test 'Module Koha::AuthSubfieldStructures should have koha_object[s]_class method if needed'
16:25:53 koha_1       |         #   at t/db_dependent/TestBuilder.t line 402.
16:25:53 koha_1       |         #          got: 'Can't locate object method "_new_from_dbic" via package "Koha::Authority::Subfield" (perhaps you forgot to load "Koha::Authority::Subfield"?) at /kohadevbox/koha/Koha/Object.pm line 335.
16:25:53 koha_1       |         # '
16:25:53 koha_1       |         #     expected: ''
16:26:47 koha_1       |         # Looks like you failed 1 test of 526.
16:26:47 koha_1       | 
16:26:47 koha_1       |     #   Failed test 'Test all classes'
16:26:47 koha_1       |     #   at t/db_dependent/TestBuilder.t line 413.
16:26:48 koha_1       |     # Looks like you failed 1 test of 5.



However I found an inconsistency. Those patches introduced Koha::AuthSubfieldStructure[s], but we already had Koha::Authority::Subfield[s].
It also introduced Koha::MarcSubfieldStructure[s].

What about:
Koha::Framework::Biblio::Subfield[s]
Koha::Framework::Authority::Subfield[s]

Then later:
Koha::Framework::Biblio::Tag[s]
Koha::Framework::Authority::Tag[s]

Or... Koha::MARC::Biblio::Subfield? Koha::MARCStructure::Biblio::Subfield?

Or... Koha::Framework::Subfield::Biblio and Koha::FrameworkSubfield::Authority that would inherit from Koha::Framework::Subfield. But then we need to drop the plural forms.
Comment 50 Jonathan Druart 2021-03-02 09:19:44 UTC
Created attachment 117477 [details] [review]
Bug 8976: Use existing Koha::Authority::Subfield[s]
Comment 51 Martin Renvoize 2021-03-02 09:31:12 UTC
Followup reviewed and tested.. works well for me.
Comment 52 Jonathan Druart 2021-03-02 09:38:39 UTC
Created attachment 117478 [details] [review]
Bug 8976: (follow-up) Code cleaning
Comment 53 Jonathan Druart 2021-03-02 09:40:17 UTC
Last 2 patches pushed to master.
Comment 54 Jonathan Druart 2021-03-02 11:07:32 UTC
(In reply to Jonathan Druart from comment #49)
> However I found an inconsistency. Those patches introduced
> Koha::AuthSubfieldStructure[s], but we already had
> Koha::Authority::Subfield[s].
> It also introduced Koha::MarcSubfieldStructure[s].
> 
> What about:
> Koha::Framework::Biblio::Subfield[s]
> Koha::Framework::Authority::Subfield[s]
> 
> Then later:
> Koha::Framework::Biblio::Tag[s]
> Koha::Framework::Authority::Tag[s]
> 
> Or... Koha::MARC::Biblio::Subfield? Koha::MARCStructure::Biblio::Subfield?
> 
> Or... Koha::Framework::Subfield::Biblio and
> Koha::FrameworkSubfield::Authority that would inherit from
> Koha::Framework::Subfield. But then we need to drop the plural forms.

See bug 27831
Comment 55 Fridolin Somers 2021-03-04 10:14:39 UTC
Enhancement not pushed to 20.11.x
Comment 56 Jonathan Druart 2021-05-25 14:00:51 UTC
*** Bug 9594 has been marked as a duplicate of this bug. ***