Bug 41976 - [Vue] LinkWrapper.vue isn't scoped properly
Summary: [Vue] LinkWrapper.vue isn't scoped properly
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low trivial
Assignee: Jake Deery
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 14962
  Show dependency treegraph
 
Reported: 2026-03-03 13:17 UTC by Jake Deery
Modified: 2026-03-03 18:57 UTC (History)
2 users (show)

See Also:
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:


Attachments
Bug 41976: LinkWrapper no longer mangles links (2.83 KB, patch)
2026-03-03 13:31 UTC, Jake Deery
Details | Diff | Splinter Review
Bug 41976: LinkWrapper no longer mangles links (2.86 KB, patch)
2026-03-03 18:55 UTC, David Nind
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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