ILIAS icon indicating copy to clipboard operation
ILIAS copied to clipboard

User: ilUserAutoComplete::getList ensure items are encoded as JS arrays

Open lscharmer opened this issue 1 month ago • 0 comments

This PR fixes that ilUserAutoComplete::getList(...) returns the json_encoded items as a proper array ([a, b, c]) instead of an object ({3: a, 4: b, 5: c}). As it is no proper JS array anymore it causes a JS error in the Chatroom.

This bug was introduced in commit: https://github.com/ILIAS-eLearning/ILIAS/commit/4ee51763a8c82c51a928f2cf31d94ee904fdd33c

The variable $cnt is used twice as a counter but the second time it is not reset to 0. To decouple the two loops from each other I moved $cnt to the first loop and replaced $cnt in the second loop with $array[] = ....

lscharmer avatar Dec 11 '25 15:12 lscharmer