Skip to content

Conversation

@ale-rt
Copy link
Member

@ale-rt ale-rt commented May 9, 2025

Fixes #230

@ale-rt ale-rt requested a review from Copilot May 9, 2025 07:19
@mister-roboto
Copy link

@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:

@jenkins-plone-org please run jobs

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!

@ale-rt
Copy link
Member Author

ale-rt commented May 9, 2025

@jenkins-plone-org please run jobs

Copy link

Copilot AI left a 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.

@ale-rt
Copy link
Member Author

ale-rt commented May 9, 2025

Copy link
Member

@mauritsvanrees mauritsvanrees left a 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.

@ale-rt ale-rt merged commit 3227cfb into master May 12, 2025
14 checks passed
@ale-rt ale-rt deleted the ale/230/fix branch May 12, 2025 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The ContentBrowserWidget widgets does not find the form context when included in an Object Widget

4 participants