From 72b9bf60f896bd60cd69fb5a017eba2bff9d439f Mon Sep 17 00:00:00 2001 From: Chris Burgess Date: Thu, 17 Oct 2024 14:51:01 +1300 Subject: [PATCH] islandora#1061: Ensure parent directory exists --- src/Flysystem/Adapter/FedoraAdapter.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Flysystem/Adapter/FedoraAdapter.php b/src/Flysystem/Adapter/FedoraAdapter.php index 0871827e1..a4bf7abf8 100644 --- a/src/Flysystem/Adapter/FedoraAdapter.php +++ b/src/Flysystem/Adapter/FedoraAdapter.php @@ -298,6 +298,12 @@ public function write($path, $contents, Config $config) { } } + $parts = explode('/', $path); + array_pop($parts); + if ($parts) { + $this->createDir(implode('/', $parts), $config); + } + $response = $this->fedora->saveResource( $path, $contents,