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>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 37bf88d252
)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
This commit is contained in:
parent
bb60c9a5fe
commit
4a43d4ce18
1 changed files with 3 additions and 3 deletions
|
@ -79,12 +79,12 @@ my $mappings = GetOAISetsMappings;
|
||||||
# Get all biblionumbers and marcxml
|
# Get all biblionumbers and marcxml
|
||||||
print "Retrieving biblios... " if $verbose;
|
print "Retrieving biblios... " if $verbose;
|
||||||
my $query = qq{
|
my $query = qq{
|
||||||
SELECT biblionumber, metadata
|
SELECT biblionumber, metadata, 0 as "deleted"
|
||||||
FROM biblio_metadata
|
FROM biblio_metadata
|
||||||
WHERE format='marcxml'
|
WHERE format='marcxml'
|
||||||
AND `schema` = ?
|
AND `schema` = ?
|
||||||
UNION
|
UNION
|
||||||
SELECT biblionumber, metadata
|
SELECT biblionumber, metadata, 1 as "deleted"
|
||||||
FROM deletedbiblio_metadata
|
FROM deletedbiblio_metadata
|
||||||
WHERE format='marcxml'
|
WHERE format='marcxml'
|
||||||
AND `schema` = ?
|
AND `schema` = ?
|
||||||
|
@ -140,7 +140,7 @@ foreach my $res (@$results) {
|
||||||
warn "(biblio $biblionumber) Error while creating record from marcxml: $@";
|
warn "(biblio $biblionumber) Error while creating record from marcxml: $@";
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
if($embed_items) {
|
if( $embed_items && !($res->{'deleted'}) ) {
|
||||||
$record = Koha::Biblio::Metadata->record(
|
$record = Koha::Biblio::Metadata->record(
|
||||||
{
|
{
|
||||||
record => $record,
|
record => $record,
|
||||||
|
|
Loading…
Reference in a new issue