Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete directory after delete all images #68

Conversation

bscheshirwork
Copy link
Contributor

Nested of #65

Fix #67

NOTE: This new behavior with remove folder MUST have a line on changelog.

@@ -223,6 +222,27 @@ public function getFilePath($imageId, $version = 'original')
return $this->directory . '/' . $this->getFileName($imageId, $version);
}

public function getDirectoryPath()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be private?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO This functional can be use outside widget for build the path to galery folder of model

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also we can redefine it in children

@@ -314,6 +348,9 @@ function ($image) use (&$removed) {
}
);
}
if (is_null($this->_images)) {
$this->removeDirectory($this->getDirectoryPath());
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not correct - is_null($this->_images) means only that getImages() method was not called yet

@bscheshirwork bscheshirwork deleted the delete-directory-after-delete-all-images branch May 29, 2019 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Delete all nested folders
2 participants