Description
Kwascow
2012-10-28 18:25:45 UTC
It's currently not possible to change the sequence the subfields appear in in a framework. 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. 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 *** Bug 17051 has been marked as a duplicate of this bug. *** 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. +1 Created attachment 114345 [details] [review] Bug 8976: Add marc_subfield_structure.display_order Sponsored-by: Orex Digital 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 Created attachment 114347 [details] [review] Bug 8976: Sort subfields for authority records Same patch for the authority frameworks/records Sponsored-by: Orex Digital Created attachment 114348 [details] [review] Bug 8976: Change for the item forms Sponsored-by: Orex Digital Created attachment 114349 [details] [review] Bug 8976: Add Koha::AuthSubfieldStructure[s] Sponsored-by: Orex Digital 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 Created attachment 114351 [details] [review] Bug 8976: Sort subfields for authority records Same patch for the authority frameworks/records Sponsored-by: Orex Digital Created attachment 114352 [details] [review] Bug 8976: Change for the item forms Sponsored-by: Orex Digital Created attachment 114353 [details] [review] Bug 8976: Add Koha::AuthSubfieldStructure[s] Sponsored-by: Orex Digital 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 Created attachment 114355 [details] [review] Bug 8976: DBIC schema changes Sponsored-by: Orex Digital 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 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? (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. 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? 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> 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> 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> Created attachment 114495 [details] [review] Bug 8976: Change for the item forms Sponsored-by: Orex Digital Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 114496 [details] [review] Bug 8976: Add Koha::AuthSubfieldStructure[s] Sponsored-by: Orex Digital Signed-off-by: Michal Denar <black23@gmail.com> 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> Created attachment 114498 [details] [review] Bug 8976: DBIC schema changes Sponsored-by: Orex Digital Signed-off-by: Michal Denar <black23@gmail.com> (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! Can you please rebase? 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> 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> 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> Created attachment 117150 [details] [review] Bug 8976: Change for the item forms Sponsored-by: Orex Digital Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 117151 [details] [review] Bug 8976: Add Koha::AuthSubfieldStructure[s] Sponsored-by: Orex Digital Signed-off-by: Michal Denar <black23@gmail.com> 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> Created attachment 117153 [details] [review] Bug 8976: DBIC schema changes Sponsored-by: Orex Digital Signed-off-by: Michal Denar <black23@gmail.com> 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> 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> 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> 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> 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> 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> 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> Created attachment 117275 [details] [review] Bug 8976: (QA follow-up) Add a better feature decription Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Created attachment 117276 [details] [review] Bug 8976: (QA follow-up) Trivial POD fixes Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> 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. Pushed to master for 21.05, thanks to everybody involved! 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. Created attachment 117477 [details] [review] Bug 8976: Use existing Koha::Authority::Subfield[s] Followup reviewed and tested.. works well for me. Created attachment 117478 [details] [review] Bug 8976: (follow-up) Code cleaning Last 2 patches pushed to master. (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 Enhancement not pushed to 20.11.x *** Bug 9594 has been marked as a duplicate of this bug. *** *** Bug 21924 has been marked as a duplicate of this bug. *** |