Merge branch '5.3'
authorMatthias Schmidt <gravatronics@live.com>
Wed, 28 Oct 2020 16:22:41 +0000 (17:22 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Wed, 28 Oct 2020 16:22:41 +0000 (17:22 +0100)
1  2 
wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/ItemList.js

index 449a1fe7959089f2bc48c8c2498e2940e25c0f74,3e16e6a3dfe74abfef8f0083b51fa92d6bb7cf08..0ba161c10c5c554d17f35168fc760ec7e1ff2023
@@@ -7,34 -7,36 +7,33 @@@
   * @module    WoltLabSuite/Core/Form/Builder/Field/ItemList
   * @since     5.2
   */
 -define(['Core', './Field', 'WoltLabSuite/Core/Ui/ItemList/Static'], function(Core, FormBuilderField, UiItemListStatic) {
 -      "use strict";
 -      
 -      /**
 -       * @constructor
 -       */
 -      function FormBuilderFieldItemList(fieldId) {
 -              this.init(fieldId);
 -      };
 -      Core.inherit(FormBuilderFieldItemList, FormBuilderField, {
 -              /**
 -               * @see WoltLabSuite/Core/Form/Builder/Field/Field#_getData
 -               */
 -              _getData: function() {
 -                      var data = {};
 -                      data[this._fieldId] = [];
 -                      
 -                      var values = UiItemListStatic.getValues(this._fieldId);
 -                      for (var i = 0, length = values.length; i < length; i++) {
 -                              if (values[i].objectId) {
 -                                      data[this._fieldId][values[i].objectId] = values[i].value;
 -                              }
 -                              else {
 -                                      data[this._fieldId].push(values[i].value);
 -                              }
 -                      }
 -                      
 -                      return data;
 -              }
 -      });
 -      
 -      return FormBuilderFieldItemList;
 +define(['Core', './Field', 'WoltLabSuite/Core/Ui/ItemList/Static'], function (Core, FormBuilderField, UiItemListStatic) {
 +    "use strict";
 +    /**
 +     * @constructor
 +     */
 +    function FormBuilderFieldItemList(fieldId) {
 +        this.init(fieldId);
 +    }
 +    ;
 +    Core.inherit(FormBuilderFieldItemList, FormBuilderField, {
 +        /**
 +         * @see       WoltLabSuite/Core/Form/Builder/Field/Field#_getData
 +         */
 +        _getData: function () {
 +            var data = {};
 +            data[this._fieldId] = [];
 +            var values = UiItemListStatic.getValues(this._fieldId);
 +            for (var i = 0, length = values.length; i < length; i++) {
-                 // TODO: data[this._fieldId] is an array but if code assumes object
 +                if (values[i].objectId) {
 +                    data[this._fieldId][values[i].objectId] = values[i].value;
 +                }
 +                else {
 +                    data[this._fieldId].push(values[i].value);
 +                }
 +            }
 +            return data;
 +        }
 +    });
 +    return FormBuilderFieldItemList;
  });