Bug 41976

Summary: [Vue] LinkWrapper.vue isn't scoped properly
Product: Koha Reporter: Jake Deery <jake.deery>
Component: Staff interfaceAssignee: Jake Deery <jake.deery>
Status: Signed Off --- QA Contact: Testopia <testopia>
Severity: trivial    
Priority: P5 - low CC: david, gmcharlt
Version: unspecified   
Hardware: All   
OS: All   
GIT URL: Initiative type: ---
Sponsorship status: --- Comma delimited list of Sponsors:
Crowdfunding goal: 0 Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on:    
Bug Blocks: 14962    
Attachments: Bug 41976: LinkWrapper no longer mangles links
Bug 41976: LinkWrapper no longer mangles links

Description Jake Deery 2026-03-03 13:17:37 UTC
When using LinkWrapper in a context that is prone towards reuse, you can end up with one link modifying another. For example, when used in a relationshipWidget, you can end up with search parameters being appended to search parameters being appended to search parameters, etc.

We think the solution to copy the props to a reference, and make any alterations to said reference. If this works, we will post a patch shortly.

Ta,
Jake
Comment 1 Jake Deery 2026-03-03 13:31:45 UTC
Created attachment 194382 [details] [review]
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 ==
Comment 2 Jake Deery 2026-03-03 13:32:51 UTC
Short bug, and quick SO/QA would be appreciated. Feel free to MM me a quid-pro-quo :-)

Ta,
Jake
Comment 3 David Nind 2026-03-03 18:55:24 UTC
Created attachment 194403 [details] [review]
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>
Comment 4 David Nind 2026-03-03 18:57:03 UTC
Testing notes (using KTD):

1. I've only done basic testing: making sure I can add, edit and delete things.

2. So may require more thorough testing by someone who knows what is actually being fixed here (sounds like it can be hard to reproduce).

3. After applying the patch: yarn build and restart_all