RFC: https://wiki.koha-community.org/wiki/MARC_Holdings_Records_RFC This is placeholder for upcoming activity.
This will obsolete bug 2797.
*** Bug 2797 has been marked as a duplicate of this bug. ***
Created attachment 73703 [details] [review] Initial holdings support
Created attachment 73704 [details] [review] Bug 20447: MARC Holdings support
Initial development is complete. Here's a full patch for the brave to try out. You will need to run dbix schema update and the database update. Without changing settings there should be no change in behavior. Holdings support is enabled only by setting preference SummaryHoldings to "Use". I consider this quite feature-complete apart from the following: - terminal utilities for importing and exporting holdings are still missing - some tests should be added - existing tests should be verified - look and feel may need refinement
Created attachment 76485 [details] [review] Bug 20447: MARC Holdings support
Created attachment 76542 [details] [review] Bug 20447: MARC Holdings support
Created attachment 76670 [details] Sample MARCXML file containing biblios with interleaved holdings
Created attachment 76671 [details] [review] Bug 20447: MARC Holdings support https://bugs.koha-community.org/show_bug.cgi?id=20447 Enable by setting "SummaryHoldings" option to "Use".
Created attachment 76672 [details] [review] Bug 20447: Add import/export support for holdings https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20447 Adds support for importing and exporting biblios with interleaved holdings. Test plan: 1.) Import the MARCXML file attached to the bug with the -holdings parameter: misc/migration_tools/bulkmarcimport.pl -biblios -holdings -file holdings.xml -m MARCXML 2.) Verify that the holdings records were imported. 3.) Export the same records with holdings: misc/export_records.pl --record-type=bibs --starting_biblionumber 103 --ending_biblionumber 104 --filename=holdings_export.xml --format=xml --holdings 4.) Verify that both bibliographic and holding records are exported. 5.) Verify that tests in t/db_dependent/Exporter/Record.t pass.
Created attachment 76735 [details] [review] Bug 20447: MARC Holdings support https://bugs.koha-community.org/show_bug.cgi?id=20447 Enable by setting "SummaryHoldings" option to "Use".
Created attachment 76736 [details] [review] Bug 20447: Add import/export support for holdings https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20447 Adds support for importing and exporting biblios with interleaved holdings. Test plan: 1.) Import the MARCXML file attached to the bug with the -holdings parameter: misc/migration_tools/bulkmarcimport.pl -biblios -holdings -file holdings.xml -m MARCXML 2.) Verify that the holdings records were imported. 3.) Export the same records with holdings: misc/export_records.pl --record-type=bibs --starting_biblionumber 103 --ending_biblionumber 104 --filename=holdings_export.xml --format=xml --holdings 4.) Verify that both bibliographic and holding records are exported. 5.) Verify that tests in t/db_dependent/Exporter/Record.t pass.
Created attachment 78178 [details] [review] Bug 20447: MARC Holdings support https://bugs.koha-community.org/show_bug.cgi?id=20447 Enable by setting "SummaryHoldings" option to "Use".
Created attachment 78179 [details] [review] Bug 20447: Add import/export support for holdings https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20447 Adds support for importing and exporting biblios with interleaved holdings. Test plan: 1.) Import the MARCXML file attached to the bug with the -holdings parameter: misc/migration_tools/bulkmarcimport.pl -biblios -holdings -file holdings.xml -m MARCXML 2.) Verify that the holdings records were imported. 3.) Export the same records with holdings: misc/export_records.pl --record-type=bibs --starting_biblionumber 103 --ending_biblionumber 104 --filename=holdings_export.xml --format=xml --holdings 4.) Verify that both bibliographic and holding records are exported. 5.) Verify that tests in t/db_dependent/Exporter/Record.t pass.
Created attachment 78180 [details] [review] Bug 20447: Include basic summary holdings in the OAI-PMH responses. https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20447 If include_items is set in oai conf, also basic location information from holdings records is included in the returned MARC records.
Created attachment 78738 [details] [review] Bug 20447: MARC Holdings support https://bugs.koha-community.org/show_bug.cgi?id=20447 Enable by setting "SummaryHoldings" option to "Use".
Created attachment 78739 [details] [review] Bug 20447: Add import/export support for holdings https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20447 Adds support for importing and exporting biblios with interleaved holdings. Test plan: 1.) Import the MARCXML file attached to the bug with the -holdings parameter: misc/migration_tools/bulkmarcimport.pl -biblios -holdings -file holdings.xml -m MARCXML 2.) Verify that the holdings records were imported. 3.) Export the same records with holdings: misc/export_records.pl --record-type=bibs --starting_biblionumber 103 --ending_biblionumber 104 --filename=holdings_export.xml --format=xml --holdings 4.) Verify that both bibliographic and holding records are exported. 5.) Verify that tests in t/db_dependent/Exporter/Record.t pass.
Created attachment 78740 [details] [review] Bug 20447: Include basic summary holdings in the OAI-PMH responses. https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20447 If include_items is set in oai conf, also basic location information from holdings records is included in the returned MARC records.
Note that what's currently displayed in OPAC from holdings is pretty basic and can be extended as necessary. What's displayed is controlled by the framework, and the fields currently available are public_note, summary, supplements and indexes.
Created attachment 78907 [details] [review] Bug 20447: Ignore holdings records in staff UI when staging records Importing holdings is not a typical action and can be done with bulk import if necessary.
The patch appies fine. I have been able to import the marxcml file I have been able to export the marcxml file I am able to turn on summary holding on syspref I am able to see the marc holdings on the intraner BUT I am not able to see the marc holdings at the opac I think the marc framework that works with holdings should be 'fixed' review mandatory fields and duplicables fields... I have duplicated 852 and I guett an error DBIx::Class::Schema::source(): Can't find source for HoldingsMetadata at /home/vagrant/kohaclone/Koha/Objects.pm line 341 at /usr/share/perl5/DBIx/Class/Exception.pm line 77 PENDING CHECKING OAI thanks a lot for this patch
Hugo, did you run the databse updates (perl installer/data/mysql/updatedatabase.pl) and DBIx class updates (perl misc/devel/update_dbix_class_files.pl ...)? That'll be required for things to work properly. I'm asking because I don't get an error with multiple 852 fields, and that's actually a repeatable field according to the standard.
Created attachment 79403 [details] [review] Bug 20447: Add a batch rebuild script for holdings table. This script can be used to update the columns in the holdings table from the MARC record using the rules in the framework. In practice this will only be required if the koha link field is changed in the framework, and that's disabled in the UI so it must be done in the database.
Created attachment 79413 [details] [review] Bug 20447: Add missing fields to the holdings framework Adds fields 337, 338, 347, 5xx and 84x.
Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 20447: MARC Holdings support Using index info to reconstruct a base tree... M Koha/Schema/Result/Deleteditem.pm M Koha/Schema/Result/Item.pm M installer/data/mysql/kohastructure.sql M koha-tmpl/intranet-tmpl/prog/en/modules/admin/biblio_framework.tt M koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref Falling back to patching base and 3-way merge... Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/admin/biblio_framework.tt Auto-merging installer/data/mysql/kohastructure.sql Auto-merging Koha/Schema/Result/Item.pm CONFLICT (content): Merge conflict in Koha/Schema/Result/Item.pm Auto-merging Koha/Schema/Result/Deleteditem.pm CONFLICT (content): Merge conflict in Koha/Schema/Result/Deleteditem.pm Failed to merge in the changes. Patch failed at 0001 Bug 20447: MARC Holdings support The copy of the patch that failed is found in: /home/vagrant/kohaclone/.git/rebase-apply/patch When you have resolved this problem run "git bz apply --continue". If you would prefer to skip this patch, instead run "git bz apply --skip". To restore the original branch and stop patching run "git bz apply --abort". Patch left in /tmp/Bug-20447-MARC-Holdings-support-B8w5Re.patch
Created attachment 79565 [details] [review] Bug 20447: MARC Holdings support https://bugs.koha-community.org/show_bug.cgi?id=20447 Enable by setting "SummaryHoldings" option to "Use".
Created attachment 79566 [details] [review] Bug 20447: Add import/export support for holdings https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20447 Adds support for importing and exporting biblios with interleaved holdings. Test plan: 1.) Import the MARCXML file attached to the bug with the -holdings parameter: misc/migration_tools/bulkmarcimport.pl -biblios -holdings -file holdings.xml -m MARCXML 2.) Verify that the holdings records were imported. 3.) Export the same records with holdings: misc/export_records.pl --record-type=bibs --starting_biblionumber 103 --ending_biblionumber 104 --filename=holdings_export.xml --format=xml --holdings 4.) Verify that both bibliographic and holding records are exported. 5.) Verify that tests in t/db_dependent/Exporter/Record.t pass.
Created attachment 79567 [details] [review] Bug 20447: Include basic summary holdings in the OAI-PMH responses. https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20447 If include_items is set in oai conf, also basic location information from holdings records is included in the returned MARC records.
Created attachment 79568 [details] [review] Bug 20447: Ignore holdings records in staff UI when staging records Importing holdings is not a typical action and can be done with bulk import if necessary.
Created attachment 79569 [details] [review] Bug 20447: Add a batch rebuild script for holdings table. This script can be used to update the columns in the holdings table from the MARC record using the rules in the framework. In practice this will only be required if the koha link field is changed in the framework, and that's disabled in the UI so it must be done in the database.
Created attachment 79570 [details] [review] Bug 20447: Add missing fields to the holdings framework Adds fields 337, 338, 347, 5xx and 84x.
Updated the patches to remove schema changes. Please run misc/devel/update_dbix_class_files.pl to update the schema files when testing.
Created attachment 79812 [details] [review] Bug 20447: MARC Holdings support https://bugs.koha-community.org/show_bug.cgi?id=20447 Enable by setting "SummaryHoldings" option to "Use".
Created attachment 79813 [details] [review] Bug 20447: Add import/export support for holdings https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20447 Adds support for importing and exporting biblios with interleaved holdings. Test plan: 1.) Import the MARCXML file attached to the bug with the -holdings parameter: misc/migration_tools/bulkmarcimport.pl -biblios -holdings -file holdings.xml -m MARCXML 2.) Verify that the holdings records were imported. 3.) Export the same records with holdings: misc/export_records.pl --record-type=bibs --starting_biblionumber 103 --ending_biblionumber 104 --filename=holdings_export.xml --format=xml --holdings 4.) Verify that both bibliographic and holding records are exported. 5.) Verify that tests in t/db_dependent/Exporter/Record.t pass.
Created attachment 79814 [details] [review] Bug 20447: Include basic summary holdings in the OAI-PMH responses. https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20447 If include_items is set in oai conf, also basic location information from holdings records is included in the returned MARC records.
Created attachment 79815 [details] [review] Bug 20447: Ignore holdings records in staff UI when staging records Importing holdings is not a typical action and can be done with bulk import if necessary.
Created attachment 79816 [details] [review] Bug 20447: Add a batch rebuild script for holdings table. This script can be used to update the columns in the holdings table from the MARC record using the rules in the framework. In practice this will only be required if the koha link field is changed in the framework, and that's disabled in the UI so it must be done in the database.
I consolidated fixes into the patches. Latest patches include the following changes: - Make sure to write 1 or 0 to the suppress column - Take holdings timestamps into account in OAI-PMH
Created attachment 79819 [details] [review] Bug 20447: Add a batch rebuild script for holdings table. This script can be used to update the columns in the holdings table from the MARC record using the rules in the framework. In practice this will only be required if the koha link field is changed in the framework, and that's disabled in the UI so it must be done in the database.
Created attachment 80320 [details] [review] Bug 20447: MARC Holdings support https://bugs.koha-community.org/show_bug.cgi?id=20447 Enable by setting "SummaryHoldings" option to "Use".
Created attachment 80321 [details] [review] Bug 20447: Add import/export support for holdings https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20447 Adds support for importing and exporting biblios with interleaved holdings. Test plan: 1.) Import the MARCXML file attached to the bug with the -holdings parameter: misc/migration_tools/bulkmarcimport.pl -biblios -holdings -file holdings.xml -m MARCXML 2.) Verify that the holdings records were imported. 3.) Export the same records with holdings: misc/export_records.pl --record-type=bibs --starting_biblionumber 103 --ending_biblionumber 104 --filename=holdings_export.xml --format=xml --holdings 4.) Verify that both bibliographic and holding records are exported. 5.) Verify that tests in t/db_dependent/Exporter/Record.t pass.
Created attachment 80322 [details] [review] Bug 20447: Include basic summary holdings in the OAI-PMH responses. https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20447 If include_items is set in oai conf, also basic location information from holdings records is included in the returned MARC records.
Created attachment 80323 [details] [review] Bug 20447: Ignore holdings records in staff UI when staging records Importing holdings is not a typical action and can be done with bulk import if necessary.
Created attachment 80324 [details] [review] Bug 20447: Add a batch rebuild script for holdings table. This script can be used to update the columns in the holdings table from the MARC record using the rules in the framework. In practice this will only be required if the koha link field is changed in the framework, and that's disabled in the UI so it must be done in the database.
Latest version contains the following fixes: - Add missing 0xx fields to the holdings framework - Fix the documentation links (question marks) in the MARC editor - Fix title and breadcrumb when modifying a holdings record - Include more fields in the call number to display - Fix Items tab name when holdings are enabled - Handle holdings when moving items from a biblio to another
Created attachment 80823 [details] [review] Bug 20447: MARC Holdings support https://bugs.koha-community.org/show_bug.cgi?id=20447 Enable by setting "SummaryHoldings" option to "Use".
Created attachment 80824 [details] [review] Bug 20447: Add import/export support for holdings https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20447 Adds support for importing and exporting biblios with interleaved holdings. Test plan: 1.) Import the MARCXML file attached to the bug with the -holdings parameter: misc/migration_tools/bulkmarcimport.pl -biblios -holdings -file holdings.xml -m MARCXML 2.) Verify that the holdings records were imported. 3.) Export the same records with holdings: misc/export_records.pl --record-type=bibs --starting_biblionumber 103 --ending_biblionumber 104 --filename=holdings_export.xml --format=xml --holdings 4.) Verify that both bibliographic and holding records are exported. 5.) Verify that tests in t/db_dependent/Exporter/Record.t pass.
Created attachment 80825 [details] [review] Bug 20447: Include basic summary holdings in the OAI-PMH responses. https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20447 If include_items is set in oai conf, also basic location information from holdings records is included in the returned MARC records.
Created attachment 80826 [details] [review] Bug 20447: Ignore holdings records in staff UI when staging records Importing holdings is not a typical action and can be done with bulk import if necessary.
Created attachment 80827 [details] [review] Bug 20447: Add a batch rebuild script for holdings table. This script can be used to update the columns in the holdings table from the MARC record using the rules in the framework. In practice this will only be required if the koha link field is changed in the framework, and that's disabled in the UI so it must be done in the database.
The latest version adds ccode column to holdings for parity with items location fields. Also upgrade script no longer contains framework data duplicated from the default framework sql and after a lot of deliberation branch code has been moved from 852$a to 852$b and location from 852$b to 852$c by default so that 852$a can be reserved for an ISIL code or such.
Created attachment 81264 [details] [review] Bug 20447: MARC Holdings support https://bugs.koha-community.org/show_bug.cgi?id=20447 Enable by setting "SummaryHoldings" option to "Use".
Created attachment 81265 [details] [review] Bug 20447: Add import/export support for holdings https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20447 Adds support for importing and exporting biblios with interleaved holdings. Test plan: 1.) Import the MARCXML file attached to the bug with the -holdings parameter: misc/migration_tools/bulkmarcimport.pl -biblios -holdings -file holdings.xml -m MARCXML 2.) Verify that the holdings records were imported. 3.) Export the same records with holdings: misc/export_records.pl --record-type=bibs --starting_biblionumber 103 --ending_biblionumber 104 --filename=holdings_export.xml --format=xml --holdings 4.) Verify that both bibliographic and holding records are exported. 5.) Verify that tests in t/db_dependent/Exporter/Record.t pass.
Created attachment 81266 [details] [review] Bug 20447: Include basic summary holdings in the OAI-PMH responses. https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20447 If include_items is set in oai conf, also basic location information from holdings records is included in the returned MARC records.
Created attachment 81267 [details] [review] Bug 20447: Ignore holdings records in staff UI when staging records Importing holdings is not a typical action and can be done with bulk import if necessary.
Created attachment 81268 [details] [review] Bug 20447: Add a batch rebuild script for holdings table. This script can be used to update the columns in the holdings table from the MARC record using the rules in the framework. In practice this will only be required if the koha link field is changed in the framework, and that's disabled in the UI so it must be done in the database.
Created attachment 82669 [details] [review] Bug 20447: MARC Holdings support https://bugs.koha-community.org/show_bug.cgi?id=20447 Enable by setting "SummaryHoldings" option to "Use".
Created attachment 82670 [details] [review] Bug 20447: Add import/export support for holdings https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20447 Adds support for importing and exporting biblios with interleaved holdings. Test plan: 1.) Import the MARCXML file attached to the bug with the -holdings parameter: misc/migration_tools/bulkmarcimport.pl -biblios -holdings -file holdings.xml -m MARCXML 2.) Verify that the holdings records were imported. 3.) Export the same records with holdings: misc/export_records.pl --record-type=bibs --starting_biblionumber 103 --ending_biblionumber 104 --filename=holdings_export.xml --format=xml --holdings 4.) Verify that both bibliographic and holding records are exported. 5.) Verify that tests in t/db_dependent/Exporter/Record.t pass.
Created attachment 82671 [details] [review] Bug 20447: Include basic summary holdings in the OAI-PMH responses. https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20447 If include_items is set in oai conf, also basic location information from holdings records is included in the returned MARC records.
Created attachment 82672 [details] [review] Bug 20447: Ignore holdings records in staff UI when staging records Importing holdings is not a typical action and can be done with bulk import if necessary.
Created attachment 82673 [details] [review] Bug 20447: Add a batch rebuild script for holdings table. This script can be used to update the columns in the holdings table from the MARC record using the rules in the framework. In practice this will only be required if the koha link field is changed in the framework, and that's disabled in the UI so it must be done in the database.
Hi Ere, I tested patches and import seem be ok. But Test fails: t/db_dependent/Exporter/Record.t .. DBD::mysql::st execute failed: Cannot add or update a child row: a foreign key constraint fails (`koha_kohadev`.`holdings`, CONSTRAINT `holdings_ibfk_3` FOREIGN KEY (`holdingbranch`) REFERENCES `branches` (`branchcode`) ON UPDATE CASCADE) [for Statement "INSERT INTO holdings SET biblionumber = ?, biblioitemnumber = ?, frameworkcode = ?, holdingbranch = ?, location = ?, ccode = ?, callnumber = ?, suppress = ?, datecreated = NOW() " with ParamValues: 0='442', 1=441, 2='', 3="Location", 4=undef, 5=undef, 6="Tb | 1973", 7=0] at /home/vagrant/kohaclone/C4/Holdings.pm line 503. ERROR in _koha_add_holding INSERT INTO holdings SET biblionumber = ?, biblioitemnumber = ?, frameworkcode = ?, holdingbranch = ?, location = ?, ccode = ?, callnumber = ?, suppress = ?, datecreated = NOW() Cannot add or update a child row: a foreign key constraint fails (`koha_kohadev`.`holdings`, CONSTRAINT `holdings_ibfk_3` FOREIGN KEY (`holdingbranch`) REFERENCES `branches` (`branchcode`) ON UPDATE CASCADE) at /home/vagrant/kohaclone/C4/Holdings.pm line 509. DBD::mysql::st execute failed: Cannot add or update a child row: a foreign key constraint fails (`koha_kohadev`.`holdings_metadata`, CONSTRAINT `holdings_metadata_fk_1` FOREIGN KEY (`holding_id`) REFERENCES `holdings` (`holding_id`) ON DELETE CASCADE ON UPDATE CASCADE) [for Statement "INSERT INTO `holdings_metadata` ( `format`, `holding_id`, `marcflavour`, `metadata`) VALUES ( ?, ?, ?, ? )" with ParamValues: 0='marcxml', 1='442', 2='MARC21', 3="<?xml version="1.0" encoding="UTF-8"?> Can You give me feedback? Thank You Mike
Created attachment 83550 [details] [review] Bug 20447: MARC Holdings support https://bugs.koha-community.org/show_bug.cgi?id=20447 Enable by setting "SummaryHoldings" option to "Use". Sponsored-by: The National Library of Finland
Created attachment 83551 [details] [review] Bug 20447: Add import/export support for holdings https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20447 Adds support for importing and exporting biblios with interleaved holdings. Test plan: 1.) Import the MARCXML file attached to the bug with the -holdings parameter: misc/migration_tools/bulkmarcimport.pl -biblios -holdings -file holdings.xml -m MARCXML 2.) Verify that the holdings records were imported. 3.) Export the same records with holdings: misc/export_records.pl --record-type=bibs --starting_biblionumber 103 --ending_biblionumber 104 --filename=holdings_export.xml --format=xml --holdings 4.) Verify that both bibliographic and holding records are exported. 5.) Verify that tests in t/db_dependent/Exporter/Record.t pass.
Created attachment 83552 [details] [review] Bug 20447: Include basic summary holdings in the OAI-PMH responses. https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20447 If include_items is set in oai conf, also basic location information from holdings records is included in the returned MARC records.
Created attachment 83553 [details] [review] Bug 20447: Ignore holdings records in staff UI when staging records Importing holdings is not a typical action and can be done with bulk import if necessary.
Created attachment 83554 [details] [review] Bug 20447: Add a batch rebuild script for holdings table. This script can be used to update the columns in the holdings table from the MARC record using the rules in the framework. In practice this will only be required if the koha link field is changed in the framework, and that's disabled in the UI so it must be done in the database.
Hi Mike, and thanks for testing. I had accidentally broken the tests, should be fixed and improved now.
Created attachment 83555 [details] [review] Bug 20447: MARC Holdings support https://bugs.koha-community.org/show_bug.cgi?id=20447 Enable by setting "SummaryHoldings" option to "Use". Sponsored-by: The National Library of Finland Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 83556 [details] [review] Bug 20447: Add import/export support for holdings https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20447 Adds support for importing and exporting biblios with interleaved holdings. Test plan: 1.) Import the MARCXML file attached to the bug with the -holdings parameter: misc/migration_tools/bulkmarcimport.pl -biblios -holdings -file holdings.xml -m MARCXML 2.) Verify that the holdings records were imported. 3.) Export the same records with holdings: misc/export_records.pl --record-type=bibs --starting_biblionumber 103 --ending_biblionumber 104 --filename=holdings_export.xml --format=xml --holdings 4.) Verify that both bibliographic and holding records are exported. 5.) Verify that tests in t/db_dependent/Exporter/Record.t pass. Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 83557 [details] [review] Bug 20447: Include basic summary holdings in the OAI-PMH responses. https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20447 If include_items is set in oai conf, also basic location information from holdings records is included in the returned MARC records. Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 83558 [details] [review] Bug 20447: Ignore holdings records in staff UI when staging records Importing holdings is not a typical action and can be done with bulk import if necessary. Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 83559 [details] [review] Bug 20447: Add a batch rebuild script for holdings table. This script can be used to update the columns in the holdings table from the MARC record using the rules in the framework. In practice this will only be required if the koha link field is changed in the framework, and that's disabled in the UI so it must be done in the database. Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com>
So, started the first QA run ;) First of all, I really like this enhancement and would to see it in Koha. But this need some more work I think, first some not critical and easy to fix: - System preference SummaryHoldings is missing in db updates - Holdings marc framework is missing from db update - Schema files should be attached in its own patch - I do not like using subfield "V" as default for linking item to holding, uppercase letters for subfields are not possible in marc21 standard But, the main problem I see here is C4::Holdings module - C4 namespace is deprecated, and should not be used for new modules, you always should add the new modules into Koha namespace and use objects if possible and if it does make sense, of course. You already have Koha::Holdings and Koha::Holdings::Metadatas, so you should add new routines here (in the Koha::Objects(s) manner). See also bug 22144, that's the way the holdings, holding::metadatas and its marc record object should be linked together too.
Ok, I'll revise.
Created attachment 85364 [details] Sample MARCXML file with interleaved holdings
Created attachment 85368 [details] [review] Bug 20447: MARC Holdings support Enable by setting "SummaryHoldings" option to "Use".
Created attachment 85369 [details] [review] Bug 20447: Add a batch rebuild script for holdings table. This script can be used to update the columns in the holdings table from the MARC record using the rules in the framework. In practice this will only be required if the koha link field is changed in the framework.
Created attachment 85370 [details] [review] Bug 20447: Add import/export support for holdings https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20447 Adds support for importing and exporting biblios with interleaved holdings. Test plan: 1.) Import the MARCXML file attached to the bug with the -holdings parameter: misc/migration_tools/bulkmarcimport.pl -biblios -holdings -file holdings.xml -m MARCXML 2.) Verify that the holdings records were imported. 3.) Export the same records with holdings: misc/export_records.pl --record-type=bibs --starting_biblionumber 103 --ending_biblionumber 104 --filename=holdings_export.xml --format=xml --holdings 4.) Verify that both bibliographic and holding records are exported. 5.) Verify that tests in t/db_dependent/Exporter/Record.t pass.
Created attachment 85371 [details] [review] Bug 20447: DBIX schema changes
Almost there. I missed addition of holdings framework to update scripts, so clearing status until I get that fixed.
Created attachment 85416 [details] [review] Bug 20447: MARC Holdings support Enable by setting "SummaryHoldings" option to "Use".
Created attachment 85417 [details] [review] Bug 20447: Add a batch rebuild script for holdings table. This script can be used to update the columns in the holdings table from the MARC record using the rules in the framework. In practice this will only be required if the koha link field is changed in the framework.
Created attachment 85418 [details] [review] Bug 20447: Add import/export support for holdings https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20447 Adds support for importing and exporting biblios with interleaved holdings. Test plan: 1.) Import the MARCXML file attached to the bug with the -holdings parameter: misc/migration_tools/bulkmarcimport.pl -biblios -holdings -file holdings.xml -m MARCXML 2.) Verify that the holdings records were imported. 3.) Export the same records with holdings: misc/export_records.pl --record-type=bibs --starting_biblionumber 103 --ending_biblionumber 104 --filename=holdings_export.xml --format=xml --holdings 4.) Verify that both bibliographic and holding records are exported. 5.) Verify that tests in t/db_dependent/Exporter/Record.t pass.
Created attachment 85419 [details] [review] Bug 20447: DBIX schema changes
All QA comments should now be addressed. I've converted everything to Koha namespace and cleaned up the code heavily. There are still some references to existing code in C4 namespace, but that's difficult to avoid at the moment. I had to come up with a method for updating metadata, and I hope what I came up with is nice and clean, but it can still be adjusted especially when C4::Biblio is converted to keep them as similar as possible. Functional changes from previous versions: - Subfield 'k' is now used for linking from item to holdings record. While its position is not so nice in the item form, it was the only subfield available. - biblioitemnumber has been dropped from the holdings table since it wasn't used.
One thing that could be done would be to decouple the MARC editor from addbiblio so that the code could be re-used. I'll see if that's something that could be done with not too high impact.
I'll work in Bug 21280 to unify the MARC editors in biblios and authorities. I don't consider it blocking, but if it happened that it would be accepted, I would update the editor here to use the common stuff.
Created attachment 85906 [details] [review] Bug 20447: MARC Holdings support Enable by setting "SummaryHoldings" option to "Use".
Created attachment 85907 [details] [review] Bug 20447: Add a batch rebuild script for holdings table. This script can be used to update the columns in the holdings table from the MARC record using the rules in the framework. In practice this will only be required if the koha link field is changed in the framework.
Created attachment 85908 [details] [review] Bug 20447: Add import/export support for holdings https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20447 Adds support for importing and exporting biblios with interleaved holdings. Test plan: 1.) Import the MARCXML file attached to the bug with the -holdings parameter: misc/migration_tools/bulkmarcimport.pl -biblios -holdings -file holdings.xml -m MARCXML 2.) Verify that the holdings records were imported. 3.) Export the same records with holdings: misc/export_records.pl --record-type=bibs --starting_biblionumber 103 --ending_biblionumber 104 --filename=holdings_export.xml --format=xml --holdings 4.) Verify that both bibliographic and holding records are exported. 5.) Verify that tests in t/db_dependent/Exporter/Record.t pass.
Created attachment 85909 [details] [review] Bug 20447: DBIX schema changes
Created attachment 85994 [details] [review] Bug 20447: MARC Holdings support Enable by setting "SummaryHoldings" option to "Use". Sponsored-by: The National Library of Finland
Created attachment 85995 [details] [review] Bug 20447: Add a batch rebuild script for holdings table. This script can be used to update the columns in the holdings table from the MARC record using the rules in the framework. In practice this will only be required if the koha link field is changed in the framework.
Created attachment 85996 [details] [review] Bug 20447: Add import/export support for holdings https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20447 Adds support for importing and exporting biblios with interleaved holdings. Test plan: 1.) Import the MARCXML file attached to the bug with the -holdings parameter: misc/migration_tools/bulkmarcimport.pl -biblios -holdings -file holdings.xml -m MARCXML 2.) Verify that the holdings records were imported. 3.) Export the same records with holdings: misc/export_records.pl --record-type=bibs --starting_biblionumber 103 --ending_biblionumber 104 --filename=holdings_export.xml --format=xml --holdings 4.) Verify that both bibliographic and holding records are exported. 5.) Verify that tests in t/db_dependent/Exporter/Record.t pass.
Created attachment 85997 [details] [review] Bug 20447: DBIX schema changes
Why is there deleted_on on in both holdings and holdings_metadata tables? Why is it not enough to have it just in holdings?
Comment on attachment 85994 [details] [review] Bug 20447: MARC Holdings support Review of attachment 85994 [details] [review]: ----------------------------------------------------------------- ::: C4/Biblio.pm @@ +1563,5 @@ > } > > + #---- holdings > + if ( $tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "holdings" ) { > + my $holding = Koha::Holdings->find( $value ); does the find need "deleted_on => undef" as a parameter in order to not care about deleted holdings?
Comment on attachment 85994 [details] [review] Bug 20447: MARC Holdings support Review of attachment 85994 [details] [review]: ----------------------------------------------------------------- ::: C4/Items.pm @@ +1705,5 @@ > + holdingbranch => $oldHolding->{'holdingbranch'}, > + location => $oldHolding->{'location'}, > + callnumber => $oldHolding->{'callnumber'}, > + suppress => $oldHolding->{'suppress'}, > + deleted_on => undef if deleted_on is not needed / is undef by default this can be removed
(In reply to Joonas Kylmälä from comment #97) > Why is there deleted_on on in both holdings and holdings_metadata tables? > Why is it not enough to have it just in holdings? Because that's how it's done also for biblios in bug 20271. There's at least one practical upside: it allows one to fetch a metadata record without joining with the base table.
(In reply to Joonas Kylmälä from comment #98) > Comment on attachment 85994 [details] [review] [review] > Bug 20447: MARC Holdings support > > Review of attachment 85994 [details] [review] [review]: > ----------------------------------------------------------------- > > ::: C4/Biblio.pm > @@ +1563,5 @@ > > } > > > > + #---- holdings > > + if ( $tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "holdings" ) { > > + my $holding = Koha::Holdings->find( $value ); > > does the find need "deleted_on => undef" as a parameter in order to not care > about deleted holdings? It allows one to fetch a holdings record by ID even if it's deleted. I believe it makes sense since otherwise it would be possible, at least in theory, for an item to point to a deleted holdings record without it showing.
(In reply to Joonas Kylmälä from comment #99) > Comment on attachment 85994 [details] [review] [review] > Bug 20447: MARC Holdings support > > Review of attachment 85994 [details] [review] [review]: > ----------------------------------------------------------------- > > ::: C4/Items.pm > @@ +1705,5 @@ > > + holdingbranch => $oldHolding->{'holdingbranch'}, > > + location => $oldHolding->{'location'}, > > + callnumber => $oldHolding->{'callnumber'}, > > + suppress => $oldHolding->{'suppress'}, > > + deleted_on => undef > > if deleted_on is not needed / is undef by default this can be removed It tries to find an existing holdings record for the item to be attached to. Deleted holdings do not qualify, so the filter is needed. However, I just realized that the search terms can match multiple records which would cause find() to fail. I need to revise that.
(In reply to Ere Maijala from comment #100) > (In reply to Joonas Kylmälä from comment #97) > > Why is there deleted_on on in both holdings and holdings_metadata tables? > > Why is it not enough to have it just in holdings? > > Because that's how it's done also for biblios in bug 20271. There's at least > one practical upside: it allows one to fetch a metadata record without > joining with the base table. #1 rule in my database course was always use the normal form for databases. It feels wrong to have the data in one place: twice the possibility of having bugs and also taking twice as much space. I read quickly https://stackoverflow.com/questions/2623852/why-are-joins-bad-when-considering-scalability and in the end the performance difference might not be that big. I would like you to provide performance benchmarks if we are going to use the non-normalized way.
(In reply to Joonas Kylmälä from comment #103) > #1 rule in my database course was always use the normal form for databases. > It feels wrong to have the data in one place: twice the possibility of > having bugs and also taking twice as much space. I read quickly > https://stackoverflow.com/questions/2623852/why-are-joins-bad-when- > considering-scalability and in the end the performance difference might not > be that big. I would like you to provide performance benchmarks if we are > going to use the non-normalized way. Here is a few pages of reasoning why we should use the normal form: https://mariadb.com/kb/en/library/database-normalization/ (unless there is a significant performance gain)
I'm aware of that, but I'm not making the call here. I think it would be better to continue discussion about the deleted_on field in the metadata tables in bug 20271.
Created attachment 86088 [details] [review] Bug 20447: MARC Holdings support Enable by setting "SummaryHoldings" option to "Use". Sponsored-by: The National Library of Finland
Created attachment 86089 [details] [review] Bug 20447: Add a batch rebuild script for holdings table. This script can be used to update the columns in the holdings table from the MARC record using the rules in the framework. In practice this will only be required if the koha link field is changed in the framework.
Created attachment 86090 [details] [review] Bug 20447: Add import/export support for holdings https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20447 Adds support for importing and exporting biblios with interleaved holdings. Test plan: 1.) Import the MARCXML file attached to the bug with the -holdings parameter: misc/migration_tools/bulkmarcimport.pl -biblios -holdings -file holdings.xml -m MARCXML 2.) Verify that the holdings records were imported. 3.) Export the same records with holdings: misc/export_records.pl --record-type=bibs --starting_biblionumber 103 --ending_biblionumber 104 --filename=holdings_export.xml --format=xml --holdings 4.) Verify that both bibliographic and holding records are exported. 5.) Verify that tests in t/db_dependent/Exporter/Record.t pass.
Created attachment 86091 [details] [review] Bug 20447: DBIX schema changes
Fixed item relinking and made saving a holdings record reindex its biblio record.
Ere, please rebase on master. Thank you.
Auto-merging Koha/Schema/Result/Branch.pm CONFLICT (content): Merge conflict in Koha/Schema/Result/Branch.pm Auto-merging Koha/Schema/Result/Biblio.pm CONFLICT (content): Merge conflict in Koha/Schema/Result/Biblio.pm error: Failed to merge in the changes. Patch failed at 0001 Bug 20447: DBIX schema changes
(In reply to Michal Denar from comment #112) > Auto-merging Koha/Schema/Result/Branch.pm > CONFLICT (content): Merge conflict in Koha/Schema/Result/Branch.pm > Auto-merging Koha/Schema/Result/Biblio.pm > CONFLICT (content): Merge conflict in Koha/Schema/Result/Biblio.pm > error: Failed to merge in the changes. > Patch failed at 0001 Bug 20447: DBIX schema changes Mike, these files could be easily regeneretad, just omit this one patch and run command 'dbic' on kohadevbox
Created attachment 87307 [details] [review] Bug 20447: MARC Holdings support Enable by setting "SummaryHoldings" option to "Use". Sponsored-by: The National Library of Finland
Created attachment 87308 [details] [review] Bug 20447: Add a batch rebuild script for holdings table. This script can be used to update the columns in the holdings table from the MARC record using the rules in the framework. In practice this will only be required if the koha link field is changed in the framework.
Created attachment 87309 [details] [review] Bug 20447: Add import/export support for holdings https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20447 Adds support for importing and exporting biblios with interleaved holdings. Test plan: 1.) Import the MARCXML file attached to the bug with the -holdings parameter: misc/migration_tools/bulkmarcimport.pl -biblios -holdings -file holdings.xml -m MARCXML 2.) Verify that the holdings records were imported. 3.) Export the same records with holdings: misc/export_records.pl --record-type=bibs --starting_biblionumber 103 --ending_biblionumber 104 --filename=holdings_export.xml --format=xml --holdings 4.) Verify that both bibliographic and holding records are exported. 5.) Verify that tests in t/db_dependent/Exporter/Record.t pass.
Created attachment 87310 [details] [review] Bug 20447: DBIX schema changes
Rebased, but the schema patch is likely to break again..
Hi Ere, tests passed, but I'm not able to import attached files: kohadev-koha@kohadevbox:/home/vagrant/kohaclone$ misc/migration_tools/bulkmarcimport.pl -biblios -holdings -file holdings.xml -m MARCXML 0 MARC bibliographic records and 0 holdings records done in 0.012 seconds Any ideas? Thank you.
A couple of simple checks first: check that you have holdings.xml in the current directory and that it's valid xml. bulkmarcimport doesn't have very good error checking and it will just report 0 records if it doesn't find the file or can't read it. For what it's worth, here are my results: $ xmllint -noout holdings.xml $ misc/migration_tools/bulkmarcimport.pl -biblios -holdings -file holdings.xml -m MARCXML ..... 5 MARC bibliographic records and 3 holdings records done in 1.711 seconds If you are still unable to make it work, I'll need to recheck with kohadevbox.
Hi Ere, sorry my fault., no holdings.xml on devbox :-( I'll next round... Thanks to Josef for kick.
Created attachment 87346 [details] [review] Bug 20447: MARC Holdings support Enable by setting "SummaryHoldings" option to "Use". Sponsored-by: The National Library of Finland Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 87347 [details] [review] Bug 20447: Add a batch rebuild script for holdings table. This script can be used to update the columns in the holdings table from the MARC record using the rules in the framework. In practice this will only be required if the koha link field is changed in the framework. Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 87348 [details] [review] Bug 20447: Add import/export support for holdings https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20447 Adds support for importing and exporting biblios with interleaved holdings. Test plan: 1.) Import the MARCXML file attached to the bug with the -holdings parameter: misc/migration_tools/bulkmarcimport.pl -biblios -holdings -file holdings.xml -m MARCXML 2.) Verify that the holdings records were imported. 3.) Export the same records with holdings: misc/export_records.pl --record-type=bibs --starting_biblionumber 103 --ending_biblionumber 104 --filename=holdings_export.xml --format=xml --holdings 4.) Verify that both bibliographic and holding records are exported. 5.) Verify that tests in t/db_dependent/Exporter/Record.t pass. Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 87349 [details] [review] Bug 20447: DBIX schema changes Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com>
Comment on attachment 87346 [details] [review] Bug 20447: MARC Holdings support Review of attachment 87346 [details] [review]: ----------------------------------------------------------------- ::: C4/Biblio.pm @@ +2828,5 @@ > > $itemnumbers = [] unless defined $itemnumbers; > > + if ( !$skip_holdings && C4::Context->preference('SummaryHoldings') && !@$itemnumbers ) { > + require Koha::Holdings; You don't need this require ::: C4/Items.pm @@ +1690,5 @@ > AND biblionumber = ? > |, undef, $tobiblioitem, $tobiblio, $itemnumber, $frombiblio ); > if ($return == 1) { > + # Check if the moved item is attached to a holdings record > + my $item = my $item = Koha::Items->find($itemnumber); double "my $item" ::: C4/Search.pm @@ +2252,5 @@ > } > > + # Fetch summary holdings > + if (C4::Context->preference('SummaryHoldings')) { > + $summary_holdings = Koha::Holdings->search({ biblionumber => $oldbiblio->{biblionumber}, deleted_on => undef })->unblessed; why do you unbless here? ::: Koha/Holding.pm @@ +53,5 @@ > + my ($self) = @_; > + > + $self->{_metadata} ||= Koha::Holdings::Metadatas->find({ holding_id => $self->id }); > + > + return $self->{_metadata}; Should be changed, according to bug 22407, see https://wiki.koha-community.org/wiki/Coding_Guidelines#PERL15:_Object-oriented_code_and_the_Koha::_namespace You should use something like my $metadata = $self->_result->metadata; return Koha::Holdings::Metadata->_new_from_dbic($metadata); @@ +111,5 @@ > + my ($self) = @_; > + > + $self->{_items} ||= Koha::Items->search( { holding_id => $self->holding_id() } ); > + > + return wantarray ? $self->{_items}->as_list : $self->{_items}; PERL15 rule applies here too ::: Koha/Template/Plugin/Holdings.pm @@ +71,5 @@ > + my $sth = C4::Context->dbh->prepare($query); > + $sth->execute($holding->{'holdingbranch'}); > + my $b = $sth->fetchrow_hashref(); > + push @parts, $b->{'branchname'} if $b; > + $sth->finish(); Why do you use sql instead of relation method like $holding->library ? ::: catalogue/detail.pl @@ +194,5 @@ > > +# Summary holdings > +my $summary_holdings; > +if (C4::Context->preference('SummaryHoldings')) { > + $summary_holdings = Koha::Holdings->search({ biblionumber => $biblionumber, deleted_on => undef })->unblessed; Why do you unbless? ::: t/db_dependent/Koha/Holding.t @@ +22,5 @@ > +use t::lib::TestBuilder; > + > +use C4::Biblio; > + > +use Koha::BiblioFramework; Singular class is imported through plural class, it is not needed to be used explicitaly. ::: t/db_dependent/Koha/Holdings.t @@ +22,5 @@ > +use t::lib::TestBuilder; > + > +use C4::Biblio; > + > +use Koha::BiblioFramework; Not needed to use singular class
Started QA, found some first issues: When editing holding marc record, i am able to change framework to default and acquisition, is it intended? The holdings marc editor need to be upgraded to new style introduce by bug 22045. Could be done in own bug report or on bug 21280 I think. QA test tools report: FAIL C4/Biblio.pm FAIL valid "my" variable $item masks earlier declaration in same statement FAIL C4/ImportBatch.pm FAIL valid "my" variable $item masks earlier declaration in same statement FAIL C4/Items.pm FAIL valid "my" variable $item masks earlier declaration in same statement "my" variable $item masks earlier declaration in same statement FAIL C4/Search.pm FAIL valid "my" variable $item masks earlier declaration in same statement FAIL C4/XSLT.pm FAIL valid "my" variable $item masks earlier declaration in same statement FAIL Koha/Exporter/Record.pm FAIL valid "my" variable $item masks earlier declaration in same statement FAIL Koha/Holdings.pm FAIL valid "my" variable $item masks earlier declaration in same statement FAIL Koha/OAI/Server/ListBase.pm FAIL valid "my" variable $item masks earlier declaration in same statement FAIL Koha/OAI/Server/Repository.pm FAIL valid "my" variable $item masks earlier declaration in same statement FAIL Koha/Template/Plugin/Holdings.pm FAIL valid "my" variable $item masks earlier declaration in same statement FAIL admin/marc_subfields_structure.pl FAIL valid "my" variable $item masks earlier declaration in same statement FAIL catalogue/detail.pl FAIL valid "my" variable $item masks earlier declaration in same statement FAIL catalogue/showmarc.pl FAIL valid "my" variable $item masks earlier declaration in same statement FAIL cataloguing/addholding.pl FAIL valid "my" variable $item masks earlier declaration in same statement FAIL cataloguing/additem.pl FAIL valid "my" variable $item masks earlier declaration in same statement FAIL cataloguing/value_builder/marc21_field_008_holdings.pl FAIL valid "my" variable $item masks earlier declaration in same statement FAIL cataloguing/value_builder/marc21_leader_holdings.pl FAIL valid "my" variable $item masks earlier declaration in same statement FAIL koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc FAIL filters missing_filter at line 14 ( <li><a id="newholding" href="/cgi-bin/koha/cataloguing/addholding.pl?biblionumber=[% biblionumber %]#addholding">New holdings record</a></li>) FAIL koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt FAIL filters missing_filter at line 210 ( <a class="btn btn-default btn-xs" href="/cgi-bin/koha/cataloguing/addholding.pl?op=edit&biblionumber=[% holding.biblionumber %]&holding_id=[% holding.holding_id %]#editholding"><i class="fa fa-pencil"></i> Edit</a>) missing_filter at line 210 ( <a class="btn btn-default btn-xs" href="/cgi-bin/koha/cataloguing/addholding.pl?op=edit&biblionumber=[% holding.biblionumber %]&holding_id=[% holding.holding_id %]#editholding"><i class="fa fa-pencil"></i> Edit</a>) missing_filter at line 211 ( <a class="btn btn-default btn-xs delete" href="/cgi-bin/koha/cataloguing/addholding.pl?op=delete&biblionumber=[% holding.biblionumber %]&holding_id=[% holding.holding_id %]"><i class="fa fa-eraser"></i> Delete</a>) missing_filter at line 211 ( <a class="btn btn-default btn-xs delete" href="/cgi-bin/koha/cataloguing/addholding.pl?op=delete&biblionumber=[% holding.biblionumber %]&holding_id=[% holding.holding_id %]"><i class="fa fa-eraser"></i> Delete</a>) missing_filter at line 212 ( <a class="btn btn-default btn-xs" href="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% holding.biblionumber %]&holding_id=[% holding.holding_id %]#additema"><i class="fa fa-plus"></i> Add item</a>) missing_filter at line 212 ( <a class="btn btn-default btn-xs" href="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% holding.biblionumber %]&holding_id=[% holding.holding_id %]#additema"><i class="fa fa-plus"></i> Add item</a>) FAIL koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addholding.tt FAIL filters wrong_html_filter at line 358 ( › Edit <a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber | html %]">[% title | html %] [% IF ( author ) %] by [% author | html %][% END %] (Record #[% biblionumber | html %])</a>) wrong_html_filter at line 359 ( › <a href="/cgi-bin/koha/cataloguing/addholding.pl?biblionumber=[% biblionumber | html %]">Holdings</a>) wrong_html_filter at line 457 ( <li><a href="#tab[% BIG_LOO.number | html %]XX">[% BIG_LOO.number | html %]</a></li>) missing_filter at line 469 ( <a href="#" tabindex="1" class="tagnum" title="[% innerloo.tag_lib | html %] - Click to Expand this Tag" onclick="ExpandField('tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]'); return false;">[% innerloo.tag %]</a>) missing_filter at line 471 ( <span class="tagnum" title="[% innerloo.tag_lib %]">[% innerloo.tag | html %]</span>) missing_filter at line 553 ( [% subfield_loo.marc_lib %]) missing_filter at line 578 ( [% mv.javascript %]) missing_filter at line 582 ( <textarea cols="70" rows="4" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" class="input_marceditor" tabindex="1">[%- mv.value -%]</textarea>) FAIL forbidden patterns forbidden pattern: Attribute type should not be used for script tags (bug 20053) (line 11) forbidden pattern: Attribute type should not be used for script tags (bug 20053) (line 376) FAIL js_in_body A <script> tag found inside head, must be moved to the body (see bug 17858) FAIL koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008_holdings.tt FAIL forbidden patterns forbidden pattern: Attribute type should not be used for script tags (bug 20053) (line 167) FAIL koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_leader_holdings.tt FAIL forbidden patterns forbidden pattern: Attribute type should not be used for script tags (bug 20053) (line 83) FAIL misc/batchRebuildHoldingsTables.pl FAIL valid "my" variable $item masks earlier declaration in same statement FAIL misc/export_records.pl FAIL valid "my" variable $item masks earlier declaration in same statement FAIL misc/migration_tools/bulkmarcimport.pl FAIL valid "my" variable $item masks earlier declaration in same statement FAIL opac/opac-detail.pl FAIL valid "my" variable $item masks earlier declaration in same statement FAIL t/db_dependent/Exporter/Record.t FAIL valid "my" variable $item masks earlier declaration in same statement FAIL t/db_dependent/Koha/Holding.t FAIL valid "my" variable $item masks earlier declaration in same statement FAIL t/db_dependent/Koha/Holdings.t FAIL valid "my" variable $item masks earlier declaration in same statement FAIL tools/export.pl FAIL valid "my" variable $item masks earlier declaration in same statement FAIL tools/stage-marc-import.pl FAIL valid "my" variable $item masks earlier declaration in same statement
Created attachment 88751 [details] [review] Bug 20447: MARC Holdings support Enable by setting "SummaryHoldings" option to "Use". Sponsored-by: The National Library of Finland Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 88752 [details] [review] Bug 20447: Add a batch rebuild script for holdings table. This script can be used to update the columns in the holdings table from the MARC record using the rules in the framework. In practice this will only be required if the koha link field is changed in the framework. Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 88753 [details] [review] Bug 20447: Add import/export support for holdings https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20447 Adds support for importing and exporting biblios with interleaved holdings. Test plan: 1.) Import the MARCXML file attached to the bug with the -holdings parameter: misc/migration_tools/bulkmarcimport.pl -biblios -holdings -file holdings.xml -m MARCXML 2.) Verify that the holdings records were imported. 3.) Export the same records with holdings: misc/export_records.pl --record-type=bibs --starting_biblionumber 103 --ending_biblionumber 104 --filename=holdings_export.xml --format=xml --holdings 4.) Verify that both bibliographic and holding records are exported. 5.) Verify that tests in t/db_dependent/Exporter/Record.t pass. Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 88754 [details] [review] Bug 20447: DBIX schema changes Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 88755 [details] [review] Bug 20447: Use blessed objects and fix issues found during review
Thanks Josef, I believe I've addressed the comments in the latest patch. I'd rather leave editor unification to bug 21280 or a separate bug. Regarding changing the framework, I had in one version a new column for the framework type so that the selection list could be filtered, but I dropped it to keep the changes to minimum. That can be revisited later. I don't consider it a big issue.
This patch set would break cataloguing/merge.pl since there is no patch to move holdings to a different bibliographic record. I have moved this back to "In Discussion" because I think this needs to be fixed before merging this patch set.
(In reply to Joonas Kylmälä from comment #134) > This patch set would break cataloguing/merge.pl since there is no patch to > move holdings to a different bibliographic record. I have moved this back to > "In Discussion" because I think this needs to be fixed before merging this > patch set. Hi Joonas, thx for testing. Setting to Failed QA is better in this case.
Joonas, was that an assumption or a verified problem? There's code in Items::MoveItemFromBiblio that does its best to handle holdings. A holdings record cannot be moved if an item is moved, but the mechanism tries to make sure there's a suitable holdings record used or added in the destination biblio.
Created attachment 91743 [details] [review] Bug 20447: MARC Holdings support Enable by setting "SummaryHoldings" option to "Use". Sponsored-by: The National Library of Finland Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 91744 [details] [review] Bug 20447: Add a batch rebuild script for holdings table. This script can be used to update the columns in the holdings table from the MARC record using the rules in the framework. In practice this will only be required if the koha link field is changed in the framework. Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 91745 [details] [review] Bug 20447: Add import/export support for holdings https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20447 Adds support for importing and exporting biblios with interleaved holdings. Test plan: 1.) Import the MARCXML file attached to the bug with the -holdings parameter: misc/migration_tools/bulkmarcimport.pl -biblios -holdings -file holdings.xml -m MARCXML 2.) Verify that the holdings records were imported. 3.) Export the same records with holdings: misc/export_records.pl --record-type=bibs --starting_biblionumber 103 --ending_biblionumber 104 --filename=holdings_export.xml --format=xml --holdings 4.) Verify that both bibliographic and holding records are exported. 5.) Verify that tests in t/db_dependent/Exporter/Record.t pass. Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 91746 [details] [review] Bug 20447: DBIX schema changes Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 91747 [details] [review] Bug 20447: Use blessed objects and fix issues found during review
Rebased. Setting back to Signed Off. Please set back and describe the issue in detail if it's real.
(In reply to Ere Maijala from comment #136) > Joonas, was that an assumption or a verified problem? There's code in > Items::MoveItemFromBiblio that does its best to handle holdings. A holdings > record cannot be moved if an item is moved, but the mechanism tries to make > sure there's a suitable holdings record used or added in the destination > biblio. I probably noticed the problem only in the code when I commented but try the following test case and you see the problem happens for real: 1) Create new record with item and a holdings record. Don't attach the holding to the item. 2) create another record with no items or holdings records 3) In cataloguing search (More -> Cataloging) make such search that you find both records 4) Select both of them and click "Merge selected". Select record with no items or holdings as there reference record (the one that will be kept) 5) After the merge is done notice that the holdings record didn't transfer to the merged record.
Ok, thanks, I'll fix..
Looks like bug 22690 is needed so that merge can be done in a sensible way.
Note to self: make sure there's also an index on the timestamp column.
(In reply to Ere Maijala from comment #146) > Note to self: make sure there's also an index on the timestamp column. +1000
Created attachment 94539 [details] [review] Bug 20447: MARC Holdings support Enable by setting "SummaryHoldings" option to "Use". Sponsored-by: The National Library of Finland Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 94540 [details] [review] Bug 20447: Add a batch rebuild script for holdings table. This script can be used to update the columns in the holdings table from the MARC record using the rules in the framework. In practice this will only be required if the koha link field is changed in the framework. Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 94541 [details] [review] Bug 20447: Add import/export support for holdings https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20447 Adds support for importing and exporting biblios with interleaved holdings. Test plan: 1.) Import the MARCXML file attached to the bug with the -holdings parameter: misc/migration_tools/bulkmarcimport.pl -biblios -holdings -file holdings.xml -m MARCXML 2.) Verify that the holdings records were imported. 3.) Export the same records with holdings: misc/export_records.pl --record-type=bibs --starting_biblionumber 103 --ending_biblionumber 104 --filename=holdings_export.xml --format=xml --holdings 4.) Verify that both bibliographic and holding records are exported. 5.) Verify that tests in t/db_dependent/Exporter/Record.t pass. Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 94542 [details] [review] Bug 20447: DBIX schema changes Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com>
Now rebased and made merging use bug 22690 as the base. Includes the following tweaks: - timestamp column has a key - Holdings tab is shown second to Items tab so that it doesn't interfere with displaying items when there are no holdings records.
browser-strings.inc will be removed by bug 23884.
Created attachment 97796 [details] [review] Bug 20447: MARC Holdings support Enable by setting "SummaryHoldings" option to "Use". Sponsored-by: The National Library of Finland Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 97797 [details] [review] Bug 20447: MARC Holdings support Enable by setting "SummaryHoldings" option to "Use". Sponsored-by: The National Library of Finland Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 97798 [details] [review] Bug 20447: Add a batch rebuild script for holdings table. This script can be used to update the columns in the holdings table from the MARC record using the rules in the framework. In practice this will only be required if the koha link field is changed in the framework. Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 97799 [details] [review] Bug 20447: Add import/export support for holdings https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20447 Adds support for importing and exporting biblios with interleaved holdings. Test plan: 1.) Import the MARCXML file attached to the bug with the -holdings parameter: misc/migration_tools/bulkmarcimport.pl -biblios -holdings -file holdings.xml -m MARCXML 2.) Verify that the holdings records were imported. 3.) Export the same records with holdings: misc/export_records.pl --record-type=bibs --starting_biblionumber 103 --ending_biblionumber 104 --filename=holdings_export.xml --format=xml --holdings 4.) Verify that both bibliographic and holding records are exported. 5.) Verify that tests in t/db_dependent/Exporter/Record.t pass. Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 97800 [details] [review] Bug 20447: DBIX schema changes Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com>
Rebased.
Created attachment 97843 [details] [review] Bug 20447: MARC Holdings support Enable by setting "SummaryHoldings" option to "Use". Sponsored-by: The National Library of Finland Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 97844 [details] [review] Bug 20447: Add a batch rebuild script for holdings table. This script can be used to update the columns in the holdings table from the MARC record using the rules in the framework. In practice this will only be required if the koha link field is changed in the framework. Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 97845 [details] [review] Bug 20447: Add import/export support for holdings https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20447 Adds support for importing and exporting biblios with interleaved holdings. Test plan: 1.) Import the MARCXML file attached to the bug with the -holdings parameter: misc/migration_tools/bulkmarcimport.pl -biblios -holdings -file holdings.xml -m MARCXML 2.) Verify that the holdings records were imported. 3.) Export the same records with holdings: misc/export_records.pl --record-type=bibs --starting_biblionumber 103 --ending_biblionumber 104 --filename=holdings_export.xml --format=xml --holdings 4.) Verify that both bibliographic and holding records are exported. 5.) Verify that tests in t/db_dependent/Exporter/Record.t pass. Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 97846 [details] [review] Bug 20447: DBIX schema changes Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 99143 [details] [review] Bug 20447: MARC Holdings support Enable by setting "SummaryHoldings" option to "Use". Sponsored-by: The National Library of Finland Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 99144 [details] [review] Bug 20447: Add a batch rebuild script for holdings table. This script can be used to update the columns in the holdings table from the MARC record using the rules in the framework. In practice this will only be required if the koha link field is changed in the framework. Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 99145 [details] [review] Bug 20447: Add import/export support for holdings https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20447 Adds support for importing and exporting biblios with interleaved holdings. Test plan: 1.) Import the MARCXML file attached to the bug with the -holdings parameter: misc/migration_tools/bulkmarcimport.pl -biblios -holdings -file holdings.xml -m MARCXML 2.) Verify that the holdings records were imported. 3.) Export the same records with holdings: misc/export_records.pl --record-type=bibs --starting_biblionumber 103 --ending_biblionumber 104 --filename=holdings_export.xml --format=xml --holdings 4.) Verify that both bibliographic and holding records are exported. 5.) Verify that tests in t/db_dependent/Exporter/Record.t pass. Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 99146 [details] [review] Bug 20447: DBIX schema changes Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 99176 [details] [review] Bug 20447: MARC Holdings support Enable by setting "SummaryHoldings" option to "Use". Sponsored-by: The National Library of Finland Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 99177 [details] [review] Bug 20447: Add a batch rebuild script for holdings table. This script can be used to update the columns in the holdings table from the MARC record using the rules in the framework. In practice this will only be required if the koha link field is changed in the framework. Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 99178 [details] [review] Bug 20447: Add import/export support for holdings https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20447 Adds support for importing and exporting biblios with interleaved holdings. Test plan: 1.) Import the MARCXML file attached to the bug with the -holdings parameter: misc/migration_tools/bulkmarcimport.pl -biblios -holdings -file holdings.xml -m MARCXML 2.) Verify that the holdings records were imported. 3.) Export the same records with holdings: misc/export_records.pl --record-type=bibs --starting_biblionumber 103 --ending_biblionumber 104 --filename=holdings_export.xml --format=xml --holdings 4.) Verify that both bibliographic and holding records are exported. 5.) Verify that tests in t/db_dependent/Exporter/Record.t pass. Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 99179 [details] [review] Bug 20447: DBIX schema changes Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com>
Fixed a typo introduced during last rebase.
Created attachment 99235 [details] [review] Bug 20447: MARC Holdings support Enable by setting "SummaryHoldings" option to "Use". Sponsored-by: The National Library of Finland Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 99236 [details] [review] Bug 20447: Add holding_id to REST API item definition Allows items to be properly returned, including the holding_id field.
Created attachment 99237 [details] [review] Bug 20447: Add a batch rebuild script for holdings table This script can be used to update the columns in the holdings table from the MARC record using the rules in the framework. In practice this will only be required if the koha link field is changed in the framework. Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 99238 [details] [review] Bug 20447: Add import/export support for holdings https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20447 Adds support for importing and exporting biblios with interleaved holdings. Test plan: 1.) Import the MARCXML file attached to the bug with the -holdings parameter: misc/migration_tools/bulkmarcimport.pl -biblios -holdings -file holdings.xml -m MARCXML 2.) Verify that the holdings records were imported. 3.) Export the same records with holdings: misc/export_records.pl --record-type=bibs --starting_biblionumber 103 --ending_biblionumber 104 --filename=holdings_export.xml --format=xml --holdings 4.) Verify that both bibliographic and holding records are exported. 5.) Verify that tests in t/db_dependent/Exporter/Record.t pass. Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 99239 [details] [review] Bug 20447: DBIX schema changes Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com>
Added a minimal patch to include holding_id in the item definition of the REST API. I'll defer actual API functionality to a later bug.
Please, rebase
Comment on attachment 99235 [details] [review] Bug 20447: MARC Holdings support Review of attachment 99235 [details] [review]: ----------------------------------------------------------------- Hi Ere, I read through the code and have some notes/questions Overall, I think it's great enhancement and I really like this to be part of Koha. ::: C4/Search.pm @@ +2242,5 @@ > } > > + # Fetch summary holdings > + if (C4::Context->preference('SummaryHoldings')) { > + $summary_holdings = Koha::Holdings->search({ biblionumber => $oldbiblio->{biblionumber}, deleted_on => undef }); Maybe something like $biblio->holdings? ::: Koha/Biblio.pm @@ +520,5 @@ > + > +sub holdings { > + my ($self) = @_; > + > + $self->{_holdings} ||= Koha::Holdings->search( { biblionumber => $self->biblionumber } ); use relation and new_from_dbic? ::: Koha/Holding.pm @@ +23,5 @@ > +use Carp; > + > +use C4::Charset; > +use C4::Log; > + are all imports needed? @@ +138,5 @@ > + > + return > + wantarray > + ? Koha::Items->_new_from_dbic($items_rs)->as_list > + : Koha::Items->_new_from_dbic($items_rs); do we really need this duality? @@ +166,5 @@ > + my $guard = C4::Context->dbh->{AutoCommit} ? $schema->txn_scope_guard() : undef; > + > + my $result = $self->SUPER::store(); > + > + return $result unless $result; Should it be just 'return unless $result'? ::: Koha/Holdings.pm @@ +25,5 @@ > +use C4::Biblio; > +use C4::Charset; > +use C4::Context; > +use Koha::Database; > +use Koha::Holding; Are all imports needed? ::: Koha/Holdings/Metadata.pm @@ +34,5 @@ > +=cut > + > +=head3 record > + > +my @record = $metadata->record($params); there are no params handled in method 'record' ::: catalogue/detail.pl @@ +432,3 @@ > C4::Search::enabled_staff_search_views, > + materials => $materials_flag, > + show_summary_holdings => C4::Context->preference('SummaryHoldings') ? 1 : 0, You could use template plugin for getting value of a syspref and then you don't need to pass this variable to template ::: cataloguing/addholding.pl @@ +151,5 @@ > +=cut > + > +sub CreateKey { > + return int(rand(1000000)); > +} Maybe Koha::Token would be better to use instead of this sub, but could be leaved to other bug report, as this pattern is in more files now. ::: cataloguing/value_builder/marc21_field_008_holdings.pl @@ +22,5 @@ > +use C4::Auth; > +use CGI qw ( -utf8 ); > +use C4::Context; > + > +use C4::Search; Do you need C4::Search ? @@ +39,5 @@ > + my $function_name = $params->{id}; > + my $dateentered = date_entered(); > + my $res = " > +<script type=\"text/javascript\"> > +//<![CDATA[ type parameter and CDATA should not be used ::: cataloguing/value_builder/marc21_leader_holdings.pl @@ +29,5 @@ > + my ( $params ) = @_; > + my $function_name = $params->{id}; > + my $res = " > +<script type=\"text/javascript\"> > +//<![CDATA[ Type parameter and CDATA should not be used ::: koha-tmpl/intranet-tmpl/prog/css/addholding.css @@ +139,5 @@ > + > +.yui-gf .yui-u { > + width: 79.2%; > +} > + Are there still yui classes? ::: koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addholding.tt @@ +6,5 @@ > +[% INCLUDE 'doc-head-close.inc' %] > +[% Asset.js("lib/hc-sticky.js") | $raw %] > +[% Asset.js("js/cataloging.js") | $raw %] > +[% INCLUDE 'strings.inc' %] > +[% Asset.js("js/browser.js") | $raw %] Even javascript included by Asset plugin should be at end of template And you need to set variable footerjs, like: [% SET footerjs = 1 %] (And macro block - see bellow) @@ +287,5 @@ > +</div> > +</div> > +</div> > + > +<script> Scripts should be in enclosed by [% MACRO jsinclude BLOCK %] ::: koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008_holdings.tt @@ +3,5 @@ > +<title>Koha › Holdings › 008 builder</title> > +[% INCLUDE 'doc-head-close.inc' %] > +</head> > +<body id="cat_marc21_field_008_holdings" class="cat" style="padding:1em;"> > +<h3> 008 Fixed-length data elements</h3> There is white space just after <h3>
Thanks Josef, I'll address your comments when I'm done rebasing. It proved to be a bit more work than before since the MARC 21 default framework was changed to YAML.
Created attachment 105068 [details] [review] Bug 20447: MARC Holdings support Enable by setting "SummaryHoldings" option to "Use". Sponsored-by: The National Library of Finland
Created attachment 105069 [details] [review] Bug 20447: Add holding_id to REST API item definition Allows items to be properly returned, including the holding_id field.
Created attachment 105070 [details] [review] Bug 20447: Add a batch rebuild script for holdings table This script can be used to update the columns in the holdings table from the MARC record using the rules in the framework. In practice this will only be required if the koha link field is changed in the framework.
Created attachment 105071 [details] [review] Bug 20447: Add import/export support for holdings https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20447 Adds support for importing and exporting biblios with interleaved holdings. Test plan: 1.) Import the MARCXML file attached to the bug with the -holdings parameter: misc/migration_tools/bulkmarcimport.pl -biblios -holdings -file holdings.xml -m MARCXML 2.) Verify that the holdings records were imported. 3.) Export the same records with holdings: misc/export_records.pl --record-type=bibs --starting_biblionumber 103 --ending_biblionumber 104 --filename=holdings_export.xml --format=xml --holdings 4.) Verify that both bibliographic and holding records are exported. 5.) Verify that tests in t/db_dependent/Exporter/Record.t pass.
Created attachment 105072 [details] [review] Bug 20447: DBIX schema changes
Rebased, review comments not yet addressed. I just attached the rebased version out of paranoia to make sure a couple of days working on rebasing won't get lost.
Created attachment 105259 [details] [review] Bug 20447: MARC Holdings support Enable by setting "SummaryHoldings" option to "Use". Sponsored-by: The National Library of Finland
Created attachment 105260 [details] [review] Bug 20447: Add holding_id to REST API item definition Allows items to be properly returned, including the holding_id field.
Created attachment 105261 [details] [review] Bug 20447: Add a batch rebuild script for holdings table This script can be used to update the columns in the holdings table from the MARC record using the rules in the framework. In practice this will only be required if the koha link field is changed in the framework.
Created attachment 105262 [details] [review] Bug 20447: Add import/export support for holdings https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20447 Adds support for importing and exporting biblios with interleaved holdings. Test plan: 1.) Import the MARCXML file attached to the bug with the -holdings parameter: misc/migration_tools/bulkmarcimport.pl -biblios -holdings -file holdings.xml -m MARCXML 2.) Verify that the holdings records were imported. 3.) Export the same records with holdings: misc/export_records.pl --record-type=bibs --starting_biblionumber 103 --ending_biblionumber 104 --filename=holdings_export.xml --format=xml --holdings 4.) Verify that both bibliographic and holding records are exported. 5.) Verify that tests in t/db_dependent/Exporter/Record.t pass.
Created attachment 105263 [details] [review] Bug 20447: DBIX schema changes
I've now addressed Josef's comments apart from the ones listed below (for a reason): > ::: C4/Search.pm > @@ +2242,5 @@ > > } > > > > + # Fetch summary holdings > > + if (C4::Context->preference('SummaryHoldings')) { > > + $summary_holdings = Koha::Holdings->search({ biblionumber => $oldbiblio->{biblionumber}, deleted_on => undef }); > > Maybe something like $biblio->holdings? I didn't change this since it would require fetching the biblio record for each result, and since we don't currently do that, it would have been extra work required just to get the holdings. I added a comment noting that. > ::: koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addholding.tt > @@ +6,5 @@ > > +[% INCLUDE 'doc-head-close.inc' %] > > +[% Asset.js("lib/hc-sticky.js") | $raw %] > > +[% Asset.js("js/cataloging.js") | $raw %] > > +[% INCLUDE 'strings.inc' %] > > +[% Asset.js("js/browser.js") | $raw %] > > Even javascript included by Asset plugin should be at end of template > > And you need to set variable footerjs, like: [% SET footerjs = 1 %] (And > macro block - see bellow) addholding.tt mirrors addbiblio.tt, and addbiblio.tt uses js plugins that don't support footerjs. I updated addholding.tt according to changes in addbiblio.tt, but I left the structure intact so that it's easier to compare and update the files. It might be possible in a follow-up to merge some parts of the separate templates.
Created attachment 106147 [details] [review] Bug 20447: MARC Holdings support Enable by setting "SummaryHoldings" option to "Use". Sponsored-by: The National Library of Finland
Created attachment 106148 [details] [review] Bug 20447: Add holding_id to REST API item definition Allows items to be properly returned, including the holding_id field.
Created attachment 106149 [details] [review] Bug 20447: Add a batch rebuild script for holdings table This script can be used to update the columns in the holdings table from the MARC record using the rules in the framework. In practice this will only be required if the koha link field is changed in the framework.
Created attachment 106150 [details] [review] Bug 20447: Add import/export support for holdings https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20447 Adds support for importing and exporting biblios with interleaved holdings. Test plan: 1.) Import the MARCXML file attached to the bug with the -holdings parameter: misc/migration_tools/bulkmarcimport.pl -biblios -holdings -file holdings.xml -m MARCXML 2.) Verify that the holdings records were imported. 3.) Export the same records with holdings: misc/export_records.pl --record-type=bibs --starting_biblionumber 103 --ending_biblionumber 104 --filename=holdings_export.xml --format=xml --holdings 4.) Verify that both bibliographic and holding records are exported. 5.) Verify that tests in t/db_dependent/Exporter/Record.t pass.
Created attachment 106151 [details] [review] Bug 20447: DBIX schema changes
Rebased and added logic to select the holdings tab instead of items tab if the bibliographic record has holdings records but no items.
Created attachment 108250 [details] [review] Bug 20447: MARC Holdings support Enable by setting "SummaryHoldings" option to "Use". Sponsored-by: The National Library of Finland Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Created attachment 108251 [details] [review] Bug 20447: Add holding_id to REST API item definition Allows items to be properly returned, including the holding_id field. Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Created attachment 108252 [details] [review] Bug 20447: Add a batch rebuild script for holdings table This script can be used to update the columns in the holdings table from the MARC record using the rules in the framework. In practice this will only be required if the koha link field is changed in the framework. Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Created attachment 108253 [details] [review] Bug 20447: Add import/export support for holdings https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20447 Adds support for importing and exporting biblios with interleaved holdings. Test plan: 1.) Import the MARCXML file attached to the bug with the -holdings parameter: misc/migration_tools/bulkmarcimport.pl -biblios -holdings -file holdings.xml -m MARCXML 2.) Verify that the holdings records were imported. 3.) Export the same records with holdings: misc/export_records.pl --record-type=bibs --starting_biblionumber 103 --ending_biblionumber 104 --filename=holdings_export.xml --format=xml --holdings 4.) Verify that both bibliographic and holding records are exported. 5.) Verify that tests in t/db_dependent/Exporter/Record.t pass. Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Created attachment 108254 [details] [review] Bug 20447: DBIX schema changes Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Created attachment 108255 [details] [review] Bug 20447: (follow-up) Add required metadata field when creating holdings Since metadata column is mandatory in the holdings_metadata table we need to define it already when it is first created instead of creating it first and updating the column immediately after. This fixes the following error during holdings record creation: DBIx::Class::Storage::DBI::_dbh_execute(): Field 'metadata' doesn't have a default value at /kohadevbox/koha/Koha/Objects.pm line 114
Created attachment 108336 [details] [review] Bug 20447: MARC Holdings support Enable by setting "SummaryHoldings" option to "Use". Sponsored-by: The National Library of Finland Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 108337 [details] [review] Bug 20447: Add holding_id to REST API item definition Allows items to be properly returned, including the holding_id field. Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 108338 [details] [review] Bug 20447: Add a batch rebuild script for holdings table This script can be used to update the columns in the holdings table from the MARC record using the rules in the framework. In practice this will only be required if the koha link field is changed in the framework. Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 108339 [details] [review] Bug 20447: Add import/export support for holdings https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20447 Adds support for importing and exporting biblios with interleaved holdings. Test plan: 1.) Import the MARCXML file attached to the bug with the -holdings parameter: misc/migration_tools/bulkmarcimport.pl -biblios -holdings -file holdings.xml -m MARCXML 2.) Verify that the holdings records were imported. 3.) Export the same records with holdings: misc/export_records.pl --record-type=bibs --starting_biblionumber 103 --ending_biblionumber 104 --filename=holdings_export.xml --format=xml --holdings 4.) Verify that both bibliographic and holding records are exported. 5.) Verify that tests in t/db_dependent/Exporter/Record.t pass. Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 108340 [details] [review] Bug 20447: DBIX schema changes Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 108341 [details] [review] Bug 20447: (follow-up) Add required metadata field when creating holdings Since metadata column is mandatory in the holdings_metadata table we need to define it already when it is first created instead of creating it first and updating the column immediately after. This fixes the following error during holdings record creation: DBIx::Class::Storage::DBI::_dbh_execute(): Field 'metadata' doesn't have a default value at /kohadevbox/koha/Koha/Objects.pm line 114 Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 108789 [details] [review] Bug 20447: MARC Holdings support Enable by setting "SummaryHoldings" option to "Use". Sponsored-by: The National Library of Finland Signed-off-by: Michal Denar <black23@gmail.com> Very trivial string change and new subroutine in test caused conflict. Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Created attachment 108790 [details] [review] Bug 20447: Add holding_id to REST API item definition Allows items to be properly returned, including the holding_id field. Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 108791 [details] [review] Bug 20447: Add a batch rebuild script for holdings table This script can be used to update the columns in the holdings table from the MARC record using the rules in the framework. In practice this will only be required if the koha link field is changed in the framework. Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 108792 [details] [review] Bug 20447: Add import/export support for holdings https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20447 Adds support for importing and exporting biblios with interleaved holdings. Test plan: 1.) Import the MARCXML file attached to the bug with the -holdings parameter: misc/migration_tools/bulkmarcimport.pl -biblios -holdings -file holdings.xml -m MARCXML 2.) Verify that the holdings records were imported. 3.) Export the same records with holdings: misc/export_records.pl --record-type=bibs --starting_biblionumber 103 --ending_biblionumber 104 --filename=holdings_export.xml --format=xml --holdings 4.) Verify that both bibliographic and holding records are exported. 5.) Verify that tests in t/db_dependent/Exporter/Record.t pass. Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 108793 [details] [review] Bug 20447: DBIX schema changes Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 108794 [details] [review] Bug 20447: (follow-up) Add required metadata field when creating holdings Since metadata column is mandatory in the holdings_metadata table we need to define it already when it is first created instead of creating it first and updating the column immediately after. This fixes the following error during holdings record creation: DBIx::Class::Storage::DBI::_dbh_execute(): Field 'metadata' doesn't have a default value at /kohadevbox/koha/Koha/Objects.pm line 114 Signed-off-by: Michal Denar <black23@gmail.com>
Hi, just rebased again the first patch "Bug 20447: MARC Holdings support". There was a very trivial string change in koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt caused by the string "Current location" changing in Koha master to "Current library". Also in t/db_dependent/Koha/Item.t a new test was introduced in koha master to the same place where this patch had changed so I simply resolved this by allowing the new test to come through. Both of these were very trivial so I leave this patch still to Signed Off state. I left a note after Michal's Signed-off-by to the patch so in case there is some problems no one can blame Michal but they can ask me to fix things if I broke something (which I don't think since this was very trivial rebase).
C4::Biblio::DelBiblio, and some of the code calling it only checks whether items exists before deleting the biblio. We need to check also if holdings records exists in the biblio before it can be deleted. A listing of things to fix (search for DelBiblio): - C4/Acquisition.pm - misc/batchdeletebiblios.pl - svc/bib - misc/cronjobs/delete_records_via_leader.pl Maybe some more might exists but these at least should be fixed before merging.
Created attachment 109695 [details] [review] Bug 20447: MARC Holdings support Enable by setting "SummaryHoldings" option to "Use". Sponsored-by: The National Library of Finland Signed-off-by: Michal Denar <black23@gmail.com> Very trivial string change, new test and new column in kohastructure.sql caused conflict. Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Created attachment 109696 [details] [review] Bug 20447: Add holding_id to REST API item definition Allows items to be properly returned, including the holding_id field. Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 109697 [details] [review] Bug 20447: Add a batch rebuild script for holdings table This script can be used to update the columns in the holdings table from the MARC record using the rules in the framework. In practice this will only be required if the koha link field is changed in the framework. Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 109698 [details] [review] Bug 20447: Add import/export support for holdings https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20447 Adds support for importing and exporting biblios with interleaved holdings. Test plan: 1.) Import the MARCXML file attached to the bug with the -holdings parameter: misc/migration_tools/bulkmarcimport.pl -biblios -holdings -file holdings.xml -m MARCXML 2.) Verify that the holdings records were imported. 3.) Export the same records with holdings: misc/export_records.pl --record-type=bibs --starting_biblionumber 103 --ending_biblionumber 104 --filename=holdings_export.xml --format=xml --holdings 4.) Verify that both bibliographic and holding records are exported. 5.) Verify that tests in t/db_dependent/Exporter/Record.t pass. Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Michal Denar <black23@gmail.com> Trivial changes in test to fix rebase conflict Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Created attachment 109699 [details] [review] Bug 20447: DBIX schema changes Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Michal Denar <black23@gmail.com> Deleteditem.pm and Item.pm schema files had changes, regenerated them with dbic Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Created attachment 109700 [details] [review] Bug 20447: (follow-up) Add required metadata field when creating holdings Since metadata column is mandatory in the holdings_metadata table we need to define it already when it is first created instead of creating it first and updating the column immediately after. This fixes the following error during holdings record creation: DBIx::Class::Storage::DBI::_dbh_execute(): Field 'metadata' doesn't have a default value at /kohadevbox/koha/Koha/Objects.pm line 114 Signed-off-by: Michal Denar <black23@gmail.com>
Rebased. The issue with deletion still exists so keeping FQA status.
Created attachment 109703 [details] [review] Bug 20447: MARC Holdings support Enable by setting "SummaryHoldings" option to "Use". Sponsored-by: The National Library of Finland Signed-off-by: Michal Denar <black23@gmail.com> Very trivial string change, new test and new column in kohastructure.sql caused conflict. Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Created attachment 109704 [details] [review] Bug 20447: Add holding_id to REST API item definition Allows items to be properly returned, including the holding_id field. Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 109705 [details] [review] Bug 20447: Add a batch rebuild script for holdings table This script can be used to update the columns in the holdings table from the MARC record using the rules in the framework. In practice this will only be required if the koha link field is changed in the framework. Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 109706 [details] [review] Bug 20447: Add import/export support for holdings https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20447 Adds support for importing and exporting biblios with interleaved holdings. Test plan: 1.) Import the MARCXML file attached to the bug with the -holdings parameter: misc/migration_tools/bulkmarcimport.pl -biblios -holdings -file holdings.xml -m MARCXML 2.) Verify that the holdings records were imported. 3.) Export the same records with holdings: misc/export_records.pl --record-type=bibs --starting_biblionumber 103 --ending_biblionumber 104 --filename=holdings_export.xml --format=xml --holdings 4.) Verify that both bibliographic and holding records are exported. 5.) Verify that tests in t/db_dependent/Exporter/Record.t pass. Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Michal Denar <black23@gmail.com> Trivial changes in test to fix rebase conflict Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Created attachment 109707 [details] [review] Bug 20447: DBIX schema changes Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Michal Denar <black23@gmail.com> Deleteditem.pm and Item.pm schema files had changes, regenerated them with dbic Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Created attachment 109708 [details] [review] Bug 20447: (follow-up) Add required metadata field when creating holdings Since metadata column is mandatory in the holdings_metadata table we need to define it already when it is first created instead of creating it first and updating the column immediately after. This fixes the following error during holdings record creation: DBIx::Class::Storage::DBI::_dbh_execute(): Field 'metadata' doesn't have a default value at /kohadevbox/koha/Koha/Objects.pm line 114 Signed-off-by: Michal Denar <black23@gmail.com>
Check for existing holdings has now been added.
Created attachment 109711 [details] [review] Bug 20447: Add holding_id to REST API item definition Allows items to be properly returned, including the holding_id field. Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 109712 [details] [review] Bug 20447: Add a batch rebuild script for holdings table This script can be used to update the columns in the holdings table from the MARC record using the rules in the framework. In practice this will only be required if the koha link field is changed in the framework. Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 109713 [details] [review] Bug 20447: Add import/export support for holdings https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20447 Adds support for importing and exporting biblios with interleaved holdings. Test plan: 1.) Import the MARCXML file attached to the bug with the -holdings parameter: misc/migration_tools/bulkmarcimport.pl -biblios -holdings -file holdings.xml -m MARCXML 2.) Verify that the holdings records were imported. 3.) Export the same records with holdings: misc/export_records.pl --record-type=bibs --starting_biblionumber 103 --ending_biblionumber 104 --filename=holdings_export.xml --format=xml --holdings 4.) Verify that both bibliographic and holding records are exported. 5.) Verify that tests in t/db_dependent/Exporter/Record.t pass. Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Michal Denar <black23@gmail.com> Trivial changes in test to fix rebase conflict Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 109714 [details] [review] Bug 20447: DBIX schema changes Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Michal Denar <black23@gmail.com> Deleteditem.pm and Item.pm schema files had changes, regenerated them with dbic Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 109715 [details] [review] Bug 20447: (follow-up) Add required metadata field when creating holdings Since metadata column is mandatory in the holdings_metadata table we need to define it already when it is first created instead of creating it first and updating the column immediately after. This fixes the following error during holdings record creation: DBIx::Class::Storage::DBI::_dbh_execute(): Field 'metadata' doesn't have a default value at /kohadevbox/koha/Koha/Objects.pm line 114 Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com>
mates, first patch from the list was obsoleted and not popped-up again, this "MARC Holdings support", that's for a reason? I didn't found an explanation.
Comment on attachment 109703 [details] [review] Bug 20447: MARC Holdings support Unobsoleted the main patch. I'll need to verify one more thing wrt forcing deletion of biblios.
Created attachment 109717 [details] [review] Bug 20447: MARC Holdings support Enable by setting "SummaryHoldings" option to "Use". Sponsored-by: The National Library of Finland
Created attachment 109718 [details] [review] Bug 20447: Add holding_id to REST API item definition Allows items to be properly returned, including the holding_id field. Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 109719 [details] [review] Bug 20447: Add a batch rebuild script for holdings table This script can be used to update the columns in the holdings table from the MARC record using the rules in the framework. In practice this will only be required if the koha link field is changed in the framework. Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 109720 [details] [review] Bug 20447: Add import/export support for holdings https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20447 Adds support for importing and exporting biblios with interleaved holdings. Test plan: 1.) Import the MARCXML file attached to the bug with the -holdings parameter: misc/migration_tools/bulkmarcimport.pl -biblios -holdings -file holdings.xml -m MARCXML 2.) Verify that the holdings records were imported. 3.) Export the same records with holdings: misc/export_records.pl --record-type=bibs --starting_biblionumber 103 --ending_biblionumber 104 --filename=holdings_export.xml --format=xml --holdings 4.) Verify that both bibliographic and holding records are exported. 5.) Verify that tests in t/db_dependent/Exporter/Record.t pass. Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Michal Denar <black23@gmail.com> Trivial changes in test to fix rebase conflict Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Created attachment 109721 [details] [review] Bug 20447: DBIX schema changes Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Michal Denar <black23@gmail.com> Deleteditem.pm and Item.pm schema files had changes, regenerated them with dbic Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Created attachment 109722 [details] [review] Bug 20447: (follow-up) Add required metadata field when creating holdings Since metadata column is mandatory in the holdings_metadata table we need to define it already when it is first created instead of creating it first and updating the column immediately after. This fixes the following error during holdings record creation: DBIx::Class::Storage::DBI::_dbh_execute(): Field 'metadata' doesn't have a default value at /kohadevbox/koha/Koha/Objects.pm line 114 Signed-off-by: Michal Denar <black23@gmail.com>
Fixed acquisitions to consider existing holdings records and Koha::Biblio->holdings to only return non-deleted records. Needs new signoff for the base patch.
Created attachment 109741 [details] [review] Bug 20447: MARC Holdings support Enable by setting "SummaryHoldings" option to "Use". Sponsored-by: The National Library of Finland
Created attachment 109742 [details] [review] Bug 20447: Add holding_id to REST API item definition Allows items to be properly returned, including the holding_id field. Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 109743 [details] [review] Bug 20447: Add a batch rebuild script for holdings table This script can be used to update the columns in the holdings table from the MARC record using the rules in the framework. In practice this will only be required if the koha link field is changed in the framework. Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 109744 [details] [review] Bug 20447: Add import/export support for holdings https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20447 Adds support for importing and exporting biblios with interleaved holdings. Test plan: 1.) Import the MARCXML file attached to the bug with the -holdings parameter: misc/migration_tools/bulkmarcimport.pl -biblios -holdings -file holdings.xml -m MARCXML 2.) Verify that the holdings records were imported. 3.) Export the same records with holdings: misc/export_records.pl --record-type=bibs --starting_biblionumber 103 --ending_biblionumber 104 --filename=holdings_export.xml --format=xml --holdings 4.) Verify that both bibliographic and holding records are exported. 5.) Verify that tests in t/db_dependent/Exporter/Record.t pass. Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Michal Denar <black23@gmail.com> Trivial changes in test to fix rebase conflict Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Created attachment 109745 [details] [review] Bug 20447: DBIX schema changes Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Michal Denar <black23@gmail.com> Deleteditem.pm and Item.pm schema files had changes, regenerated them with dbic Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Created attachment 109746 [details] [review] Bug 20447: (follow-up) Add required metadata field when creating holdings Since metadata column is mandatory in the holdings_metadata table we need to define it already when it is first created instead of creating it first and updating the column immediately after. This fixes the following error during holdings record creation: DBIx::Class::Storage::DBI::_dbh_execute(): Field 'metadata' doesn't have a default value at /kohadevbox/koha/Koha/Objects.pm line 114 Signed-off-by: Michal Denar <black23@gmail.com>
Latest patches just fix some code style issues detected with QA tools. Note: I believe the boolean/tinyint thing is bogus, and the script block in addholding.tt cannot be moved until the scripts shared with addbiblio.tt are fixed.
Created attachment 109765 [details] [review] Bug 20447: MARC Holdings support Enable by setting "SummaryHoldings" option to "Use". Sponsored-by: The National Library of Finland Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 109766 [details] [review] Bug 20447: Add holding_id to REST API item definition Allows items to be properly returned, including the holding_id field. Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 109767 [details] [review] Bug 20447: Add a batch rebuild script for holdings table This script can be used to update the columns in the holdings table from the MARC record using the rules in the framework. In practice this will only be required if the koha link field is changed in the framework. Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 109768 [details] [review] Bug 20447: Add import/export support for holdings https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20447 Adds support for importing and exporting biblios with interleaved holdings. Test plan: 1.) Import the MARCXML file attached to the bug with the -holdings parameter: misc/migration_tools/bulkmarcimport.pl -biblios -holdings -file holdings.xml -m MARCXML 2.) Verify that the holdings records were imported. 3.) Export the same records with holdings: misc/export_records.pl --record-type=bibs --starting_biblionumber 103 --ending_biblionumber 104 --filename=holdings_export.xml --format=xml --holdings 4.) Verify that both bibliographic and holding records are exported. 5.) Verify that tests in t/db_dependent/Exporter/Record.t pass. Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Michal Denar <black23@gmail.com> Trivial changes in test to fix rebase conflict Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 109769 [details] [review] Bug 20447: DBIX schema changes Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Michal Denar <black23@gmail.com> Deleteditem.pm and Item.pm schema files had changes, regenerated them with dbic Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 109770 [details] [review] Bug 20447: (follow-up) Add required metadata field when creating holdings Since metadata column is mandatory in the holdings_metadata table we need to define it already when it is first created instead of creating it first and updating the column immediately after. This fixes the following error during holdings record creation: DBIx::Class::Storage::DBI::_dbh_execute(): Field 'metadata' doesn't have a default value at /kohadevbox/koha/Koha/Objects.pm line 114 Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 109873 [details] [review] Bug 20447: MARC Holdings support Enable by setting "SummaryHoldings" option to "Use". Sponsored-by: The National Library of Finland Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 109874 [details] [review] Bug 20447: Add holding_id to REST API item definition Allows items to be properly returned, including the holding_id field. Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 109875 [details] [review] Bug 20447: Add a batch rebuild script for holdings table This script can be used to update the columns in the holdings table from the MARC record using the rules in the framework. In practice this will only be required if the koha link field is changed in the framework. Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 109877 [details] [review] Bug 20447: Add import/export support for holdings https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20447 Adds support for importing and exporting biblios with interleaved holdings. Test plan: 1.) Import the MARCXML file attached to the bug with the -holdings parameter: misc/migration_tools/bulkmarcimport.pl -biblios -holdings -file holdings.xml -m MARCXML 2.) Verify that the holdings records were imported. 3.) Export the same records with holdings: misc/export_records.pl --record-type=bibs --starting_biblionumber 103 --ending_biblionumber 104 --filename=holdings_export.xml --format=xml --holdings 4.) Verify that both bibliographic and holding records are exported. 5.) Verify that tests in t/db_dependent/Exporter/Record.t pass. Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Michal Denar <black23@gmail.com> Trivial changes in test to fix rebase conflict Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 109878 [details] [review] Bug 20447: DBIX schema changes Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Michal Denar <black23@gmail.com> Deleteditem.pm and Item.pm schema files had changes, regenerated them with dbic Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 109879 [details] [review] Bug 20447: (follow-up) Add required metadata field when creating holdings Since metadata column is mandatory in the holdings_metadata table we need to define it already when it is first created instead of creating it first and updating the column immediately after. This fixes the following error during holdings record creation: DBIx::Class::Storage::DBI::_dbh_execute(): Field 'metadata' doesn't have a default value at /kohadevbox/koha/Koha/Objects.pm line 114 Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Michal Denar <black23@gmail.com>
Fixed a rebase issue that lost a block added in bug 20667 from Koha/Schema/Result/Item.pm.
Created attachment 110115<