Describe the bug
When publishing a page, blocks plugins can lost their images sources.
To Reproduce
Steps to reproduce the behavior:
Create a two Card plugins in a page, both with images;
Publish the page;
Go back to page edition:
Edit only one of the Card plugin, change its images;
Publish the page again;
The card plugin which has not been edited has lost its image source;
Expected behavior
Image sources from plugin should never been removed if user does not have explicitly cleared them.
Desktop (If applicable):
OS: Any
Browser: Any
Version: Any
Versions:
Python: Any
Django: Any
DjangoCMS: Any
Additional context
This is related to the DjangoCMS way to manage published/draft version, published page use cloned plugin from draft and the previous ones are deleted, which trigger the post_delete signal. The receiver auto_purge_files_on_delete can not know about this cloning method and so legitimately remove files during deletion, even files are used in clones plugin in published page.
I've digged a little on this but DjangoCMS does not seems to pass any useful argument to receiver to know if file purge should be done or not. For true this would be possible but would require making additional queries to retrieved involved object and pages to determine if file is used or not, this seems bloated.
At this point, the only workaround is to remove receiver auto_purge_files_on_delete from all plugins.
Describe the bug When publishing a page, blocks plugins can lost their images sources.
To Reproduce Steps to reproduce the behavior:
Expected behavior Image sources from plugin should never been removed if user does not have explicitly cleared them.
Desktop (If applicable):
Versions:
Additional context This is related to the DjangoCMS way to manage published/draft version, published page use cloned plugin from draft and the previous ones are deleted, which trigger the
post_delete
signal. The receiverauto_purge_files_on_delete
can not know about this cloning method and so legitimately remove files during deletion, even files are used in clones plugin in published page.I've digged a little on this but DjangoCMS does not seems to pass any useful argument to receiver to know if file purge should be done or not. For true this would be possible but would require making additional queries to retrieved involved object and pages to determine if file is used or not, this seems bloated.
At this point, the only workaround is to remove receiver
auto_purge_files_on_delete
from all plugins.