Skip to content
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

fix: Versioning-safe implementation of placeholder inheritance #7924

Merged
merged 2 commits into from
May 20, 2024

Conversation

fsbraun
Copy link
Sponsor Member

@fsbraun fsbraun commented May 17, 2024

Description

The ContentRenderer.render_page_placeholders implementation is not versioning-safe, i.e. assumes that there is exactly one PageContent object per Page and language. This PR improves the implementation using the admin_manager.

This will allow {% placeholder "my_placeholder" inherit %} to also work with versioned page contents, such as provided by djangocms-versioning. (For it to actually work with djangocms-versioning, however, an additional change to djangocms-versioning is needed, to not deactivate the inherit functionality.)

Results with djangocms-versioning:

  • When rendered at the URL (i.e. public endpoint): The placeholder only inherits from also public placeholders
  • When previewed: The placeholder inherits from the latest parent placeholder (i.e. public or draft)
  • When edited: Inherited placeholders are empty to allow for adding content

Then changes are covered by tests. Additional tests need to go into djangocms-versioning if the inheritance feature is activated again.

Related resources

Checklist

  • I have opened this pull request against develop-4
  • I have added or modified the tests when changing logic
  • I have followed the conventional commits guidelines to add meaningful information into the changelog
  • I have read the contribution guidelines and I have joined the channel #pr-reviews on our Discord Server to find a “pr review buddy” who is going to review my pull request.

@fsbraun fsbraun changed the title Fix: Versioning-safe implementation of placeholder inheritance fix: Versioning-safe implementation of placeholder inheritance May 17, 2024
@fsbraun fsbraun added the 4.1 label May 18, 2024
Copy link
Member

@vinitkumar vinitkumar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Let's get this merged and released 🚢 🚀

@fsbraun fsbraun merged commit 6493f02 into django-cms:develop-4 May 20, 2024
80 of 81 checks passed
@fsbraun fsbraun deleted the fix/placeholder-inherit branch May 23, 2024 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants