mirror of
https://github.com/processwire/processwire.git
synced 2025-08-18 20:41:16 +02:00
Add PR #229 to fix processwire/processwire-issues#1586 sub-issue 1 in InputfieldFile file replacement logic
This commit is contained in:
@@ -993,7 +993,12 @@ class InputfieldFile extends Inputfield implements InputfieldItemList, Inputfiel
|
||||
}
|
||||
$replaceFile = $this->value->getFile($replace);
|
||||
if($replaceFile instanceof Pagefile) {
|
||||
$this->processInputDeleteFile($replaceFile);
|
||||
// $this->processInputDeleteFile($replaceFile);
|
||||
// PR#229 to fix #1586:
|
||||
if($replaceFile->basename !== $pagefile->basename) {
|
||||
$this->processInputDeleteFile($replaceFile);
|
||||
}
|
||||
// ---
|
||||
if(strtolower($pagefile->ext()) == strtolower($replaceFile->ext())) {
|
||||
$this->value->rename($pagefile, $replaceFile->name);
|
||||
}
|
||||
|
Reference in New Issue
Block a user