Bugzilla – Attachment 180050 Details for
Bug 38928
Openurl 'id' or 'rft_id' may contain key information
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38928: Handle rft_id or id
Bug-38928-Handle-rftid-or-id.patch (text/plain), 2.50 KB, created by
Caroline Cyr La Rose
on 2025-03-31 14:12:53 UTC
(
hide
)
Description:
Bug 38928: Handle rft_id or id
Filename:
MIME Type:
Creator:
Caroline Cyr La Rose
Created:
2025-03-31 14:12:53 UTC
Size:
2.50 KB
patch
obsolete
>From 049bbc33c4e1de9aac5355dbd8cd1e21166fa622 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Mon, 20 Jan 2025 13:34:22 +0000 >Subject: [PATCH] Bug 38928: Handle rft_id or id > >If a semicolon exists, the key should be what's before the semicolon, and its value, whats the after. >Otherwise, default to 'doi' as it was before. > >To test: >1) Enable ILLModule. >2) Visit the following URLs >http://localhost:8080/cgi-bin/koha/opac-illrequests.pl?op=create&backend=Standard&openurl=1&genre=article&id=10.1016/j.cognition.2024.105913 >http://localhost:8080/cgi-bin/koha/opac-illrequests.pl?op=create&backend=Standard&openurl=1&genre=article&id=doi:10.1016/j.cognition.2024.105913 >3) Notice that in both cases, only the doi value '10.1016/j.cognition.2024.105913' should be present in the input. > >Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> >--- > Koha/ILL/Backend/Standard.pm | 17 +++++++++++++---- > 1 file changed, 13 insertions(+), 4 deletions(-) > >diff --git a/Koha/ILL/Backend/Standard.pm b/Koha/ILL/Backend/Standard.pm >index 4f8f3a5ade..bb4d5d413d 100644 >--- a/Koha/ILL/Backend/Standard.pm >+++ b/Koha/ILL/Backend/Standard.pm >@@ -1041,8 +1041,6 @@ sub _openurl_to_ill { > volume => 'volume', > isbn => 'isbn', > issn => 'issn', >- rft_id => 'doi', >- id => 'doi', > doi => 'doi', > year => 'year', > title => 'title', >@@ -1080,8 +1078,19 @@ sub _openurl_to_ill { > # Otherwise, pass it through untransformed and maybe move it > # to our custom parameters array > if ( !exists $ignore->{$meta_key} ) { >- push @{$custom_key}, $meta_key; >- push @{$custom_value}, $params->{other}->{$meta_key}; >+ if ($meta_key eq 'id' || $meta_key eq 'rft_id') { >+ if ( $params->{other}->{$meta_key} =~ /:/ ) { >+ my ( $k, $v ) = split /:/, $params->{other}->{$meta_key}, 2; >+ if ( defined $k && defined $v ) { >+ $return->{ lc $k } = $v; >+ } >+ } else { >+ $return->{doi} = $params->{other}->{$meta_key}; >+ } >+ }else{ >+ push @{$custom_key}, $meta_key; >+ push @{$custom_value}, $params->{other}->{$meta_key}; >+ } > } else { > $return->{$meta_key} = $params->{other}->{$meta_key}; > } >-- >2.43.0
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 38928
:
176807
| 180050