From 7ee49704d98a4af3f0fbb6423f0705fdd355fa92 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Fri, 19 Jan 2024 14:30:55 +0800 Subject: [PATCH] * Fix the bug of upload file. --- lib/zin/wg/upload/v1.php | 3 +++ module/testcase/ui/create.field.php | 1 + 2 files changed, 4 insertions(+) diff --git a/lib/zin/wg/upload/v1.php b/lib/zin/wg/upload/v1.php index 2e3df524ac..c542eebab8 100644 --- a/lib/zin/wg/upload/v1.php +++ b/lib/zin/wg/upload/v1.php @@ -53,6 +53,9 @@ class upload extends wg $this->setProp('exceededCountHint', sprintf($lang->file->errorFileCount, $this->prop('limitCount'))); } + $name = $this->prop('name'); + if($this->prop('multiple') && strpos($name, '[]') === false) $this->setProp('name', $name . '[]'); + $otherProps = $this->getRestProps(); return zui::upload(inherit($this), set('_props', $otherProps)); } diff --git a/module/testcase/ui/create.field.php b/module/testcase/ui/create.field.php index a7f0bda52f..f4a8a03b8f 100644 --- a/module/testcase/ui/create.field.php +++ b/module/testcase/ui/create.field.php @@ -44,6 +44,7 @@ $fields->field('stage') ->multiple(); $fields->field('scriptFile') + ->multiple(false) ->width('full') ->label($lang->testcase->autoScript) ->className('autoScript')