Bugzilla – Attachment 162121 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: Default to using av.value is av.description is falsy
Bug-34920-Default-to-using-avvalue-is-avdescriptio.patch (text/plain), 1.91 KB, created by
Martin Renvoize (ashimema)
on 2024-02-13 16:41:19 UTC
(
hide
)
Description:
Bug 34920: Default to using av.value is av.description is falsy
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-02-13 16:41:19 UTC
Size:
1.91 KB
patch
obsolete
>From bdb754314bdf7f534a352c65771d33c6dd974c9a Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Mon, 12 Feb 2024 13:45:34 -0100 >Subject: [PATCH] Bug 34920: Default to using av.value is av.description is > falsy > >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 > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > .../prog/js/vue/fetch/authorised-values-api-client.js | 9 +++++++++ > 1 file changed, 9 insertions(+) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/fetch/authorised-values-api-client.js b/koha-tmpl/intranet-tmpl/prog/js/vue/fetch/authorised-values-api-client.js >index 1498cd7c98e..fc553b46c77 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/fetch/authorised-values-api-client.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/fetch/authorised-values-api-client.js >@@ -22,6 +22,15 @@ export class AVAPIClient extends HttpClient { > headers: { > "x-koha-embed": "authorised_values", > }, >+ }).then(av_categories => { >+ av_categories.forEach(av_category => { >+ av_category.authorised_values = >+ av_category.authorised_values.map(av => ({ >+ ...av, >+ description: av.description || av.value, >+ })); >+ }); >+ return av_categories; > }), > }; > } >-- >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 34920
:
162036
|
162037
|
162120
|
162121
|
162600
|
162601
|
162604
|
162605
|
162608
|
162609
|
163628
|
163629
|
163630
|
163631
|
168257
|
168258
|
168259
|
168260