-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Remove placeholder content fallbacks #6456
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
Remove placeholder content fallbacks #6456
Conversation
cms/plugin_rendering.py
Outdated
@@ -499,11 +499,7 @@ def _preload_placeholders_for_page(self, page, slots=None, inherit=False): | |||
# Creates any placeholders missing on the page | |||
placeholders = title.rescan_placeholders().values() | |||
|
|||
if inherit: |
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.
leave this for now, inheritance is different from fallbacks
cms/plugin_rendering.py
Outdated
@@ -482,7 +482,7 @@ def _get_cached_placeholder_content(self, placeholder, language): | |||
language_cache[placeholder.pk] = cached_value | |||
return language_cache.get(placeholder.pk) | |||
|
|||
def _preload_placeholders_for_page(self, page, slots=None, inherit=False): |
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.
leave parameter
@@ -529,7 +525,6 @@ def _preload_placeholders_for_page(self, page, slots=None, inherit=False): | |||
placeholders=placeholders_to_fetch, | |||
template=page.get_template(), | |||
lang=self.request_language, | |||
is_fallback=inherit, |
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.
this is ok
@@ -125,7 +125,7 @@ def test_preload_placeholders_for_page_with_inherit_off(self): | |||
external_link='https://www.django-cms.org', | |||
) | |||
renderer = self.get_renderer(page=cms_page) | |||
renderer._preload_placeholders_for_page(cms_page, inherit=False) |
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.
leave inherit
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.
inherit is False as default so I have left out adding this one unless you feel that it adds value.
_preload_placeholders_for_page(self, page, slots=None, inherit=False):
cms/utils/plugins.py
Outdated
# These placeholders have no fallback | ||
non_fallback_phs = [ph for ph in placeholders if ph.pk not in fallbacks] | ||
# If no plugin is present in non fallback placeholders, create default plugins if enabled) | ||
# Create default plugins if enabled) |
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.
remove parentheses
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.
All done
@@ -125,7 +125,7 @@ def test_preload_placeholders_for_page_with_inherit_off(self): | |||
external_link='https://www.django-cms.org', | |||
) | |||
renderer = self.get_renderer(page=cms_page) | |||
renderer._preload_placeholders_for_page(cms_page, inherit=False) |
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.
inherit is False as default so I have left out adding this one unless you feel that it adds value.
_preload_placeholders_for_page(self, page, slots=None, inherit=False):
See the output from my modified test using 3.5.2: ======================================================================
|
Documentation checklist