mirror of
https://github.com/unraid/webgui.git
synced 2026-01-14 05:30:07 -06:00
In include/DefaultPageLayout.php there is an on-load function which disables all the buttons named "Apply", and generates on-change functions for all form input fields which un-disables the form "Apply" buttons. Meanwhile, when Main page loads, it generates POST requests to include/DeviceList.php to fill in the array, cache, parity status sections. With array stopped, DeviceList.php generates forms that are used to faciliate devivce assignment to array and cache slots, and these forms have a hidden input that defines the emhttp api call to make (changeDevice=Apply). Well sometimes this form element is 'disabled', which causes everything to function correctly from user perspective but since changeDevice=Apply is not sent, emhttp never actually makes the assignment permanent. This issue is the result of some kind of race condition we are triggering in the browser - I think because there are multiple on-change event functions being assigned dynamically. The fix here is to change string "changeDevice=Apply" to "changeDevice=apply" in order to defeat the script; the emhttp api will accept either "Apply" or "apply".