From 6d2c8bf79549bfc3ddb53293da1e1b7da945d7dc Mon Sep 17 00:00:00 2001 From: Ryan Cramer Date: Fri, 6 Oct 2023 11:24:14 -0400 Subject: [PATCH] Fix issue processwire/processwire-issues#1819 --- wire/modules/Inputfield/InputfieldFile/InputfieldFile.module | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wire/modules/Inputfield/InputfieldFile/InputfieldFile.module b/wire/modules/Inputfield/InputfieldFile/InputfieldFile.module index a5053a79..080aeb70 100644 --- a/wire/modules/Inputfield/InputfieldFile/InputfieldFile.module +++ b/wire/modules/Inputfield/InputfieldFile/InputfieldFile.module @@ -1224,6 +1224,8 @@ class InputfieldFile extends Inputfield implements InputfieldItemList, Inputfiel $pagefile = $this->processInputAddFile($filename); if($pagefile && isset($originalFilenames[$filename]) && $originalFilenames[$filename] != $filename) { $pagefile->filedata('uploadName', $originalFilenames[$filename]); + } else if($pagefile->filedata('uploadName')) { + $pagefile->filedata('uploadName', ''); // clear out previous } $changed = true; }