1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-27 15:00:11 +02:00

fix(entries): fix method rename()

This commit is contained in:
Awilum
2020-05-20 16:02:01 +03:00
parent 766865d14e
commit 7e8dfd4dc3

View File

@@ -513,7 +513,11 @@ class Entries
*/
public function rename(string $id, string $new_id) : bool
{
return rename($this->getDirLocation($id), $this->getDirLocation($new_id));
if (!Filesystem::has($this->getFileLocation($new_id))) {
return rename($this->getFileLocation($id), $this->getFileLocation($new_id));
} else {
return false;
}
}
/**