Sfoglia il codice sorgente

修复前端验证数组是否相当方法不能判断null值bug;
修复Form:\Field:tags required验证无效bug

jqh 5 anni fa
parent
commit
ae8923fecd

+ 4 - 0
resources/assets/dcat-admin/main.js

@@ -602,6 +602,10 @@ window.require = window.define = window.exports = window.module = undefined;
                 for (i in array) {
                     if (!LA.isset(array2, i)) return false;
 
+                    if (array[i] === null && array2[i] === null) {
+                        return true;
+                    }
+
                     if (typeof array[i] == 'object' && typeof array2[i] == 'object') {
                         if (!this.equal(array[i], array2[i]))
                             return false;

File diff suppressed because it is too large
+ 0 - 0
resources/assets/dcat-admin/main.min.js


+ 21 - 0
src/Form/Field/Tags.php

@@ -65,6 +65,27 @@ class Tags extends Field
         return $this;
     }
 
+    /**
+     * Sanitize input data.
+     *
+     * @param array  $input
+     * @param string $column
+     *
+     * @return array
+     */
+    protected function sanitizeInput($input, $column)
+    {
+        $input = parent::sanitizeInput($input, $column);
+
+        $value = array_filter((array) Arr::get($input, $this->column), function ($value) {
+            return $value !== null;
+        });
+
+        Arr::set($input, $this->column, $value);
+
+        return $input;
+    }
+
     /**
      * Set the field options.
      *

Some files were not shown because too many files changed in this diff