From 0f8b57cfff192646f1710972f18440fbf9b0f320 Mon Sep 17 00:00:00 2001 From: Hammat Wele Date: Mon, 12 Aug 2024 21:40:43 +0000 Subject: [PATCH] Bug 37622: Error in erm module when editing an agreement, a license, a package or a titles To reproduce 1- Enable the ERMModule system preference 1- Go to Administration > System Preferences 2- Search for ERMModule 3- Change the value to "Enable" 4- Click on "Save all e-resource management preferences" 5- Return to the main screen 1- Create an agreement 1- Go to e-resource management 2- Click on "Agreements" 3- Click on "New agreement" 4- Fill out the form (mandatory fields) - Agreement name: Natural Medicines - Status: Active 5- Click on "Submit" 2- Edit the agreement 1- Click on "Agreements" 2- Click on "Edit" to the right of the Natural Medicines agreement 3- Click on "Submit" --> Something went wrong: SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data We got the same error when editing a license, a package or a title --- Koha/REST/V1/ERM/Agreements.pm | 1 - Koha/REST/V1/ERM/EHoldings/Packages/Local.pm | 1 - Koha/REST/V1/ERM/EHoldings/Titles/Local.pm | 1 - Koha/REST/V1/ERM/Licenses.pm | 1 - 4 files changed, 4 deletions(-) diff --git a/Koha/REST/V1/ERM/Agreements.pm b/Koha/REST/V1/ERM/Agreements.pm index dd67576d05..cf1c79961c 100644 --- a/Koha/REST/V1/ERM/Agreements.pm +++ b/Koha/REST/V1/ERM/Agreements.pm @@ -189,7 +189,6 @@ sub update { $agreement->agreement_relationships($agreement_relationships); $agreement->documents($documents); - $c->res->headers->location($c->req->url->to_string . '/' . $agreement->agreement_id); return $c->render( status => 200, openapi => $c->objects->to_api($agreement), diff --git a/Koha/REST/V1/ERM/EHoldings/Packages/Local.pm b/Koha/REST/V1/ERM/EHoldings/Packages/Local.pm index 63ca976540..2a461554e5 100644 --- a/Koha/REST/V1/ERM/EHoldings/Packages/Local.pm +++ b/Koha/REST/V1/ERM/EHoldings/Packages/Local.pm @@ -168,7 +168,6 @@ sub update { # ie. It's coming from EBSCO and we don't have local data linked to it $package->package_agreements($package_agreements); - $c->res->headers->location($c->req->url->to_string . '/' . $package->package_id); return $c->render( status => 200, openapi => $c->objects->to_api($package), diff --git a/Koha/REST/V1/ERM/EHoldings/Titles/Local.pm b/Koha/REST/V1/ERM/EHoldings/Titles/Local.pm index f2cf4c3370..9e19804bfe 100644 --- a/Koha/REST/V1/ERM/EHoldings/Titles/Local.pm +++ b/Koha/REST/V1/ERM/EHoldings/Titles/Local.pm @@ -171,7 +171,6 @@ sub update { $title->resources($resources); - $c->res->headers->location($c->req->url->to_string . '/' . $title->title_id); return $c->render( status => 200, openapi => $c->objects->to_api($title), diff --git a/Koha/REST/V1/ERM/Licenses.pm b/Koha/REST/V1/ERM/Licenses.pm index 856386e0c1..bd1de95694 100644 --- a/Koha/REST/V1/ERM/Licenses.pm +++ b/Koha/REST/V1/ERM/Licenses.pm @@ -170,7 +170,6 @@ sub update { $license->user_roles($user_roles); $license->documents($documents); - $c->res->headers->location($c->req->url->to_string . '/' . $license->license_id); return $c->render( status => 200, openapi => $c->objects->to_api($license), -- 2.34.1