Skip to content

Instantly share code, notes, and snippets.

@boutros
Created June 12, 2020 09:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save boutros/0641574a59c127363cf919225459f4b0 to your computer and use it in GitHub Desktop.
Save boutros/0641574a59c127363cf919225459f4b0 to your computer and use it in GitHub Desktop.
perl utf8 føkk
diff --git a/koha/api/RESTAPI/Spore/Api.pm b/koha/api/RESTAPI/Spore/Api.pm
index 267d668f1..df208d5c5 100644
--- a/koha/api/RESTAPI/Spore/Api.pm
+++ b/koha/api/RESTAPI/Spore/Api.pm
@@ -9,6 +9,7 @@ use Types::Standard qw(HashRef Any Int Str);
use Deichman::Spore::Exception;
use Deichman::Spore::DB;
use Deichman::Spore::Scanner::Response;
+use utf8;
use Try::Tiny;
@@ -140,8 +141,12 @@ resource spore => sub {
summary "Get all items on given temporary (CO) location";
get sub {
my $params = shift;
+ warn "co rest endpoint:";
+ warn $params->{loc};
try {
- my $l = Deichman::Spore::DB->new()->GetCoLocations($params->{loc});
+ my $loc = $params->{loc};
+ utf8::decode($loc);
+ my $l = Deichman::Spore::DB->new()->GetCoLocations($loc);
{ $l->{locations} }
} catch {
app->logg(error => $_->description);
diff --git a/koha/rotating_collections/edit.pl b/koha/rotating_collections/edit.pl
index 52a21a4ce..0fc245063 100644
--- a/koha/rotating_collections/edit.pl
+++ b/koha/rotating_collections/edit.pl
@@ -9,6 +9,7 @@ use C4::RotatingCollections;
use C4::Items;
use CGI qw ( -utf8 );
+use utf8;
use Deichman::Spore::DB;
my $query = new CGI;
@@ -25,8 +26,9 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
);
# DEICHMAN MOD - DEICH-2801 move functionality to location
-if ($query->param("loc")) {
- $template->param( loc => $query->param("loc") );
+if (my $loc = $query->param("loc")) {
+ utf8::decode($loc);
+ $template->param( loc => $loc );
}
output_html_with_http_headers $query, $cookie, $template->output;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment