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

Make dependencies and css_class work in fieldsets as well. #389

Conversation

mauritsvanrees
Copy link
Member

Note that this overrides widget.pt from plone.app.z3cform for all forms. Should be okay: they are currently very similar. Differences:

  • We lookup @@dependencies and @@css_class views on the widget, though we now accept it when these are not found.
  • We set data-pat-inlinevalidation='{"type":"z3c.form"}'

This PR is targeted at my branch for PR #387, because we may need both changes in a project. The commit specific for the current PR should be cleanly applicable on the master branch, except perhaps the changelog entry.

Note that this overrides `widget.pt` from `plone.app.z3cform` for *all* forms.
Should be okay: they are currently very similar.  Differences:

- We lookup `@@dependencies` and `@@css_class` views on the widget, though we now accept it when these are not found.
- We set `data-pat-inlinevalidation='{"type":"z3c.form"}'`


PloneRenderWidget.index = ViewPageTemplateFile("widget.pt")
logger.info("Patched plone.app.z3cform.views.RenderWidget to use our widget.pt.")
Copy link
Member

Choose a reason for hiding this comment

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

This makes me uneasy. If a project has also customized this template using z3c.jbot, which one wins?

Copy link
Member Author

Choose a reason for hiding this comment

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

It makes me uneasy too.
One way to solve this, would be to actually take over the widget template from easyform in plone.app.z3cform. Should be okay. But definitely not now, a few days before Plone 6 final. That makes me far more uneasy. ;-)

@mauritsvanrees
Copy link
Member Author

I close this in favour of earlier PR #374 where @petschki does it in a much smarter way.

@mauritsvanrees mauritsvanrees deleted the maurits-dependencies-and-css-class-in-fieldsets branch January 5, 2023 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants