Bugzilla – Attachment 162608 Details for
Bug 34920
ERM breaks if an ERM authorized value is missing a description
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34920: Ensure 'description' property is an empty string if 'lib' is null
Bug-34920-Ensure-description-property-is-an-empty-.patch (text/plain), 1.62 KB, created by
Pedro Amorim
on 2024-02-29 15:49:46 UTC
(
hide
)
Description:
Bug 34920: Ensure 'description' property is an empty string if 'lib' is null
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2024-02-29 15:49:46 UTC
Size:
1.62 KB
patch
obsolete
>From f337757d50f35ec654fd17c36458de3a008eacda Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Thu, 29 Feb 2024 15:26:54 +0000 >Subject: [PATCH] Bug 34920: Ensure 'description' property is an empty string > if 'lib' is null > >Test plan: >1. Enable ERM module >2. Confirm that you can open the ERM module in the staff interface. >3. Go to the authorized values, select 'ERM_AGREEMENT_CLOSURE_REASON' and edit the 'Cancelled' authorized value by removing the description. Making this change with any of the ERM authorized values will result in an error. >4. Go back to the ERM module and notice that there is an error. 'Something went wrong: Error: Expected string - got null.' >5. Apply patch. Run yarn js:build. Repeat test plan >6. Create a new agreement. Pick status 'Closed'. >7. Open 'Closure reason'. Confirm there is an entry for 'Expired' and an empty entry below that. >--- > Koha/AuthorisedValue.pm | 20 ++++++++++++++++++++ > 1 file changed, 20 insertions(+) > >diff --git a/Koha/AuthorisedValue.pm b/Koha/AuthorisedValue.pm >index da25d5e0584..09d2a4a149a 100644 >--- a/Koha/AuthorisedValue.pm >+++ b/Koha/AuthorisedValue.pm >@@ -113,6 +113,26 @@ sub to_api_mapping { > }; > } > >+=head3 to_api >+ >+ my $json = $av->to_api; >+ >+Overloaded method that returns a JSON representation of the Koha::AuthorisedValue object, >+suitable for API output. >+ >+=cut >+ >+sub to_api { >+ my ( $self, $params ) = @_; >+ >+ my $response = $self->SUPER::to_api($params); >+ my $overrides = {}; >+ >+ $overrides->{description} = $self->lib // q{}; >+ >+ return { %$response, %$overrides }; >+} >+ > =head2 Internal methods > > =head3 _type >-- >2.30.2
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 34920
:
162036
|
162037
|
162120
|
162121
|
162600
|
162601
|
162604
|
162605
|
162608
|
162609
|
163628
|
163629
|
163630
|
163631
|
168257
|
168258
|
168259
|
168260