Bug 20447 - Add support for MARC holdings records
Summary: Add support for MARC holdings records
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: P5 - low new feature with 10 votes (vote)
Assignee: Ere Maijala
QA Contact: Josef Moravec
URL: https://wiki.koha-community.org/wiki/...
Keywords: rel_20_11_target
: 2797 (view as bug list)
Depends on: 22690
Blocks: 24751
  Show dependency treegraph
 
Reported: 2018-03-19 13:18 UTC by Ere Maijala
Modified: 2020-09-18 06:10 UTC (History)
14 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: Large patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
Initial holdings support (290.23 KB, patch)
2018-04-05 15:05 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: MARC Holdings support (290.24 KB, patch)
2018-04-05 15:07 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: MARC Holdings support (243.76 KB, patch)
2018-06-27 12:58 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: MARC Holdings support (244.33 KB, patch)
2018-06-28 12:52 UTC, Ere Maijala
Details | Diff | Splinter Review
Sample MARCXML file containing biblios with interleaved holdings (6.95 KB, application/xml)
2018-07-04 11:52 UTC, Ere Maijala
Details
Bug 20447: MARC Holdings support (244.76 KB, patch)
2018-07-04 12:27 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add import/export support for holdings (21.26 KB, patch)
2018-07-04 12:27 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: MARC Holdings support (245.40 KB, patch)
2018-07-06 13:16 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add import/export support for holdings (21.26 KB, patch)
2018-07-06 13:16 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: MARC Holdings support (244.38 KB, patch)
2018-08-27 12:14 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add import/export support for holdings (21.25 KB, patch)
2018-08-27 12:14 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Include basic summary holdings in the OAI-PMH responses. (5.50 KB, patch)
2018-08-27 12:14 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: MARC Holdings support (244.36 KB, patch)
2018-09-14 21:33 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add import/export support for holdings (21.25 KB, patch)
2018-09-14 21:33 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Include basic summary holdings in the OAI-PMH responses. (4.93 KB, patch)
2018-09-14 21:33 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Ignore holdings records in staff UI when staging records (3.22 KB, patch)
2018-09-15 22:30 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add a batch rebuild script for holdings table. (3.10 KB, patch)
2018-09-26 10:07 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add missing fields to the holdings framework (39.11 KB, patch)
2018-09-26 13:06 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: MARC Holdings support (233.24 KB, patch)
2018-09-28 10:42 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add import/export support for holdings (21.25 KB, patch)
2018-09-28 10:42 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Include basic summary holdings in the OAI-PMH responses. (4.93 KB, patch)
2018-09-28 10:42 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Ignore holdings records in staff UI when staging records (3.22 KB, patch)
2018-09-28 10:42 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add a batch rebuild script for holdings table. (3.10 KB, patch)
2018-09-28 10:42 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add missing fields to the holdings framework (39.11 KB, patch)
2018-09-28 10:42 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: MARC Holdings support (267.03 KB, patch)
2018-10-02 11:36 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add import/export support for holdings (21.25 KB, patch)
2018-10-02 11:36 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Include basic summary holdings in the OAI-PMH responses. (7.12 KB, patch)
2018-10-02 11:36 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Ignore holdings records in staff UI when staging records (3.22 KB, patch)
2018-10-02 11:36 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add a batch rebuild script for holdings table. (3.10 KB, patch)
2018-10-02 11:37 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add a batch rebuild script for holdings table. (3.10 KB, patch)
2018-10-02 12:16 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: MARC Holdings support (293.18 KB, patch)
2018-10-10 08:55 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add import/export support for holdings (21.25 KB, patch)
2018-10-10 08:55 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Include basic summary holdings in the OAI-PMH responses. (7.12 KB, patch)
2018-10-10 08:55 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Ignore holdings records in staff UI when staging records (3.22 KB, patch)
2018-10-10 08:55 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add a batch rebuild script for holdings table. (3.10 KB, patch)
2018-10-10 08:55 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: MARC Holdings support (226.60 KB, patch)
2018-10-18 12:45 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add import/export support for holdings (21.25 KB, patch)
2018-10-18 12:45 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Include basic summary holdings in the OAI-PMH responses. (7.12 KB, patch)
2018-10-18 12:45 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Ignore holdings records in staff UI when staging records (3.22 KB, patch)
2018-10-18 12:45 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add a batch rebuild script for holdings table. (3.10 KB, patch)
2018-10-18 12:45 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: MARC Holdings support (226.60 KB, patch)
2018-10-26 10:08 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add import/export support for holdings (21.25 KB, patch)
2018-10-26 10:08 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Include basic summary holdings in the OAI-PMH responses. (7.12 KB, patch)
2018-10-26 10:08 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Ignore holdings records in staff UI when staging records (3.22 KB, patch)
2018-10-26 10:08 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add a batch rebuild script for holdings table. (3.10 KB, patch)
2018-10-26 10:08 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: MARC Holdings support (236.08 KB, patch)
2018-11-27 13:57 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add import/export support for holdings (20.68 KB, patch)
2018-11-27 13:57 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Include basic summary holdings in the OAI-PMH responses. (7.12 KB, patch)
2018-11-27 13:57 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Ignore holdings records in staff UI when staging records (3.22 KB, patch)
2018-11-27 13:57 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add a batch rebuild script for holdings table. (3.13 KB, patch)
2018-11-27 13:57 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: MARC Holdings support (239.24 KB, patch)
2018-12-31 12:00 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add import/export support for holdings (21.02 KB, patch)
2018-12-31 12:00 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Include basic summary holdings in the OAI-PMH responses. (7.14 KB, patch)
2018-12-31 12:00 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Ignore holdings records in staff UI when staging records (3.24 KB, patch)
2018-12-31 12:00 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add a batch rebuild script for holdings table. (3.56 KB, patch)
2018-12-31 12:00 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: MARC Holdings support (239.51 KB, patch)
2018-12-31 16:18 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 20447: Add import/export support for holdings (21.16 KB, patch)
2018-12-31 16:18 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 20447: Include basic summary holdings in the OAI-PMH responses. (7.25 KB, patch)
2018-12-31 16:18 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 20447: Ignore holdings records in staff UI when staging records (3.33 KB, patch)
2018-12-31 16:18 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 20447: Add a batch rebuild script for holdings table. (3.67 KB, patch)
2018-12-31 16:18 UTC, Michal Denar
Details | Diff | Splinter Review
Sample MARCXML file with interleaved holdings (7.06 KB, application/xml)
2019-02-20 15:13 UTC, Ere Maijala
Details
Bug 20447: MARC Holdings support (240.23 KB, patch)
2019-02-20 15:53 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add a batch rebuild script for holdings table. (2.43 KB, patch)
2019-02-20 15:53 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add import/export support for holdings (23.04 KB, patch)
2019-02-20 15:53 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: DBIX schema changes (11.81 KB, patch)
2019-02-20 15:53 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: MARC Holdings support (310.72 KB, patch)
2019-02-21 06:38 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add a batch rebuild script for holdings table. (2.43 KB, patch)
2019-02-21 06:38 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add import/export support for holdings (23.04 KB, patch)
2019-02-21 06:38 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: DBIX schema changes (11.81 KB, patch)
2019-02-21 06:38 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: MARC Holdings support (310.83 KB, patch)
2019-03-01 14:37 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add a batch rebuild script for holdings table. (2.43 KB, patch)
2019-03-01 14:37 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add import/export support for holdings (23.04 KB, patch)
2019-03-01 14:37 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: DBIX schema changes (11.81 KB, patch)
2019-03-01 14:37 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: MARC Holdings support (310.88 KB, patch)
2019-03-04 14:12 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add a batch rebuild script for holdings table. (2.43 KB, patch)
2019-03-04 14:13 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add import/export support for holdings (23.04 KB, patch)
2019-03-04 14:13 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: DBIX schema changes (11.81 KB, patch)
2019-03-04 14:13 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: MARC Holdings support (311.22 KB, patch)
2019-03-05 15:16 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add a batch rebuild script for holdings table. (2.43 KB, patch)
2019-03-05 15:16 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add import/export support for holdings (23.04 KB, patch)
2019-03-05 15:16 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: DBIX schema changes (11.81 KB, patch)
2019-03-05 15:16 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: MARC Holdings support (311.10 KB, patch)
2019-04-02 09:22 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add a batch rebuild script for holdings table. (2.43 KB, patch)
2019-04-02 09:22 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add import/export support for holdings (23.04 KB, patch)
2019-04-02 09:22 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: DBIX schema changes (12.07 KB, patch)
2019-04-02 09:22 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: MARC Holdings support (311.39 KB, patch)
2019-04-03 11:35 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 20447: Add a batch rebuild script for holdings table. (2.53 KB, patch)
2019-04-03 11:36 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 20447: Add import/export support for holdings (23.17 KB, patch)
2019-04-03 11:36 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 20447: DBIX schema changes (12.18 KB, patch)
2019-04-03 11:36 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 20447: MARC Holdings support (311.45 KB, patch)
2019-04-25 11:41 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add a batch rebuild script for holdings table. (2.53 KB, patch)
2019-04-25 11:41 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add import/export support for holdings (23.13 KB, patch)
2019-04-25 11:41 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: DBIX schema changes (12.55 KB, patch)
2019-04-25 11:41 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Use blessed objects and fix issues found during review (58.99 KB, patch)
2019-04-25 11:41 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: MARC Holdings support (311.55 KB, patch)
2019-07-23 13:57 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add a batch rebuild script for holdings table. (2.53 KB, patch)
2019-07-23 13:58 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add import/export support for holdings (23.08 KB, patch)
2019-07-23 13:58 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: DBIX schema changes (12.23 KB, patch)
2019-07-23 13:58 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Use blessed objects and fix issues found during review (58.99 KB, patch)
2019-07-23 13:58 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: MARC Holdings support (320.42 KB, patch)
2019-10-22 12:29 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add a batch rebuild script for holdings table. (2.53 KB, patch)
2019-10-22 12:29 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add import/export support for holdings (23.08 KB, patch)
2019-10-22 12:29 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: DBIX schema changes (12.24 KB, patch)
2019-10-22 12:29 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: MARC Holdings support (320.69 KB, patch)
2020-01-23 11:09 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: MARC Holdings support (320.60 KB, patch)
2020-01-23 11:20 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add a batch rebuild script for holdings table. (2.53 KB, patch)
2020-01-23 11:20 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add import/export support for holdings (22.76 KB, patch)
2020-01-23 11:20 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: DBIX schema changes (12.24 KB, patch)
2020-01-23 11:20 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: MARC Holdings support (320.86 KB, patch)
2020-01-23 22:22 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 20447: Add a batch rebuild script for holdings table. (2.58 KB, patch)
2020-01-23 22:22 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 20447: Add import/export support for holdings (22.84 KB, patch)
2020-01-23 22:22 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 20447: DBIX schema changes (12.30 KB, patch)
2020-01-23 22:22 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 20447: MARC Holdings support (320.99 KB, patch)
2020-02-18 08:08 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add a batch rebuild script for holdings table. (2.57 KB, patch)
2020-02-18 08:08 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add import/export support for holdings (22.80 KB, patch)
2020-02-18 08:08 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: DBIX schema changes (12.28 KB, patch)
2020-02-18 08:08 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: MARC Holdings support (321.00 KB, patch)
2020-02-18 12:18 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add a batch rebuild script for holdings table. (2.57 KB, patch)
2020-02-18 12:18 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add import/export support for holdings (22.80 KB, patch)
2020-02-18 12:18 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: DBIX schema changes (12.28 KB, patch)
2020-02-18 12:18 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: MARC Holdings support (320.99 KB, patch)
2020-02-19 07:52 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add holding_id to REST API item definition (972 bytes, patch)
2020-02-19 07:52 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add a batch rebuild script for holdings table (2.57 KB, patch)
2020-02-19 07:52 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add import/export support for holdings (22.80 KB, patch)
2020-02-19 07:52 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: DBIX schema changes (12.28 KB, patch)
2020-02-19 07:52 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: MARC Holdings support (590.07 KB, patch)
2020-05-19 10:20 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add holding_id to REST API item definition (972 bytes, patch)
2020-05-19 10:20 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add a batch rebuild script for holdings table (2.43 KB, patch)
2020-05-19 10:20 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add import/export support for holdings (22.65 KB, patch)
2020-05-19 10:21 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: DBIX schema changes (12.79 KB, patch)
2020-05-19 10:21 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: MARC Holdings support (605.20 KB, patch)
2020-05-22 11:03 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add holding_id to REST API item definition (972 bytes, patch)
2020-05-22 11:03 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add a batch rebuild script for holdings table (2.43 KB, patch)
2020-05-22 11:03 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add import/export support for holdings (22.22 KB, patch)
2020-05-22 11:03 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: DBIX schema changes (12.79 KB, patch)
2020-05-22 11:03 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: MARC Holdings support (605.35 KB, patch)
2020-06-22 07:42 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add holding_id to REST API item definition (972 bytes, patch)
2020-06-22 07:42 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add a batch rebuild script for holdings table (2.43 KB, patch)
2020-06-22 07:42 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add import/export support for holdings (22.22 KB, patch)
2020-06-22 07:42 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: DBIX schema changes (12.79 KB, patch)
2020-06-22 07:42 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: MARC Holdings support (605.78 KB, patch)
2020-08-14 10:03 UTC, Joonas Kylmälä
Details | Diff | Splinter Review
Bug 20447: Add holding_id to REST API item definition (1.09 KB, patch)
2020-08-14 10:03 UTC, Joonas Kylmälä
Details | Diff | Splinter Review
Bug 20447: Add a batch rebuild script for holdings table (2.58 KB, patch)
2020-08-14 10:03 UTC, Joonas Kylmälä
Details | Diff | Splinter Review
Bug 20447: Add import/export support for holdings (22.41 KB, patch)
2020-08-14 10:03 UTC, Joonas Kylmälä
Details | Diff | Splinter Review
Bug 20447: DBIX schema changes (12.48 KB, patch)
2020-08-14 10:03 UTC, Joonas Kylmälä
Details | Diff | Splinter Review
Bug 20447: (follow-up) Add required metadata field when creating holdings (2.79 KB, patch)
2020-08-14 10:03 UTC, Joonas Kylmälä
Details | Diff | Splinter Review
Bug 20447: MARC Holdings support (605.82 KB, patch)
2020-08-15 20:46 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 20447: Add holding_id to REST API item definition (1.14 KB, patch)
2020-08-15 20:46 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 20447: Add a batch rebuild script for holdings table (2.63 KB, patch)
2020-08-15 20:46 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 20447: Add import/export support for holdings (22.45 KB, patch)
2020-08-15 20:46 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 20447: DBIX schema changes (12.53 KB, patch)
2020-08-15 20:46 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 20447: (follow-up) Add required metadata field when creating holdings (2.83 KB, patch)
2020-08-15 20:46 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 20447: MARC Holdings support (605.90 KB, patch)
2020-08-21 09:45 UTC, Joonas Kylmälä
Details | Diff | Splinter Review
Bug 20447: Add holding_id to REST API item definition (1.14 KB, patch)
2020-08-21 09:45 UTC, Joonas Kylmälä
Details | Diff | Splinter Review
Bug 20447: Add a batch rebuild script for holdings table (2.63 KB, patch)
2020-08-21 09:46 UTC, Joonas Kylmälä
Details | Diff | Splinter Review
Bug 20447: Add import/export support for holdings (22.45 KB, patch)
2020-08-21 09:46 UTC, Joonas Kylmälä
Details | Diff | Splinter Review
Bug 20447: DBIX schema changes (12.53 KB, patch)
2020-08-21 09:46 UTC, Joonas Kylmälä
Details | Diff | Splinter Review
Bug 20447: (follow-up) Add required metadata field when creating holdings (2.83 KB, patch)
2020-08-21 09:46 UTC, Joonas Kylmälä
Details | Diff | Splinter Review
Bug 20447: MARC Holdings support (605.99 KB, patch)
2020-09-07 10:51 UTC, Joonas Kylmälä
Details | Diff | Splinter Review
Bug 20447: Add holding_id to REST API item definition (1.14 KB, patch)
2020-09-07 10:51 UTC, Joonas Kylmälä
Details | Diff | Splinter Review
Bug 20447: Add a batch rebuild script for holdings table (2.63 KB, patch)
2020-09-07 10:51 UTC, Joonas Kylmälä
Details | Diff | Splinter Review
Bug 20447: Add import/export support for holdings (22.58 KB, patch)
2020-09-07 10:51 UTC, Joonas Kylmälä
Details | Diff | Splinter Review
Bug 20447: DBIX schema changes (13.29 KB, patch)
2020-09-07 10:52 UTC, Joonas Kylmälä
Details | Diff | Splinter Review
Bug 20447: (follow-up) Add required metadata field when creating holdings (2.83 KB, patch)
2020-09-07 10:52 UTC, Joonas Kylmälä
Details | Diff | Splinter Review
Bug 20447: MARC Holdings support (606.94 KB, patch)
2020-09-07 12:54 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add holding_id to REST API item definition (1.14 KB, patch)
2020-09-07 12:54 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add a batch rebuild script for holdings table (2.62 KB, patch)
2020-09-07 12:54 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add import/export support for holdings (22.54 KB, patch)
2020-09-07 12:54 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: DBIX schema changes (13.27 KB, patch)
2020-09-07 12:55 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: (follow-up) Add required metadata field when creating holdings (2.83 KB, patch)
2020-09-07 12:55 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add holding_id to REST API item definition (1.19 KB, patch)
2020-09-07 20:50 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 20447: Add a batch rebuild script for holdings table (2.68 KB, patch)
2020-09-07 20:51 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 20447: Add import/export support for holdings (22.62 KB, patch)
2020-09-07 20:51 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 20447: DBIX schema changes (13.33 KB, patch)
2020-09-07 20:51 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 20447: (follow-up) Add required metadata field when creating holdings (2.88 KB, patch)
2020-09-07 20:51 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 20447: MARC Holdings support (612.18 KB, patch)
2020-09-08 07:12 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add holding_id to REST API item definition (1.14 KB, patch)
2020-09-08 07:12 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add a batch rebuild script for holdings table (2.62 KB, patch)
2020-09-08 07:12 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add import/export support for holdings (22.54 KB, patch)
2020-09-08 07:12 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: DBIX schema changes (13.27 KB, patch)
2020-09-08 07:12 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: (follow-up) Add required metadata field when creating holdings (2.83 KB, patch)
2020-09-08 07:12 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: MARC Holdings support (611.79 KB, patch)
2020-09-08 10:04 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add holding_id to REST API item definition (1.14 KB, patch)
2020-09-08 10:04 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add a batch rebuild script for holdings table (2.62 KB, patch)
2020-09-08 10:04 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add import/export support for holdings (22.84 KB, patch)
2020-09-08 10:04 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: DBIX schema changes (13.27 KB, patch)
2020-09-08 10:04 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: (follow-up) Add required metadata field when creating holdings (2.83 KB, patch)
2020-09-08 10:04 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: MARC Holdings support (612.07 KB, patch)
2020-09-08 19:33 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 20447: Add holding_id to REST API item definition (1.19 KB, patch)
2020-09-08 19:33 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 20447: Add a batch rebuild script for holdings table (2.68 KB, patch)
2020-09-08 19:33 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 20447: Add import/export support for holdings (22.93 KB, patch)
2020-09-08 19:33 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 20447: DBIX schema changes (13.33 KB, patch)
2020-09-08 19:33 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 20447: (follow-up) Add required metadata field when creating holdings (2.88 KB, patch)
2020-09-08 19:34 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 20447: MARC Holdings support (611.84 KB, patch)
2020-09-11 06:09 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add holding_id to REST API item definition (1.19 KB, patch)
2020-09-11 06:09 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add a batch rebuild script for holdings table (2.67 KB, patch)
2020-09-11 06:09 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add import/export support for holdings (22.89 KB, patch)
2020-09-11 06:10 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: DBIX schema changes (12.79 KB, patch)
2020-09-11 06:10 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: (follow-up) Add required metadata field when creating holdings (2.88 KB, patch)
2020-09-11 06:10 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: (follow-up) Prevent internal server error with Attach item feature (1020 bytes, patch)
2020-09-15 16:46 UTC, Joonas Kylmälä
Details | Diff | Splinter Review
Bug 20447: (follow-up) Fix holding_branch getter to handle null (812 bytes, patch)
2020-09-16 11:39 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: MARC Holdings support (543.07 KB, patch)
2020-09-18 06:07 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add holding_id to REST API item definition (1.19 KB, patch)
2020-09-18 06:07 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add a batch rebuild script for holdings table (2.67 KB, patch)
2020-09-18 06:07 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: Add import/export support for holdings (22.89 KB, patch)
2020-09-18 06:07 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: DBIX schema changes (12.79 KB, patch)
2020-09-18 06:07 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: (follow-up) Add required metadata field when creating holdings (2.88 KB, patch)
2020-09-18 06:08 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: (follow-up) Prevent internal server error with Attach item feature (1020 bytes, patch)
2020-09-18 06:08 UTC, Ere Maijala
Details | Diff | Splinter Review
Bug 20447: (follow-up) Fix holding_branch getter to handle null (812 bytes, patch)
2020-09-18 06:08 UTC, Ere Maijala
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Ere Maijala 2018-03-19 13:18:51 UTC
RFC: https://wiki.koha-community.org/wiki/MARC_Holdings_Records_RFC

