We see the following error in the browser console when loading acqui-home.pl without any budgets defined: Cannot read properties of undefined (reading 'DataTable') This is due to loading a large chunk of javascript to deal with a table we opt not to load into the DOM at all when budgets are not found. This causes cypress test failures as there appears to be a transaction that removes budgets somewhere in our test suite. Either way, we shouldn't load the JS when there's no DOM to action upon.
Created attachment 182352 [details] [review] Bug 39888: Prevent load of superflous JS when table is not present We shouldn't attempt to load the JS block for dealing with the budgets table if there is no budgets defined and thus no budgets table. Test plan 1) Remove all budgets 2) Load acqui-home.pl and note an error in the browser console 3) Apply the patch 4) Reload acqui-home.pl and note the errors have gone Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Self QA to get Jenkins green again... Matt is trying to track down where in the test suite we're not rolling back a transaction that removes all budgets.
Created attachment 182353 [details] [review] Bug 39888: Prevent load of superflous JS when table is not present We shouldn't attempt to load the JS block for dealing with the budgets table if there is no budgets defined and thus no budgets table. Test plan 1) Remove all budgets 2) Load acqui-home.pl and note an error in the browser console 3) Apply the patch 4) Reload acqui-home.pl and note the errors have gone Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> Amended-by: Jonathan Druart Tidy Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Pushed to main for 25.05