-
-
Notifications
You must be signed in to change notification settings - Fork 22
Allow the ContentBrowserWidget to be used inside an object widget #231
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
|
@ale-rt thanks for creating this Pull Request and helping to improve Plone! TL;DR: Finish pushing changes, pass all other checks, then paste a comment: To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass, but it takes 30-60 min. Other CI checks are usually much faster and the Plone Jenkins resources are limited, so when done pushing changes and all other checks pass either start all Jenkins PR jobs yourself, or simply add the comment above in this PR to start all the jobs automatically. Happy hacking! |
|
@jenkins-plone-org please run jobs |
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.
Pull Request Overview
This PR enables the ContentBrowserWidget to work properly when used inside an ObjectWidget. It updates the logic for determining the view context—both in the ContentBrowserWidget itself and in the get_widget_form helper—as well as adds the necessary imports and documentation updates.
- Adjusts view context resolution in ContentBrowserWidget.get_pattern_options by handling ObjectWidget instances.
- Modifies get_widget_form in utils.py to recursively retrieve the proper form for ObjectWidget.
- Updates news documentation.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| plone/app/z3cform/widgets/contentbrowser.py | Updates view_context evaluation to support ObjectWidget usage. |
| plone/app/z3cform/utils.py | Adds recursion handling for ObjectWidget in get_widget_form. |
| news/230.bugfix.rst | Adds an entry documenting the bugfix. |
|
I found some issue while working on https://github.com/collective/collective.z3cform.captionedrelationfield, which has a relation field inside an object field. The issues are fixed by: |
mauritsvanrees
left a comment
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.
I confirm the problem and the fix.
Fixes #230