This is placeholder for upcoming activity.
Comment 1 Ere Maijala 2018-03-19 13:19:55 UTC
This will obsolete bug 2797.
Comment 2 Katrin Fischer 2018-04-01 14:27:39 UTC
*** Bug 2797 has been marked as a duplicate of this bug. ***
Comment 3 Ere Maijala 2018-04-05 15:05:45 UTC
Created attachment 73703 [details] [review]
Initial holdings support
Comment 4 Ere Maijala 2018-04-05 15:07:31 UTC
Created attachment 73704 [details] [review]
Bug 20447: MARC Holdings support
Comment 5 Ere Maijala 2018-04-05 15:13:08 UTC
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
Comment 6 Ere Maijala 2018-06-27 12:58:47 UTC
Created attachment 76485 [details] [review]
Bug 20447: MARC Holdings support
Comment 7 Ere Maijala 2018-06-28 12:52:24 UTC
Created attachment 76542 [details] [review]
Bug 20447: MARC Holdings support
Comment 8 Ere Maijala 2018-07-04 11:52:07 UTC
Created attachment 76670 [details]
Sample MARCXML file containing biblios with interleaved holdings
Comment 9 Ere Maijala 2018-07-04 12:27:08 UTC
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".
Comment 10 Ere Maijala 2018-07-04 12:27:12 UTC
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.
Comment 11 Ere Maijala 2018-07-06 13:16:13 UTC
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".
Comment 12 Ere Maijala 2018-07-06 13:16:18 UTC
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.
Comment 13 Ere Maijala 2018-08-27 12:14:47 UTC
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".
Comment 14 Ere Maijala 2018-08-27 12:14:51 UTC
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.
Comment 15 Ere Maijala 2018-08-27 12:14:54 UTC
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.
Comment 16 Ere Maijala 2018-09-14 21:33:02 UTC
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".
Comment 17 Ere Maijala 2018-09-14 21:33:08 UTC
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.
Comment 18 Ere Maijala 2018-09-14 21:33:14 UTC
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.
Comment 19 Ere Maijala 2018-09-15 16:57:42 UTC
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.
Comment 20 Ere Maijala 2018-09-15 22:30:11 UTC
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.
Comment 21 Hugo Agud 2018-09-25 13:50:31 UTC
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
Comment 22 Ere Maijala 2018-09-25 14:01:29 UTC
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.
Comment 23 Ere Maijala 2018-09-26 10:07:08 UTC
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.
Comment 24 Ere Maijala 2018-09-26 13:06:05 UTC
Created attachment 79413 [details] [review]
Bug 20447: Add missing fields to the holdings framework

