Bug 24242

Summary: Funds with no library assigned do not appear on edit suggestions page
Product: Koha Reporter: Nick Clemens (kidclamp) <nick>
Component: AcquisitionsAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: major    
Priority: P5 - low CC: 1joynelson, hc, jonathan.druart, lucas
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.05.00, 19.11.02
Circulation function:
Bug Depends on: 18743    
Bug Blocks:    
Attachments: Bug 24242: Display funds that the logged in user can access - suggestions
Bug 24242: Display funds that the logged in user can access - suggestions
Bug 24242: Display funds that the logged in user can access - suggestions

Description Nick Clemens (kidclamp) 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 (ashimema) 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 (lukeg) 2020-01-13 22:18:24 UTC
backported to 19.05.x for 19.05.07