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
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.
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>
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>
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 :)
Nice work everyone! Pushed to master for 20.05
Pushed to 19.11.x branch for 19.11.02
backported to 19.05.x for 19.05.07