Adds fields 337, 338, 347, 5xx and 84x.
Comment 25 Hugo Agud 2018-09-27 13:47:47 UTC
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
Comment 26 Ere Maijala 2018-09-28 10:42:09 UTC
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".
Comment 27 Ere Maijala 2018-09-28 10:42:13 UTC
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.
Comment 28 Ere Maijala 2018-09-28 10:42:17 UTC
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.
Comment 29 Ere Maijala 2018-09-28 10:42:21 UTC
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.
Comment 30 Ere Maijala 2018-09-28 10:42:25 UTC
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.
Comment 31 Ere Maijala 2018-09-28 10:42:29 UTC
Created attachment 79570 [details] [review]
Bug 20447: Add missing fields to the holdings framework

Adds fields 337, 338, 347, 5xx and 84x.
Comment 32 Ere Maijala 2018-09-28 10:49:52 UTC
Updated the patches to remove schema changes. Please run misc/devel/update_dbix_class_files.pl to update the schema files when testing.
Comment 33 Ere Maijala 2018-10-02 11:36:44 UTC
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".
Comment 34 Ere Maijala 2018-10-02 11:36:48 UTC
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.
Comment 35 Ere Maijala 2018-10-02 11:36:52 UTC
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.
Comment 36 Ere Maijala 2018-10-02 11:36:56 UTC
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.
Comment 37 Ere Maijala 2018-10-02 11:37:01 UTC
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.
Comment 38 Ere Maijala 2018-10-02 11:38:18 UTC
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
Comment 39 Ere Maijala 2018-10-02 12:16:44 UTC
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.
Comment 40 Ere Maijala 2018-10-10 08:55:33 UTC
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".
Comment 41 Ere Maijala 2018-10-10 08:55:37 UTC
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.
Comment 42 Ere Maijala 2018-10-10 08:55:42 UTC
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.
Comment 43 Ere Maijala 2018-10-10 08:55:46 UTC
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.
Comment 44 Ere Maijala 2018-10-10 08:55:51 UTC
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.
Comment 45 Ere Maijala 2018-10-10 09:05:45 UTC
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
Comment 46 Ere Maijala 2018-10-18 12:45:06 UTC
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".
Comment 47 Ere Maijala 2018-10-18 12:45:11 UTC
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.
Comment 48 Ere Maijala 2018-10-18 12:45:15 UTC
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.
Comment 49 Ere Maijala 2018-10-18 12:45:20 UTC
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.
Comment 50 Ere Maijala 2018-10-18 12:45:24 UTC
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.
Comment 51 Ere Maijala 2018-10-18 12:49:02 UTC
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.
Comment 52 Ere Maijala 2018-10-26 10:08:17 UTC
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".
Comment 53 Ere Maijala 2018-10-26 10:08:22 UTC
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.
Comment 54 Ere Maijala 2018-10-26 10:08:26 UTC
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.
Comment 55 Ere Maijala 2018-10-26 10:08:30 UTC
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.
Comment 56 Ere Maijala 2018-10-26 10:08:34 UTC
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.
Comment 57 Ere Maijala 2018-11-27 13:57:06 UTC
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".
Comment 58 Ere Maijala 2018-11-27 13:57:12 UTC
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.
Comment 59 Ere Maijala 2018-11-27 13:57:17 UTC
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.
Comment 60 Ere Maijala 2018-11-27 13:57:22 UTC
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.
Comment 61 Ere Maijala 2018-11-27 13:57:27 UTC
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.
Comment 62 Michal Denar 2018-12-29 15:31:10 UTC
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
Comment 63 Ere Maijala 2018-12-31 12:00:16 UTC
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
Comment 64 Ere Maijala 2018-12-31 12:00:21 UTC
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.
Comment 65 Ere Maijala 2018-12-31 12:00:26 UTC
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.
Comment 66 Ere Maijala 2018-12-31 12:00:31 UTC
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.
Comment 67 Ere Maijala 2018-12-31 12:00:36 UTC
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.
Comment 68 Ere Maijala 2018-12-31 12:02:22 UTC
Hi Mike, and thanks for testing. I had accidentally broken the tests, should be fixed and improved now.
Comment 69 Michal Denar 2018-12-31 16:18:23 UTC
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>
Comment 70 Michal Denar 2018-12-31 16:18:27 UTC
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>
Comment 71 Michal Denar 2018-12-31 16:18:32 UTC
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>
Comment 72 Michal Denar 2018-12-31 16:18:36 UTC
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>
Comment 73 Michal Denar 2018-12-31 16:18:40 UTC
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>
Comment 74 Josef Moravec 2019-01-28 16:42:48 UTC
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.
Comment 75 Ere Maijala 2019-01-29 07:52:13 UTC
Ok, I'll revise.
Comment 76 Ere Maijala 2019-02-20 15:13:13 UTC
Created attachment 85364 [details]
Sample MARCXML file with interleaved holdings
Comment 77 Ere Maijala 2019-02-20 15:53:38 UTC
Created attachment 85368 [details] [review]
Bug 20447: MARC Holdings support

