Skip to content

Commit

Permalink
Merge pull request #196 from aedart/fix-unable-to-read-file
Browse files Browse the repository at this point in the history
Fix unable to read file
  • Loading branch information
aedart authored Oct 2, 2024
2 parents b744e8b + 0d38578 commit b644475
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

* Updated dependencies (_service update_).

### Fixed

* `DatabaseAdapter` fails when attempting to move or copy to the same destination as the source (_adapter now skips performing `move()` or `copy()`, if source and destination are the same_). [#195](https://github.com/aedart/athenaeum/issues/195).

## [8.10.0] - 2024-09-23

### Changed
Expand Down
10 changes: 10 additions & 0 deletions packages/Flysystem/Db/src/Adapters/DatabaseAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,11 @@ public function listContents(string $path, bool $deep): iterable
*/
public function move(string $source, string $destination, Config $config): void
{
// Skip when source and destination are the same...
if ($source === $destination) {
return;
}

try {
// Copy the file
$this->performCopy($source, $destination, $config);
Expand All @@ -487,6 +492,11 @@ public function move(string $source, string $destination, Config $config): void
*/
public function copy(string $source, string $destination, Config $config): void
{
// Skip when source and destination are the same...
if ($source === $destination) {
return;
}

try {
$this->performCopy($source, $destination, $config);
} catch (Throwable $e) {
Expand Down

0 comments on commit b644475

Please sign in to comment.