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

Placeholders not showing up in structure mode sidebar #6570

Open
mba-ableton opened this Issue Dec 4, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@mba-ableton
Contributor

mba-ableton commented Dec 4, 2018

Summary

Static placeholders and placeholders attached to a model via a PlaceholderField and rendered using render_placeholder stopped showing up in the structure mode sidebar after upgrading to v3.5. Placeholders on regular cms pages still work as expected.

This issue only manifests on url endpoints which have a page node attached, but are served by a view other than cms.views.details. After some investigation it turns out that this is because the toolbar wrongly selects the ContentRenderer instead of the LegacyRenderer in such cases. It does so on the assumption (in BaseToolbar.uses_legacy_structure_mode) that a truthy value of the request.current_page attribute signals that the current request is being serviced by the built-in cms.views.details view, which supports the non-legacy structure mode.

We managed to work around the issue by replacing the CurrentPageMiddleware with a middleware that sets request.current_page = None instead as some of the built-in cms toolbars rely on the attribute being present when they're being populated.

Expected behaviour

Placeholders available for editing are shown in the sidebar.

Actual behaviour

The structure mode sidebar is empty even though there are placeholders in the template being rendered.

Environment

  • Python version: 3.5.6
  • Django version: 1.11.16
  • django CMS version: 3.5.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment