Skip to content

Commit e3c0713

Browse files
committed
Fix for & in MARC conversion for URL
1 parent 68f871c commit e3c0713

5 files changed

Lines changed: 8 additions & 12 deletions

File tree

Koha/Plugin/EDS.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ our $MAJOR_VERSION = "23.11";
3434
our $SUB_VERSION = "001";
3535
our $VERSION = $MAJOR_VERSION . "" . $SUB_VERSION;
3636
our $SHA_ADD = "https://widgets.ebscohost.com/prod/api/koha/sha/1711.json";
37-
our $DATE_UPDATE = '2024-12-10';
37+
our $DATE_UPDATE = '2024-12-11';
3838
######################################################
3939

4040
## Here is our metadata, some keys are required, some are optional

Koha/Plugin/EDS/admin/release_notes.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
<kohaplugin>
44
<latestversion>23.11.001</latestversion>
55
<download>https://github.com/ebsco/edsapi-koha-plugin</download>
6-
<lastupdated>2024/12/10</lastupdated>
6+
<lastupdated>2024/12/11</lastupdated>
77
<releasenotes>
8-
<release version="23.11.001" date="2024/12/10">
8+
<release version="23.11.001" date="2024/12/11">
99
<note id="1" author="omuzzy@ebsco.com">fixes issue where EDS items cannot be sent from cart</note>
1010
<note id="2" author="omuzzy@ebsco.com">fixes issue where EDS items cannot be downloaded from cart</note>
1111
<note id="3" author="omuzzy@ebsco.com">fixes other minor 23.11 errors</note>

Koha/Plugin/EDS/opac/eds-methods.pl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -597,10 +597,8 @@ sub ProcessEDSCartItems
597597
#URL
598598
try{
599599
my $EDSRecordURL = $record->{Record}->{PLink};
600-
$recordXML .= ' <datafield tag="856" ind1="0" ind2="0">
600+
$recordXML .= ' <datafield tag="856" ind1="4" ind2="0">
601601
<subfield code="u" label="Accession Number">'.$EDSRecordURL.'</subfield>
602-
<subfield code="y" label="Accession Number">'.$EDSRecordURL.'</subfield>
603-
<subfield code="z" label="Accession Number">'.$EDSRecordURL.'</subfield>
604602
</datafield>
605603
';
606604
}catch{};
@@ -669,7 +667,7 @@ sub ProcessEDSCartItems
669667

670668
$recordJSON .= "}";
671669
$recordXML .= '</record>';
672-
$recordXML=~s/\&/and/g; # avoid error when converting to marc
670+
$recordXML=~s/\&/\&amp;/g; # avoid error when converting to marc
673671
$dat = from_json($recordJSON); # used instead of decode_json and encode('utf-8',$recordJSON) first.
674672

675673
$record = eval { MARC::Record::new_from_xml( $recordXML, "utf8", C4::Context->preference('marcflavour') ) };

Koha/Plugin/EDS/opac/templates/eds-methods.tt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -629,11 +629,9 @@ sub ProcessEDSCartItems
629629

630630
#URL
631631
try{
632-
my $EDSRecordURL = $record->{Record}->{PLink};
633-
$recordXML .= ' <datafield tag="856" ind1="0" ind2="0">
632+
my $EDSRecordURL = $record->{Record}->{PLink};
633+
$recordXML .= ' <datafield tag="856" ind1="4" ind2="0">
634634
<subfield code="u" label="Accession Number">'.$EDSRecordURL.'</subfield>
635-
<subfield code="y" label="Accession Number">'.$EDSRecordURL.'</subfield>
636-
<subfield code="z" label="Accession Number">'.$EDSRecordURL.'</subfield>
637635
</datafield>
638636
';
639637
}catch{};
@@ -702,7 +700,7 @@ sub ProcessEDSCartItems
702700

703701
$recordJSON .= "}";
704702
$recordXML .= '</record>';
705-
$recordXML=~s/\&/and/g; # avoid error when converting to marc
703+
$recordXML=~s/\&/\&amp;/g; # avoid error when converting to marc
706704
$dat = from_json($recordJSON); # used instead of decode_json and encode('utf-8',$recordJSON) first.
707705

708706
$record = eval { MARC::Record::new_from_xml( $recordXML, "utf8", C4::Context->preference('marcflavour') ) };

eds_plugin_23.11001.kpz

-7 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)