-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
fix: Correct ContentRenderer logic for toolbar and page content handling #8092
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
Conversation
Reviewer's Guide by SourceryThis PR fixes the ContentRenderer._get_content_object method to properly handle toolbar objects and page content associations. The implementation improves the logic by correctly checking the toolbar object type and its relationship with the page, and restructures the code to handle different cases more clearly. A new test has been added to verify the behavior. Updated class diagram for ContentRendererclassDiagram
class ContentRenderer {
- toolbar
- request_language
+ _get_content_object(page, slots)
+ _preload_placeholders_for_page(page, slots, inherit)
}
class Toolbar {
+ get_object()
+ preview_mode_active
+ edit_mode_active
}
class Page {
+ pagecontent_set
+ get_content_obj(language, fallback)
}
class PageContent {
+ page
+ rescan_placeholders()
}
class Placeholder {
+ get_for_obj(obj)
+ none()
}
ContentRenderer --> Toolbar
ContentRenderer --> Page
ContentRenderer --> Placeholder
PageContent --> Page
Placeholder --> PageContent
File-Level Changes
Assessment against linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Hey @fsbraun - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
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.
Looks good to me. Let's get this merged and released 🚢 🚀
Description
Fix the logic in ContentRenderer._get_content_object to correctly handle toolbar objects and page content associations, and add a corresponding test to verify the behavior.
Bug Fixes:
Tests:
Related resources
Checklist
develop-4
Summary by Sourcery
Correct the logic in ContentRenderer to properly handle toolbar objects and page content associations, and add a test to verify the correct behavior.
Bug Fixes:
Tests: