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
Cache not invalidated when using a PlaceholderField outside the CMS #6912 #6956
Cache not invalidated when using a PlaceholderField outside the CMS #6912 #6956
Conversation
Force placeholder cache clearing when updating a PlaceholderField content
Add a test to check that the mark_as_dirty method of placeholder will clear placeholder cache for custom model having a Placeholderfield and edited from the cms.admin.placeholderadmin methods
Any news on this issue ? It affects all ours projects using djangocms-blog as described in this related issue :( |
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.
@pierreben My apologies that it has taken this long to review your change. This looks good and I'm grateful that you have also provided a test.
Can you please add a changelog entry into the changelog, this ensures that we mention your fix in any official releases.
Once this has a changelog entry int he unreleased section of the changelog I will approve this change, once approved we can start to look at getting it merged and released.
Again thank you for your effort regarding this fix.
- Add a changelog line for PlaceholderField cache invalidation fix
@Aiky30 , thank you for the fix analysis. I've updated the changelog ;) |
Why this MR is not yet merged ? Django-cms is not working without that patch. A solution is provided since December 2020, it's too long to patch a critical issue like that. |
Hi @palmitoto I can understand your annoyance about the delay. Unfortunately, we are not in a good position at the moment in terms of resources, plus there is a problem with Travis that we are working on solving. But rest assured that we will try to resolve this quickly. With the founding of the django CMS Association, we have started an initiative that aims to foster contribution. Among many other community groups, we also have a work group for reviewing pull requests and a work group that takes care of release management. Both teams are happy to receive any support. We invite everyone to join us! If you want to learn more, feel free to contact me, otherwise more information can be found here: You are also welcome to join our Slack channel: www.django-cms.org/slack to get in touch with the team. Best |
Hi @Aiky30, |
@Aiky30 since we are trying to make the Changelog happen more automatically, and based on your comments, I am updating the branch and schedule this one for merge. |
will add the changelog entry directly from squash commit
merged! and right in time for 3.9.0! |
Description
Since v3.6.0, when using a PlaceholderField outside the CMS, the cache is not invalidated when updating the placeholder content.
On this commit, the value of the clear_cache attribute changed from True to False, and the clear_cache method is never called in this case.
I've created a new pull request as the previous was invalid and added tests.
Related resources
Steps to reproduce
Create a MyModel instance, a view and template to display it
Edit the my_model_object placeholder field content within a template using the render_placeholder template tag:
{% render_placeholder my_model_object.body_placeholder %}
Open the MyModel instance view in a private session to compare the content.
Repeat steps 4 and 5 twice if the content doesn't differs.
Expected behaviour
The contents are always the same between the two browser sessions.
Actual behaviour
The contents differs as the cache is not invalidated when updating the body_placeholder content.
Suggested correction
In the mark_as_dirty method, force clear_cache when the attached model is not a Page or a StaticPlaceholder.
Checklist
develop