-
-
Notifications
You must be signed in to change notification settings - Fork 189
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
TASK: resource:clean
followup #1678
#3275
Conversation
While reading the code, looking for improvement, it seems tedious that we `getIdentifierByObject` just to `findByIdentifier` a few lines later. This happened due to a funny history of back and forth. At first - 2014 - `resource:clean` was introduced looping over the PersistentResource - neos@8a1ce0f Then - 2016 - it was decided to save the sha1 and loop over them and retrieve the asset via `findOneBySha1` But that did not improve the situation as described in neos#1678 and was removed again - 2019. So in functionality we made a full round, im just here to followup on the last fix to restore the full state syntactically as it was once though of.
1b03888
to
dd6fbe0
Compare
There were three ways to answer > Do you want to remove all broken resource objects and related assets from the database? (y/n/c) But n(o) and c(ancel) both endet the script. To simplify things only y/n will be accepted answers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 by reading
while (!in_array($response, ['y', 'n', 'c'])) { | ||
$response = $this->output->ask('<comment>Do you want to remove all broken resource objects and related assets from the database? (y/n/c) </comment>'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems the cancel
option was meant to be a hard stop while n
would ask for each image.
This was NEVER implement that way not even for the first draft robert did. Thats why i removed cancel
as its equivalent to no
.
While reading the code, looking for improvement, it seems tedious that we
getIdentifierByObject
just tofindByIdentifier
a few lines later.This happened due to a funny history of back and forth.
At first - 2014 -
resource:clean
was introduced looping over the PersistentResource: 8a1ce0fThen - 2016 - it was decided to save the sha1 and loop over them and retrieve the asset via
findOneBySha1
: 879fba1But that did not improve the situation as described in #1678 and was removed again - 2019.
So in functionality we made a full round, im just here to followup on the last fix to restore the full state syntactically as it was once though of.