diff --git a/src/Plugin/WebformElement/WebformManagedFileBase.php b/src/Plugin/WebformElement/WebformManagedFileBase.php index a7e7c6dfb..99809ad2a 100644 --- a/src/Plugin/WebformElement/WebformManagedFileBase.php +++ b/src/Plugin/WebformElement/WebformManagedFileBase.php @@ -512,7 +512,7 @@ abstract class WebformManagedFileBase extends WebformElementBase implements Webf return $value; } - return $this->entityTypeManager->getStorage('file')->load($value); + return $this->entityTypeManager->getStorage('file')->loadUnchanged($value); } /** @@ -532,7 +532,9 @@ abstract class WebformManagedFileBase extends WebformElementBase implements Webf if (empty($value)) { return []; } - return $this->entityTypeManager->getStorage('file')->loadMultiple((array) $value); + $fids = (array) $value; + $this->entityTypeManager->getStorage('file')->resetCache($fids); + return $this->entityTypeManager->getStorage('file')->loadMultiple($fids); } /** @@ -1270,6 +1272,7 @@ abstract class WebformManagedFileBase extends WebformElementBase implements Webf $file->setFileUri($destination_uri); $file->setFileName($this->fileSystem->basename($destination_uri)); $file->save(); + $this->entityTypeManager->getStorage('file')->resetCache([$file->id()]); } // Update file usage table.