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.
Created attachment 146016 [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!
$ git bz apply 32800 Bug 32800 - build_oai_sets.pl fails on deleted records 146016 - Bug 32800: Don't embed items for deleted records Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 32800: Don't embed items for deleted records error: sha1 information is lacking or useless (misc/migration_tools/build_oai_sets.pl). error: could not build fake ancestor Patch failed at 0001 Bug 32800: Don't embed items for deleted records hint: Use 'git am --show-current-patch=diff' to see the failed 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-32800-Dont-embed-items-for-deleted-records-PJwYZy.patch
Created attachment 148913 [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!
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.
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>
Also verified that the deleted records are added to the set now correctly and show as "Deleted".
Pushed to master for 23.05. Nice work everyone, thanks!
Nice work everyone! Pushed to stable for 22.11.x
Doesn't apply cleanly in 22.05.x, no backport.