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: Cleanup illegal dependency from Flow to Neos.Media #3272
Comments
…ation This must be cleaned up at some point: See #3272
…ation This must be cleaned up at some point: See #3272
But that doesnt turn out to be thaaat straight forward, at least not with ugly and hard to understand hooks/interfaces. The functionality is as follows:
This part is very transparent, also the related assets will be shown when one is asked to delete a persistent resource, and after a deletion of a single resource it is shown how many assest were also purged:
A similar hook is in place for the thumbnails, but its a little less obvious, as its not documented in the command and only a deletion with related thumbnails will show:
Im not sure what the best solution to approach this is, and if we can leverage doctrine lifetime cycle's or the like ... |
…ation This must be cleaned up at some point: See #3272
Can't we simply introduce a signal ala PersistentResourceNoLongerExists with the object? then an implementation in the media package can take care of handling anything on that signal |
There is ways I guess, but nothing too beautiful indeed. We could pass the output to the signal but that would bind us to CLI there, or equally dirty but a bit more standalone-ish, we pass somehting like a Messages object and the slot code just writes into that and we read the messages after the signal
pseudo code but you get my drift.... Alternatively, what if we defined an interface for "plugins" for this, that defines a method that gets a resource and can return a message of some shape and don't define a signal but just go over all implementations of this interface and call the method. |
Hmm yes sure, but to 100% reflect the current state we need a "beforePossibleRemove" hook as well, to display the related assets that would possibly be removed. I think that we should rather have a specialised command sitting in neos.media and doing this job? I fear all those signals will make the code less easy to grasp. Now its at least all in one place. |
separate command is perfeclty fine for me |
so
will only remove the persistent resources, but ignore all assets, that still might be attached to them. And
So using the original
Aaand additionally the media cleanup could also cleanup orphaned assets, if the resource was removed via flow's |
…ation This must be cleaned up at some point: See neos/flow-development-collection#3272
Resolves neos#3272 There will be another PR towards Neos.Media to include this functionality in `./flow media:cleanresources`. Additionally warn if this command is used in a Neos installation, and let the dev know that it's preferred to use Neos' command.
Resolves neos#3272 There will be another PR towards Neos.Media to include this functionality in `./flow media:cleanresources`. Additionally warn if this command is used in a Neos installation, and let the dev know that it's preferred to use Neos' command.
The
resource:clean
command is intertwined with Neos.Media's AssetRepository and AssetRepository.This is hard to type for phpstan and generally unpleasant to look at :D
Flow 9 should provide some kind of extensibility so that Neos.Media can hook in and do its job.
flow-development-collection/Neos.Flow/Classes/Command/ResourceCommandController.php
Line 243 in 5dd18f1
The text was updated successfully, but these errors were encountered: