fixes: #5264
The issue was all the string concatenation...
But I decided to try loading the select via ajax. Seems ok. We could just use something like select2. Opinions? Use this approach or load at page load.
I was able to reduce the loading of the 4000 select items from 1.6s to 0.6s on my laptop by optimizing the sql.
I added 4000 devices to my database to check this :)
* Removed duplicate include
* Move set_debug into functions.php, and restore the (re)loading of includes/defaults
* Move debug call until after function has been included