Bug 11779 - Unexpected change in logged in branch when changing overdue notice triggers
Summary: Unexpected change in logged in branch when changing overdue notice triggers
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low major (vote)
Assignee: Kyle M Hall
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-18 12:43 UTC by Kyle M Hall
Modified: 2016-05-03 10:53 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 11779 - Unexpected change in logged in branch when changing overdue notice triggers (3.24 KB, patch)
2014-02-18 12:44 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 11779 - Unexpected change in logged in branch when changing overdue notice triggers (3.25 KB, patch)
2014-02-18 12:46 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 11779 - Unexpected change in logged in branch when changing overdue notice triggers (3.32 KB, patch)
2014-02-18 21:29 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 11779 - Unexpected change in logged in branch when changing overdue notice triggers (3.48 KB, patch)
2014-02-19 10:59 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle M Hall 2014-02-18 12:43:17 UTC
Steps to reproduce:
1) Log into staff intranet
2) Set logged in branch
3) Browse to tools/overdue notice triggers
4) Select a branch from the pulldown that is not your logged in branch
5) use the "Check out" bar at the top of the page to search for a patron to check out to
6) Once you have landed here, click the "check out" tab link again, or the Edit button ( any action really )
7) Note your logged in branch has now changed to the once selected when editing the notice/status triggers

This is due to the way the patron search passes the branchcode to be used via the form. This form assumes the branchcode variable is always the currently logged in branch, which may not and is not always the case.
Comment 1 Kyle M Hall 2014-02-18 12:44:50 UTC Comment hidden (obsolete)
Comment 2 Kyle M Hall 2014-02-18 12:46:38 UTC Comment hidden (obsolete)
Comment 3 Chris Cormack 2014-02-18 21:29:08 UTC Comment hidden (obsolete)
Comment 4 Jonathan Druart 2014-02-19 10:59:59 UTC
Created attachment 25437 [details] [review]
Bug 11779 - Unexpected change in logged in branch when changing overdue notice triggers

Steps to reproduce:
1) Log into staff intranet
2) Set logged in branch
3) Browse to tools/overdue notice triggers
4) Select a branch from the pulldown that is not your logged in branch
5) use the "Check out" bar at the top of the page to search for a patron
to check out to
6) Once you have landed here, click the "check out" tab link again, or
   the Edit button ( any action really )
7) Note your logged in branch has now changed to the once selected
   when editing the notice/status triggers

This is due to the way the patron search passes the branchcode to be
used via the form. This form assumes the branchcode variable is
always the currently logged in branch, which may not and is not
always the case.

Test Plan:
1) Apply this patch
2) Repeat the steps to reproduce above
3) Note your logged in branch does not change

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Funny bug :) This patch fixes the described issue and should not
introduce regression.
Comment 5 Galen Charlton 2014-02-19 17:17:34 UTC
Pushed to master, along with a follow-up that

- Ensures that the plugin returns the empty string, not undef, if no user environment is set.  This avoids spurious warnings should the new template plugin function be used in the OPAC.
- Adds unit tests for the new plugin function.

Thanks, Kyle!
Comment 6 Fridolin Somers 2014-05-19 15:07:21 UTC
Pushed to 3.14.x, will be in 3.14.07
Comment 7 Kyle M Hall 2014-06-06 13:52:31 UTC
Pushed to 3.12.x will be in 3.12.13