Bug 32800 - build_oai_sets.pl fails on deleted records
Summary: build_oai_sets.pl fails on deleted records
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Command-line Utilities (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Nick Clemens
QA Contact: Katrin Fischer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-02 15:57 UTC by Nick Clemens
Modified: 2023-12-28 20:43 UTC (History)
3 users (show)

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


Attachments
Bug 32800: Don't embed items for deleted records (1.61 KB, patch)
2023-02-02 15:59 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 32800: Don't embed items for deleted records (1.61 KB, patch)
2023-03-29 13:03 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 32800: Don't embed items for deleted records (1.69 KB, patch)
2023-03-29 13:19 UTC, Magnus Enger
Details | Diff | Splinter Review
Bug 32800: Don't embed items for deleted records (1.74 KB, patch)
2023-04-10 17:50 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens 2023-02-02 15:57:57 UTC
The code fetches metadata for biblios and deleted biblios, but we cannot embed items on deleted biblios:
Can't call method "items" on an undefined value at /kohadevbox/koha/Koha/Biblio/Metadata.pm line 163.

To recreate:
1 - Delete a biblio
2 - perl /kohadevbox/koha/misc/migration_tools/build_oai_sets.pl -v -i -r
3 - Error:
    Can't call method "items" on an undefined value at /kohadevbox/koha/Koha/Biblio/Metadata.pm line 163.
Comment 1 Nick Clemens 2023-02-02 15:59:13 UTC Comment hidden (obsolete)
Comment 2 Magnus Enger 2023-03-29 10:15:01 UTC Comment hidden (obsolete)
Comment 3 Nick Clemens 2023-03-29 13:03:15 UTC Comment hidden (obsolete)
Comment 4 Magnus Enger 2023-03-29 13:19:42 UTC
Created attachment 148914 [details] [review]
Bug 32800: Don't embed items for deleted records

To test:
1 - Delete a biblio
2 - perl /kohadevbox/koha/misc/migration_tools/build_oai_sets.pl -v -i -r
3 - Error:
    Can't call method "items" on an undefined value at /kohadevbox/koha/Koha/Biblio/Metadata.pm line 163.
4 - Apply patch
5 - Repeat
6 - Success!

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Works as advertised.
Comment 5 Katrin Fischer 2023-04-10 17:50:40 UTC
Created attachment 149408 [details] [review]
Bug 32800: Don't embed items for deleted records

To test:
1 - Delete a biblio
2 - perl /kohadevbox/koha/misc/migration_tools/build_oai_sets.pl -v -i -r
3 - Error:
    Can't call method "items" on an undefined value at /kohadevbox/koha/Koha/Biblio/Metadata.pm line 163.
4 - Apply patch
5 - Repeat
6 - Success!

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Works as advertised.
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 6 Katrin Fischer 2023-04-10 17:51:29 UTC
Also verified that the deleted records are added to the set now correctly and show as "Deleted".
Comment 7 Tomás Cohen Arazi 2023-04-12 12:27:44 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 8 Matt Blenkinsop 2023-04-17 09:03:31 UTC
Nice work everyone!

Pushed to stable for 22.11.x
Comment 9 Lucas Gass 2023-05-05 21:51:44 UTC
Doesn't apply cleanly in 22.05.x, no backport.