Bug 24242 - Funds with no library assigned do not appear on edit suggestions page
Summary: Funds with no library assigned do not appear on edit suggestions page
Status: Pushed to oldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: master
Hardware: All All
: P5 - low major (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on: 18743
Blocks:
  Show dependency treegraph
 
Reported: 2019-12-13 18:12 UTC by Nick Clemens
Modified: 2020-01-13 22:18 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:
20.05.00, 19.11.02


Attachments
Bug 24242: Display funds that the logged in user can access - suggestions (3.01 KB, patch)
2019-12-15 11:36 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24242: Display funds that the logged in user can access - suggestions (3.05 KB, patch)
2019-12-19 16:07 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 24242: Display funds that the logged in user can access - suggestions (3.11 KB, patch)
2019-12-22 17:16 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens 2019-12-13 18:12:59 UTC
bug 18743 made $branchfilter use the logged in user branch by default, however, branchfilter is also used in the call to GetBudgets, now funds with no library associated do not appear in the dropdown when editing suggestions or in the 'Acquisition information' filters

To recreate:
1 - Create a new fund with no library in an active budget
2 - Browse to Acquisitions->Suggestions
3 - Click 'Acquisition information' to expand the filters
4 - The fund does not appear
5 - Edit a suggestion
6 - Cannot set fund to your new fund, it does not appear
7 - Set the fund to your library
8 - Now it appears in suggestions management
Comment 1 Jonathan Druart 2019-12-15 11:36:02 UTC
Created attachment 96292 [details] [review]
Bug 24242: Display funds that the logged in user can access - suggestions

The design of this script is pretty bad and any modifications is a
challenge.
Here we are trying to display to display the funds available for the
logged in user. I did not understand previous code, as we are doing a
limit using CanUserUseBudget, I do not think it makes sense to retrieve
funds for a given library.
Also, I am wondering if the dropdown list in the filters has ever been
populated: budgetid_loop in the template *never* appeared in the history
of suggestion.pl (??)

Test plan:
Search for suggestions
Add/edit suggestions
=> The funds in the dropdown list should be the ones the logged in user
can use.
Comment 2 ByWater Sandboxes 2019-12-19 16:07:39 UTC
Created attachment 96490 [details] [review]
Bug 24242: Display funds that the logged in user can access - suggestions

The design of this script is pretty bad and any modifications is a
challenge.
Here we are trying to display to display the funds available for the
logged in user. I did not understand previous code, as we are doing a
limit using CanUserUseBudget, I do not think it makes sense to retrieve
funds for a given library.
Also, I am wondering if the dropdown list in the filters has ever been
populated: budgetid_loop in the template *never* appeared in the history
of suggestion.pl (??)

Test plan:
Search for suggestions
Add/edit suggestions
=> The funds in the dropdown list should be the ones the logged in user
can use.

Signed-off-by: hc <hc@interleaf.ie>
Comment 3 Katrin Fischer 2019-12-22 17:16:50 UTC
Created attachment 96577 [details] [review]
Bug 24242: Display funds that the logged in user can access - suggestions

The design of this script is pretty bad and any modifications is a
challenge.
Here we are trying to display to display the funds available for the
logged in user. I did not understand previous code, as we are doing a
limit using CanUserUseBudget, I do not think it makes sense to retrieve
funds for a given library.
Also, I am wondering if the dropdown list in the filters has ever been
populated: budgetid_loop in the template *never* appeared in the history
of suggestion.pl (??)

Test plan:
Search for suggestions
Add/edit suggestions
=> The funds in the dropdown list should be the ones the logged in user
can use.

Signed-off-by: hc <hc@interleaf.ie>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 4 Katrin Fischer 2019-12-22 17:18:23 UTC
I wonder a bit about the use case here: I could imagine someone checking the suggestions and picking the funds and someone else ordering it later. But this clearly fixes a regression, philosophical discussions can happen later :)
Comment 5 Martin Renvoize 2019-12-23 11:09:01 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 6 Joy Nelson 2020-01-12 18:46:48 UTC
Pushed to 19.11.x branch for 19.11.02
Comment 7 Lucas Gass 2020-01-13 22:18:24 UTC
backported to 19.05.x for 19.05.07