[Koha-bugs] [Bug 4437] acq.js uses XMLHttpRequest() directly; should use jQuery

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Jun 29 12:27:55 CEST 2023


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=4437

Paul Derscheid <paul.derscheid at lmscloud.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #63756|0                           |1
        is obsolete|                            |

--- Comment #16 from Paul Derscheid <paul.derscheid at lmscloud.de> ---
Created attachment 152859
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152859&action=edit
Bug 4437: acq.js uses XMLHttpRequest() directly; should use jQuery

I was too lazy to resolve the merge conflicts so I just
rewrote the previous patch. The functions should be functionally
equivalent to the ones using XMLHttpRequest, so they should
still work as intended in their consumers.

I deleted the getAuthValueDropbox function as I couldn't find
a single reference in the entire codebase. Correct me if I'm
wrong.

I also ran the configured formatter on the whole file to clean
up the mess. Actual changes in implementation are just in these functions
- totalExceedsBudget
- budgetExceedsParent
- checkBudgetParent

We could pontentially follow this up by making async requests
instead to prevent blocking behaviour. But this would mean that
we need to change the consumers as well.

To test:
Testing budgetExceedsParent (without patch):

1) Go to Home > Administration > Budgets administration
2) Create a Budget 'Testbudget', give it a value of 100, make it active
3) Add a fund 'Testfund 1', give it a value of 90, save
4) Add a fund 'Testfund 2', give it a value of 20 (exceeds budget), save

Result OK: Message box
-------------------------------------------------------
Form not submitted because of the following problem(s)
-------------------------------------------------------
- Fund amount exceeds period allocation
-------------------------------------------------------

Testing budgetExceedsParent (with patch):

a) Clear browser cache, restart memcached, plack
b) Make sure page is reloaded, repeat step 4) above

Result: Not OK, no message box, form saves, period allocated is 100, total
available is 110 (should not)

5) Test the other consumers in a similar manor.
6) Sign off.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.
You are watching all bug changes.


More information about the Koha-bugs mailing list