Bugzilla – Attachment 194403 Details for
Bug 41976
[Vue] LinkWrapper.vue isn't scoped properly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41976: LinkWrapper no longer mangles links
Bug-41976-LinkWrapper-no-longer-mangles-links.patch (text/plain), 2.86 KB, created by
David Nind
on 2026-03-03 18:55:24 UTC
(
hide
)
Description:
Bug 41976: LinkWrapper no longer mangles links
Filename:
MIME Type:
Creator:
David Nind
Created:
2026-03-03 18:55:24 UTC
Size:
2.86 KB
patch
obsolete
>From 1294d559aedb3acfa266ab6203a0046f0caab479 Mon Sep 17 00:00:00 2001 >From: Jake Deery <jake.deery@openfifth.co.uk> >Date: Tue, 3 Mar 2026 13:31:07 +0000 >Subject: [PATCH] Bug 41976: LinkWrapper no longer mangles links > >This patch fixes a bug where, context-dependent, LinkWrapper can keep >referencing back to links that should be out of scope. > >This was causing odd behaviour whilst writing Bug 14962 - namely, links >returning as the same value in a table of multiple rows due to >LinkWrapper treating linkData.href as one and the same for each row. > >TO TEST: >== APPLY PATCH == >a) enable ERMModule syspref, go to /cgi-bin/koha/erm/erm.pl >b) notice all links and buttons still work as expected >c) go to /cgi-bin/koha/sip2/sip2.pl >d) notice all links and buttons still work as expected >e) go to /cgi-bin/koha/acquisition/vendors >f) notice all links and buttons still work as expected >g) enable PreservationModule syspref, go to >/cgi-bin/koha/preservation/home.pl >h) notice all links and buttons still work as expected >== SIGN OFF == > >Signed-off-by: David Nind <david@davidnind.com> >--- > .../prog/js/vue/components/LinkWrapper.vue | 12 +++++++----- > 1 file changed, 7 insertions(+), 5 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/LinkWrapper.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/LinkWrapper.vue >index 30e0adeb52..df207c4140 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/LinkWrapper.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/LinkWrapper.vue >@@ -10,7 +10,7 @@ > </router-link> > <a > v-else-if="linkData && linkData.href" >- :href="linkData.href" >+ :href="formattedHref" > :class="{ disabled: linkData.disabled }" > > > <slot /> >@@ -26,6 +26,7 @@ export default { > resource: Object, > }, > setup(props) { >+ const formattedHref = ref(props.linkData?.href); > const formattedParams = ref({}); > > if (props.linkData && props.linkData.params) { >@@ -36,16 +37,17 @@ export default { > } > > if (props.linkData?.href && props.linkData.params) { >- props.linkData.href += "?"; >+ formattedHref.value += "?"; > Object.keys(props.linkData.params).forEach(key => { >- props.linkData.href += `${key}=${formattedParams.value[key]}&`; >+ formattedHref.value += `${key}=${formattedParams.value[key]}&`; > }); >- props.linkData.href = props.linkData.href.slice(0, -1); >+ formattedHref.value = formattedHref.value.slice(0, -1); > } > if (props.linkData?.href && props.linkData.slug) { >- props.linkData.href += `/${props.resource[props.linkData.slug]}`; >+ formattedHref.value += `/${props.resource[props.linkData.slug]}`; > } > return { >+ formattedHref, > formattedParams, > }; > }, >-- >2.39.5
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 41976
:
194382
| 194403