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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Hammat Wele 2024-08-12 21:40:43 +00:00 committed by Lucas Gass
parent 9da5f23f96
commit ddbd11cbad
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
4 changed files with 0 additions and 4 deletions

View File

@ -185,7 +185,6 @@ sub update {
map { { 'id' => $_->{field_id}, 'value' => $_->{value} } } @{$extended_attributes};
$agreement->extended_attributes( \@extended_attributes );
$c->res->headers->location( $c->req->url->to_string . '/' . $agreement->agreement_id );
return $c->render(
status => 200,
openapi => $c->objects->to_api($agreement),

View File

@ -164,7 +164,6 @@ sub update {
map { { 'id' => $_->{field_id}, 'value' => $_->{value} } } @{$extended_attributes};
$package->extended_attributes( \@extended_attributes );
$c->res->headers->location( $c->req->url->to_string . '/' . $package->package_id );
return $c->render(
status => 200,
openapi => $c->objects->to_api($package),

View File

@ -157,7 +157,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),

View File

@ -166,7 +166,6 @@ sub update {
map { { 'id' => $_->{field_id}, 'value' => $_->{value} } } @{$extended_attributes};
$license->extended_attributes( \@extended_attributes );
$c->res->headers->location( $c->req->url->to_string . '/' . $license->license_id );
return $c->render(
status => 200,
openapi => $c->objects->to_api($license),