Enable by setting "SummaryHoldings" option to "Use".
Comment 78 Ere Maijala 2019-02-20 15:53:43 UTC
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.
Comment 79 Ere Maijala 2019-02-20 15:53:48 UTC
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.
Comment 80 Ere Maijala 2019-02-20 15:53:53 UTC
Created attachment 85371 [details] [review]
Bug 20447: DBIX schema changes
Comment 81 Ere Maijala 2019-02-20 15:55:04 UTC
Almost there. I missed addition of holdings framework to update scripts, so clearing status until I get that fixed.
Comment 82 Ere Maijala 2019-02-21 06:38:17 UTC
Created attachment 85416 [details] [review]
Bug 20447: MARC Holdings support

Enable by setting "SummaryHoldings" option to "Use".
Comment 83 Ere Maijala 2019-02-21 06:38:21 UTC
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.
Comment 84 Ere Maijala 2019-02-21 06:38:26 UTC
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.
Comment 85 Ere Maijala 2019-02-21 06:38:30 UTC
Created attachment 85419 [details] [review]
Bug 20447: DBIX schema changes
Comment 86 Ere Maijala 2019-02-21 06:46:50 UTC
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.
Comment 87 Ere Maijala 2019-02-21 06:59:44 UTC
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.
Comment 88 Ere Maijala 2019-02-22 09:59:07 UTC
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.
Comment 89 Ere Maijala 2019-03-01 14:37:15 UTC
Created attachment 85906 [details] [review]
Bug 20447: MARC Holdings support

