]> git.koha-community.org Git - koha.git/commit
Bug 13817 - Edit links on course items may point to the wrong course!
authorKyle M Hall <kyle@bywatersolutions.com>
Tue, 10 Mar 2015 17:38:50 +0000 (10:38 -0700)
committerChris Cormack <chrisc@catalyst.net.nz>
Mon, 11 May 2015 21:38:43 +0000 (09:38 +1200)
commitf6373d81726eeb570985c9d9d5159993cb7feb30
treed83be3cf025a523acb1c32fa3d3b7c4ac0346395
parent49b5934235b03f44be2240d9c72be59b2e8efe95
Bug 13817 - Edit links on course items may point to the wrong course!

If items are assigned to multiple courses, the "edit" links for a course
item may pass the wrong course id. This is really a cosmetic issue.

It appears that in Template Toolkit, if you reuse an existing variable
name in a foreach loop, it will not create a new temporary variable but
will instead re-use the existing variable leaving assigned at the end to
the last assignment, just as it would in Perl code.

This is not a problem when all items are assigned to one and only one
course, but can cause issues when we loop through the other courses an
item may be on.

This is solved easily by renaming the variable used in the foreach loop
to another unused name.

Test Plan:
1) Apply this patch
2) Try the edit and delete links for an item on reserve for a course
3) No changes in behavior should be noted

Signed-off-by: Tom Misilo <misilot@fit.edu>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit b8da5462b0f72f8035589317f51800394ba700ae)
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt