From 04b7d7f1ffe464120b26fed5636fae215f4be608 Mon Sep 17 00:00:00 2001 From: Matt Blenkinsop Date: Mon, 29 Jul 2024 08:52:39 +0000 Subject: [PATCH] Bug 37288: Allow manual providers to be edited There is a bug preventing manually created providers from being edited. This patch fixes that issue and allows providers to be edited if they have been created manually Test plan: 1) Create a data provider in the ERM manually using the Create manually option 2) Click to edit that provider 3) The form will not load 4) Apply patch and run yarn build 5) Hard refresh the browser 6) The form should now load correctly Signed-off-by: David Nind Signed-off-by: Martin Renvoize Signed-off-by: Katrin Fischer (cherry picked from commit 8872aa91e35a77951eb60037bc1f709fe093f00a) Signed-off-by: Lucas Gass --- .../components/ERM/UsageStatisticsDataProvidersFormAdd.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersFormAdd.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersFormAdd.vue index 8311922e2b..b205956d2d 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersFormAdd.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersFormAdd.vue @@ -455,7 +455,7 @@ export default { client.counter_registry.getAll({ name: query }).then( registry_data => { this.registry_data = registry_data - if (caller === "edit") { + if (caller === "edit" && registry_data.length > 0) { this.selected_provider = registry_data.find( platform => platform.name === this.usage_data_provider.name @@ -466,6 +466,8 @@ export default { r => r.report_id === report.value ) ) + } else { + this.manual_form = true } this.searching = false this.initialized = true -- 2.39.5