Enable by setting "SummaryHoldings" option to "Use".
Comment 90 Ere Maijala 2019-03-01 14:37:19 UTC
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.
Comment 91 Ere Maijala 2019-03-01 14:37:24 UTC
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.
Comment 92 Ere Maijala 2019-03-01 14:37:29 UTC
Created attachment 85909 [details] [review]
Bug 20447: DBIX schema changes
Comment 93 Ere Maijala 2019-03-04 14:12:56 UTC
Created attachment 85994 [details] [review]
Bug 20447: MARC Holdings support

Enable by setting "SummaryHoldings" option to "Use".

Sponsored-by: The National Library of Finland
Comment 94 Ere Maijala 2019-03-04 14:13:01 UTC
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.
Comment 95 Ere Maijala 2019-03-04 14:13:06 UTC
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.
Comment 96 Ere Maijala 2019-03-04 14:13:10 UTC
Created attachment 85997 [details] [review]
Bug 20447: DBIX schema changes
Comment 97 Joonas Kylmälä 2019-03-05 13:50:14 UTC
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 98 Joonas Kylmälä 2019-03-05 13:58:25 UTC
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 99 Joonas Kylmälä 2019-03-05 14:00:46 UTC
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
Comment 100 Ere Maijala 2019-03-05 14:05:01 UTC
(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.
Comment 101 Ere Maijala 2019-03-05 14:07:53 UTC
(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.
Comment 102 Ere Maijala 2019-03-05 14:13:21 UTC
(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.
Comment 103 Joonas Kylmälä 2019-03-05 14:14:01 UTC
(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.
Comment 104 Joonas Kylmälä 2019-03-05 14:21:20 UTC
(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)
Comment 105 Ere Maijala 2019-03-05 14:32:09 UTC
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.
Comment 106 Ere Maijala 2019-03-05 15:16:16 UTC
Created attachment 86088 [details] [review]
Bug 20447: MARC Holdings support

Enable by setting "SummaryHoldings" option to "Use".

Sponsored-by: The National Library of Finland
Comment 107 Ere Maijala 2019-03-05 15:16:21 UTC
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.
Comment 108 Ere Maijala 2019-03-05 15:16:26 UTC
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.
Comment 109 Ere Maijala 2019-03-05 15:16:32 UTC
Created attachment 86091 [details] [review]
Bug 20447: DBIX schema changes
Comment 110 Ere Maijala 2019-03-05 15:18:06 UTC
Fixed item relinking and made saving a holdings record reindex its biblio record.
Comment 111 Michal Denar 2019-03-26 15:57:58 UTC
Ere, please rebase on master.

Thank you.
Comment 112 Michal Denar 2019-03-26 16:00:08 UTC
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
Comment 113 Josef Moravec 2019-03-26 16:33:39 UTC
(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
Comment 114 Ere Maijala 2019-04-02 09:22:11 UTC
Created attachment 87307 [details] [review]
Bug 20447: MARC Holdings support

Enable by setting "SummaryHoldings" option to "Use".

Sponsored-by: The National Library of Finland
Comment 115 Ere Maijala 2019-04-02 09:22:15 UTC
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.
Comment 116 Ere Maijala 2019-04-02 09:22:20 UTC
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.
Comment 117 Ere Maijala 2019-04-02 09:22:24 UTC
Created attachment 87310 [details] [review]
Bug 20447: DBIX schema changes
Comment 118 Ere Maijala 2019-04-02 09:23:21 UTC
Rebased, but the schema patch is likely to break again..
Comment 119 Michal Denar 2019-04-02 21:48:09 UTC
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.
Comment 120 Ere Maijala 2019-04-03 06:54:23 UTC
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.
Comment 121 Michal Denar 2019-04-03 11:11:31 UTC
Hi Ere,
sorry my fault., no holdings.xml on devbox :-(

I'll next round...

Thanks to Josef for kick.
Comment 122 Michal Denar 2019-04-03 11:35:54 UTC
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>
Comment 123 Michal Denar 2019-04-03 11:36:02 UTC
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>
Comment 124 Michal Denar 2019-04-03 11:36:09 UTC
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>
Comment 125 Michal Denar 2019-04-03 11:36:16 UTC
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 126 Josef Moravec 2019-04-17 15:03:43 UTC
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
Comment 127 Josef Moravec 2019-04-17 15:04:43 UTC
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 ( &rsaquo; 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 ( &rsaquo; <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
Comment 128 Ere Maijala 2019-04-25 11:41:09 UTC
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>
Comment 129 Ere Maijala 2019-04-25 11:41:15 UTC
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>
Comment 130 Ere Maijala 2019-04-25 11:41:20 UTC
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>
Comment 131 Ere Maijala 2019-04-25 11:41:25 UTC
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>
Comment 132 Ere Maijala 2019-04-25 11:41:30 UTC
Created attachment 88755 [details] [review]
Bug 20447: Use blessed objects and fix issues found during review
Comment 133 Ere Maijala 2019-04-25 11:49:32 UTC
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.
Comment 134 Joonas Kylmälä 2019-05-08 12:32:32 UTC
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.
Comment 135 Katrin Fischer 2019-05-08 20:56:33 UTC
(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.
Comment 136 Ere Maijala 2019-07-23 13:12:21 UTC
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.
Comment 137 Ere Maijala 2019-07-23 13:57:58 UTC
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>
Comment 138 Ere Maijala 2019-07-23 13:58:10 UTC
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>
Comment 139 Ere Maijala 2019-07-23 13:58:18 UTC
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>
Comment 140 Ere Maijala 2019-07-23 13:58:24 UTC
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>
Comment 141 Ere Maijala 2019-07-23 13:58:32 UTC
Created attachment 91747 [details] [review]
Bug 20447: Use blessed objects and fix issues found during review
Comment 142 Ere Maijala 2019-07-23 14:00:44 UTC
Rebased. Setting back to Signed Off. Please set back and describe the issue in detail if it's real.
Comment 143 Joonas Kylmälä 2019-07-24 07:43:09 UTC
(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.
Comment 144 Ere Maijala 2019-07-24 08:11:28 UTC
Ok, thanks, I'll fix..
Comment 145 Ere Maijala 2019-07-24 11:32:43 UTC
Looks like bug 22690 is needed so that merge can be done in a sensible way.
Comment 146 Ere Maijala 2019-08-28 07:12:22 UTC
Note to self: make sure there's also an index on the timestamp column.
Comment 147 David Cook 2019-08-28 23:57:50 UTC
(In reply to Ere Maijala from comment #146)
> Note to self: make sure there's also an index on the timestamp column.

+1000
Comment 148 Ere Maijala 2019-10-22 12:29:06 UTC
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>
Comment 149 Ere Maijala 2019-10-22 12:29:13 UTC
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>
Comment 150 Ere Maijala 2019-10-22 12:29:20 UTC
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>
Comment 151 Ere Maijala 2019-10-22 12:29:27 UTC
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>
Comment 152 Ere Maijala 2019-10-22 12:39:48 UTC
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.
Comment 153 Jonathan Druart 2020-01-22 10:37:03 UTC
browser-strings.inc will be removed by bug 23884.
Comment 154 Ere Maijala 2020-01-23 11:09:06 UTC
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>
Comment 155 Ere Maijala 2020-01-23 11:20:19 UTC
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>
Comment 156 Ere Maijala 2020-01-23 11:20:24 UTC
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>
Comment 157 Ere Maijala 2020-01-23 11:20:29 UTC
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>
Comment 158 Ere Maijala 2020-01-23 11:20:34 UTC
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>
Comment 159 Ere Maijala 2020-01-23 11:21:14 UTC
Rebased.
Comment 160 Michal Denar 2020-01-23 22:22:37 UTC
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>
Comment 161 Michal Denar 2020-01-23 22:22:44 UTC
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>
Comment 162 Michal Denar 2020-01-23 22:22:50 UTC
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>
Comment 163 Michal Denar 2020-01-23 22:22:55 UTC
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>
Comment 164 Ere Maijala 2020-02-18 08:08:07 UTC
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>
Comment 165 Ere Maijala 2020-02-18 08:08:13 UTC
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>
Comment 166 Ere Maijala 2020-02-18 08:08:18 UTC
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>
Comment 167 Ere Maijala 2020-02-18 08:08:23 UTC
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>
Comment 168 Ere Maijala 2020-02-18 08:10:50 UTC
Rebased.
Comment 169 Ere Maijala 2020-02-18 12:18:40 UTC
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>
Comment 170 Ere Maijala 2020-02-18 12:18:46 UTC
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>
Comment 171 Ere Maijala 2020-02-18 12:18:52 UTC
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>
Comment 172 Ere Maijala 2020-02-18 12:18:57 UTC
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>
Comment 173 Ere Maijala 2020-02-18 12:19:25 UTC
Fixed a typo introduced during last rebase.
Comment 174 Ere Maijala 2020-02-19 07:52:37 UTC
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>
Comment 175 Ere Maijala 2020-02-19 07:52:42 UTC
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.
Comment 176 Ere Maijala 2020-02-19 07:52:48 UTC
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>
Comment 177 Ere Maijala 2020-02-19 07:52:53 UTC
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>
Comment 178 Ere Maijala 2020-02-19 07:52:59 UTC
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>
Comment 179 Ere Maijala 2020-02-19 07:54:07 UTC
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.
Comment 180 Josef Moravec 2020-05-12 18:30:00 UTC
Please, rebase
Comment 181 Josef Moravec 2020-05-15 08:01:43 UTC
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 &rsaquo; Holdings &rsaquo; 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>
Comment 182 Ere Maijala 2020-05-15 08:07:44 UTC
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.
Comment 183 Ere Maijala 2020-05-19 10:20:43 UTC
Created attachment 105068 [details] [review]
Bug 20447: MARC Holdings support

Enable by setting "SummaryHoldings" option to "Use".

Sponsored-by: The National Library of Finland
Comment 184 Ere Maijala 2020-05-19 10:20:50 UTC
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.
Comment 185 Ere Maijala 2020-05-19 10:20:57 UTC
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.
Comment 186 Ere Maijala 2020-05-19 10:21:04 UTC
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.
Comment 187 Ere Maijala 2020-05-19 10:21:11 UTC
Created attachment 105072 [details] [review]
Bug 20447: DBIX schema changes
Comment 188 Ere Maijala 2020-05-19 10:22:35 UTC
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.
Comment 189 Ere Maijala 2020-05-22 11:03:31 UTC
Created attachment 105259 [details] [review]
Bug 20447: MARC Holdings support

Enable by setting "SummaryHoldings" option to "Use".

Sponsored-by: The National Library of Finland
Comment 190 Ere Maijala 2020-05-22 11:03:38 UTC
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.
Comment 191 Ere Maijala 2020-05-22 11:03:44 UTC
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.
Comment 192 Ere Maijala 2020-05-22 11:03:51 UTC
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.
Comment 193 Ere Maijala 2020-05-22 11:03:57 UTC
Created attachment 105263 [details] [review]
Bug 20447: DBIX schema changes
Comment 194 Ere Maijala 2020-05-22 11:13:05 UTC
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.
Comment 195 Ere Maijala 2020-06-22 07:42:06 UTC
Created attachment 106147 [details] [review]
Bug 20447: MARC Holdings support

Enable by setting "SummaryHoldings" option to "Use".

Sponsored-by: The National Library of Finland
Comment 196 Ere Maijala 2020-06-22 07:42:13 UTC
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.
Comment 197 Ere Maijala 2020-06-22 07:42:19 UTC
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.
Comment 198 Ere Maijala 2020-06-22 07:42:26 UTC
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.
Comment 199 Ere Maijala 2020-06-22 07:42:31 UTC
Created attachment 106151 [details] [review]
Bug 20447: DBIX schema changes
Comment 200 Ere Maijala 2020-06-22 07:43:43 UTC
Rebased and added logic to select the holdings tab instead of items tab if the bibliographic record has holdings records but no items.
Comment 201 Joonas Kylmälä 2020-08-14 10:03:04 UTC
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>
Comment 202 Joonas Kylmälä 2020-08-14 10:03:15 UTC
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>
Comment 203 Joonas Kylmälä 2020-08-14 10:03:24 UTC
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>
Comment 204 Joonas Kylmälä 2020-08-14 10:03:34 UTC
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>
Comment 205 Joonas Kylmälä 2020-08-14 10:03:46 UTC
Created attachment 108254 [details] [review]
Bug 20447: DBIX schema changes

Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Comment 206 Joonas Kylmälä 2020-08-14 10:03:54 UTC
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
Comment 207 Michal Denar 2020-08-15 20:46:14 UTC
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>
Comment 208 Michal Denar 2020-08-15 20:46:21 UTC
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>
Comment 209 Michal Denar 2020-08-15 20:46:28 UTC
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>
Comment 210 Michal Denar 2020-08-15 20:46:35 UTC
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>
Comment 211 Michal Denar 2020-08-15 20:46:42 UTC
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>
Comment 212 Michal Denar 2020-08-15 20:46:49 UTC
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>
Comment 213 Joonas Kylmälä 2020-08-21 09:45:53 UTC
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>
Comment 214 Joonas Kylmälä 2020-08-21 09:45:59 UTC
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>
Comment 215 Joonas Kylmälä 2020-08-21 09:46:04 UTC
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>
Comment 216 Joonas Kylmälä 2020-08-21 09:46:10 UTC
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>
Comment 217 Joonas Kylmälä 2020-08-21 09:46:17 UTC
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>
Comment 218 Joonas Kylmälä 2020-08-21 09:46:22 UTC
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>
Comment 219 Joonas Kylmälä 2020-08-21 09:54:10 UTC
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).
Comment 220 Joonas Kylmälä 2020-08-28 08:56:23 UTC
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.
Comment 221 Joonas Kylmälä 2020-09-07 10:51:31 UTC
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>
Comment 222 Joonas Kylmälä 2020-09-07 10:51:39 UTC
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>
Comment 223 Joonas Kylmälä 2020-09-07 10:51:48 UTC
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>
Comment 224 Joonas Kylmälä 2020-09-07 10:51:56 UTC
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>
Comment 225 Joonas Kylmälä 2020-09-07 10:52:06 UTC
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>
Comment 226 Joonas Kylmälä 2020-09-07 10:52:18 UTC
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>
Comment 227 Joonas Kylmälä 2020-09-07 10:57:13 UTC
Rebased. The issue with deletion still exists so keeping FQA status.
Comment 228 Ere Maijala 2020-09-07 12:54:22 UTC
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>
Comment 229 Ere Maijala 2020-09-07 12:54:32 UTC
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>
Comment 230 Ere Maijala 2020-09-07 12:54:43 UTC
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>
Comment 231 Ere Maijala 2020-09-07 12:54:53 UTC
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>
Comment 232 Ere Maijala 2020-09-07 12:55:00 UTC
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>
Comment 233 Ere Maijala 2020-09-07 12:55:08 UTC
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>
Comment 234 Ere Maijala 2020-09-07 12:57:01 UTC
Check for existing holdings has now been added.
Comment 235 Michal Denar 2020-09-07 20:50:59 UTC
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>
Comment 236 Michal Denar 2020-09-07 20:51:15 UTC
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>
Comment 237 Michal Denar 2020-09-07 20:51:27 UTC
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>
Comment 238 Michal Denar 2020-09-07 20:51:39 UTC
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>
Comment 239 Michal Denar 2020-09-07 20:51:55 UTC
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>
Comment 240 Andrew Nugged 2020-09-08 04:38:42 UTC
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 241 Ere Maijala 2020-09-08 05:58:20 UTC
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.
Comment 242 Ere Maijala 2020-09-08 07:12:00 UTC
Created attachment 109717 [details] [review]
Bug 20447: MARC Holdings support

Enable by setting "SummaryHoldings" option to "Use".

Sponsored-by: The National Library of Finland
Comment 243 Ere Maijala 2020-09-08 07:12:07 UTC
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>
Comment 244 Ere Maijala 2020-09-08 07:12:16 UTC
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>
Comment 245 Ere Maijala 2020-09-08 07:12:25 UTC
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>
Comment 246 Ere Maijala 2020-09-08 07:12:33 UTC
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>
Comment 247 Ere Maijala 2020-09-08 07:12:41 UTC
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>
Comment 248 Ere Maijala 2020-09-08 07:14:36 UTC
Fixed acquisitions to consider existing holdings records and Koha::Biblio->holdings to only return non-deleted records. Needs new signoff for the base patch.
Comment 249 Ere Maijala 2020-09-08 10:04:10 UTC
Created attachment 109741 [details] [review]
Bug 20447: MARC Holdings support

Enable by setting "SummaryHoldings" option to "Use".

Sponsored-by: The National Library of Finland
Comment 250 Ere Maijala 2020-09-08 10:04:20 UTC
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>
Comment 251 Ere Maijala 2020-09-08 10:04:27 UTC
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>
Comment 252 Ere Maijala 2020-09-08 10:04:38 UTC
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>
Comment 253 Ere Maijala 2020-09-08 10:04:49 UTC
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>
Comment 254 Ere Maijala 2020-09-08 10:04:58 UTC
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>
Comment 255 Ere Maijala 2020-09-08 10:29:41 UTC
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.
Comment 256 Michal Denar 2020-09-08 19:33:06 UTC
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>
Comment 257 Michal Denar 2020-09-08 19:33:16 UTC
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>
Comment 258 Michal Denar 2020-09-08 19:33:27 UTC
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>
Comment 259 Michal Denar 2020-09-08 19:33:42 UTC
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>
Comment 260 Michal Denar 2020-09-08 19:33:54 UTC
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>
Comment 261 Michal Denar 2020-09-08 19:34:05 UTC
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>
Comment 262 Ere Maijala 2020-09-11 06:09:34 UTC
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>
Comment 263 Ere Maijala 2020-09-11 06:09:41 UTC
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>
Comment 264 Ere Maijala 2020-09-11 06:09:49 UTC
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>
Comment 265 Ere Maijala 2020-09-11 06:10:00 UTC
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>
Comment 266 Ere Maijala 2020-09-11 06:10:09 UTC
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>
Comment 267 Ere Maijala 2020-09-11 06:10:17 UTC
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>
Comment 268 Ere Maijala 2020-09-11 06:12:11 UTC
Fixed a rebase issue that lost a block added in bug 20667 from Koha/Schema/Result/Item.pm.
Comment 269 Joonas Kylmälä 2020-09-15 16:46:02 UTC
Created attachment 110115 [details] [review]
Bug 20447: (follow-up) Prevent internal server error with Attach item feature

If one tried to use the "Edit -> Attach item" feature in biblio detail.pl
page then the following error would come if the item was not attached
to any holdings record:

"DBIC result _type  isn't of the _type Holding"

This fix prevents the error by skipping the creation of Holding object
if the result set is empty.
Comment 270 Ere Maijala 2020-09-16 11:39:54 UTC
Created attachment 110174 [details] [review]
Bug 20447: (follow-up) Fix holding_branch getter to handle null

This fix avoids an internal server error when holdingbranch column is empty in the database. This could happen e.g. when there's a problem with the framework's Koha field mapping.
Comment 271 Ere Maijala 2020-09-18 06:07:15 UTC
Created attachment 110313 [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>
Comment 272 Ere Maijala 2020-09-18 06:07:26 UTC
Created attachment 110314 [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>
Comment 273 Ere Maijala 2020-09-18 06:07:36 UTC
Created attachment 110315 [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>
Comment 274 Ere Maijala 2020-09-18 06:07:45 UTC
Created attachment 110316 [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>
Comment 275 Ere Maijala 2020-09-18 06:07:54 UTC
Created attachment 110317 [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>
Comment 276 Ere Maijala 2020-09-18 06:08:03 UTC
Created attachment 110318 [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>
Comment 277 Ere Maijala 2020-09-18 06:08:12 UTC
Created attachment 110319 [details] [review]
Bug 20447: (follow-up) Prevent internal server error with Attach item feature

If one tried to use the "Edit -> Attach item" feature in biblio detail.pl
page then the following error would come if the item was not attached
to any holdings record:

"DBIC result _type  isn't of the _type Holding"

This fix prevents the error by skipping the creation of Holding object
if the result set is empty.
Comment 278 Ere Maijala 2020-09-18 06:08:24 UTC
Created attachment 110320 [details] [review]
Bug 20447: (follow-up) Fix holding_branch getter to handle null

This fix avoids an internal server error when holdingbranch column is empty in the database. This could happen e.g. when there's a problem with the framework's Koha field mapping.
Comment 279 Ere Maijala 2020-09-18 06:10:07 UTC
Reverted changes to obsolete nb-NO framework sql. Carried over the sign-offs.