Fix Ajax user form fields with pre-set values
authorMatthias Schmidt <gravatronics@live.com>
Tue, 9 Mar 2021 15:15:45 +0000 (16:15 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Tue, 9 Mar 2021 15:15:45 +0000 (16:15 +0100)
`values[i].objectId` is only set for users added manually via the UI. For pre-existing usernames, only `values[i].value` exists.

wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/User.js

index 2cb81e1b8de673ba21cf6f4b97356abafbf13de8..9d50af5801f1991961f7ae3e168122626317d989 100644 (file)
@@ -24,9 +24,7 @@ define(['Core', './Field', 'WoltLabSuite/Core/Ui/ItemList'], function(Core, Form
                        var values = UiItemList.getValues(this._fieldId);
                        var usernames = [];
                        for (var i = 0, length = values.length; i < length; i++) {
-                               if (values[i].objectId) {
-                                       usernames.push(values[i].value);
-                               }
+                               usernames.push(values[i].value);
                        }
                        
                        var data = {};