Bugzilla – Attachment 180233 Details for
Bug 19220
Allow XSLT processing for Z39.50 authority targets like for bibliographic targets
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19220: (QA follow-up) Allow XSLT processing for Z39.50 authority targets
Bug-19220-QA-follow-up-Allow-XSLT-processing-for-Z.patch (text/plain), 2.71 KB, created by
Nick Clemens (kidclamp)
on 2025-04-02 07:17:35 UTC
(
hide
)
Description:
Bug 19220: (QA follow-up) Allow XSLT processing for Z39.50 authority targets
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2025-04-02 07:17:35 UTC
Size:
2.71 KB
patch
obsolete
>From 647ee80b50b50219560c86a89a3cc662d3f051ff Mon Sep 17 00:00:00 2001 >From: Matthias Meusburger <matthias.meusburger@biblibre.com> >Date: Tue, 1 Apr 2025 12:44:05 +0000 >Subject: [PATCH] Bug 19220: (QA follow-up) Allow XSLT processing for Z39.50 > authority targets > > - Add comment about clearing cache > - Use Koha::Import::Record instead of SQL queries in both tests and code > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > C4/Breeding.pm | 8 +++++--- > t/db_dependent/Breeding_Auth.t | 10 ++++------ > 2 files changed, 9 insertions(+), 9 deletions(-) > >diff --git a/C4/Breeding.pm b/C4/Breeding.pm >index 5917dfc9c2d..938a7376573 100644 >--- a/C4/Breeding.pm >+++ b/C4/Breeding.pm >@@ -509,10 +509,12 @@ sub ImportBreedingAuth { > $searchbreeding->execute( $controlnumber, $heading ); > my ($breedingid) = $searchbreeding->fetchrow; > >+ # This clears the cache, to make sure the record is up-to-date with the XSLT transformation > if ($breedingid) { >- my $updbrd = $dbh->prepare("update import_records set marc=?,marcxml=? where import_record_id=?"); >- $updbrd->execute( $marcrecord->as_usmarc(), $marcrecord->as_xml($marc_type), $breedingid ); >- $updbrd->finish(); >+ my $import_record = Koha::Import::Records->find($breedingid); >+ $import_record->marc( $marcrecord->as_usmarc() ); >+ $import_record->marcxml( $marcrecord->as_xml($marc_type) ); >+ $import_record->store(); > return $breedingid; > } > $breedingid = AddAuthToBatch( $batch_id, 0, $marcrecord, $encoding ); >diff --git a/t/db_dependent/Breeding_Auth.t b/t/db_dependent/Breeding_Auth.t >index 428ca97e5de..bfcd1285ab8 100755 >--- a/t/db_dependent/Breeding_Auth.t >+++ b/t/db_dependent/Breeding_Auth.t >@@ -114,13 +114,11 @@ subtest ImportBreedingAuth => sub { > $breedingid_1 = C4::Breeding::ImportBreedingAuth( $record, "kidclamp", "UTF-8", 'Jansson, Tove' ); > is( $breedingid, $breedingid_1, "For the same record, modified, we get the same id" ); > >- my $sth = $dbh->prepare('SELECT * FROM import_records WHERE import_record_id = ?'); >- $sth->execute($breedingid); >- my $imported_records_record = $sth->fetchrow_hashref(); >- my $imported_record = MARC::Record::new_from_xml( $imported_records_record->{marcxml} ); >+ my $imported_record = Koha::Import::Records->find($breedingid); >+ my $imported_marcrecord = $imported_record->get_marc_record(); > is( >- $imported_record->subfield( '999', 'a' ), $record->subfield( '999', 'a' ), >- 'We also get the new the version of the record' >+ $imported_marcrecord->subfield( '999', 'a' ), $record->subfield( '999', 'a' ), >+ 'We also get the new version of the record' > ); > > # End Bug 19220 >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 19220
:
114604
|
121897
|
121906
|
121907
|
172627
|
172628
|
173438
|
179440
|
180197
|
180232
| 180233