From 028e247df83690cf8e226d28fca83c09123b6dc0 Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Fri, 24 Sep 2021 15:09:27 +0300 Subject: [PATCH] Fixed form reset causing image uploads to fail when using Flex --- CHANGELOG.md | 1 + system/src/Grav/Framework/Flex/FlexDirectoryForm.php | 11 +++++++++++ system/src/Grav/Framework/Flex/FlexForm.php | 11 +++++++++++ 3 files changed, 23 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c6afee1bc..b4c1adfa3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ 3. [](#bugfix) * Fixed `Folder::move()` throwing an error when target folder is changed by only appending characters to the end [#3445](https://github.com/getgrav/grav/issues/3445) * Fixed some phpstan issues (all code level 1, Framework level 3) + * Fixed form reset causing image uploads to fail when using Flex # v1.7.22 ## 09/16/2021 diff --git a/system/src/Grav/Framework/Flex/FlexDirectoryForm.php b/system/src/Grav/Framework/Flex/FlexDirectoryForm.php index dff0836ba..a2259678b 100644 --- a/system/src/Grav/Framework/Flex/FlexDirectoryForm.php +++ b/system/src/Grav/Framework/Flex/FlexDirectoryForm.php @@ -129,6 +129,17 @@ class FlexDirectoryForm implements FlexDirectoryFormInterface, JsonSerializable return $this; } + /** + * @param string $uniqueId + * @return void + */ + public function setUniqueId(string $uniqueId): void + { + if ($uniqueId !== '') { + $this->uniqueid = $uniqueId; + } + } + /** * @param string $name * @param mixed $default diff --git a/system/src/Grav/Framework/Flex/FlexForm.php b/system/src/Grav/Framework/Flex/FlexForm.php index aba0044f7..4fb8daf27 100644 --- a/system/src/Grav/Framework/Flex/FlexForm.php +++ b/system/src/Grav/Framework/Flex/FlexForm.php @@ -172,6 +172,17 @@ class FlexForm implements FlexObjectFormInterface, JsonSerializable return $this; } + /** + * @param string $uniqueId + * @return void + */ + public function setUniqueId(string $uniqueId): void + { + if ($uniqueId !== '') { + $this->uniqueid = $uniqueId; + } + } + /** * @param string $name * @param mixed $default