Skip to content

Commit

Permalink
Merge pull request #403 from plone/fix-#396
Browse files Browse the repository at this point in the history
Fix #396
  • Loading branch information
1letter authored Aug 19, 2024
2 parents cd8175b + b5df682 commit 0d2079c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
1 change: 1 addition & 0 deletions news/396.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use widgets for behavior fields from `plone.app.z3cform` to make the formfields BS5 ready [1letter]
21 changes: 18 additions & 3 deletions plone/app/event/dx/behaviors.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from plone.app.event.dx.interfaces import IDXEvent
from plone.app.event.dx.interfaces import IDXEventRecurrence
from plone.app.textfield.value import RichTextValue
from plone.app.z3cform.widget import DatetimeFieldWidget
from plone.app.z3cform.widgets.datetime import DatetimeFieldWidget
from plone.autoform import directives
from plone.autoform.interfaces import IFormFieldProvider
from plone.base.utils import safe_text
Expand All @@ -28,8 +28,6 @@
from plone.supermodel import model
from plone.uuid.interfaces import IUUID
from z3c.form.browser.checkbox import SingleCheckBoxFieldWidget
from z3c.form.browser.text import TextFieldWidget
from z3c.form.browser.textlines import TextLinesFieldWidget
from zope import schema
from zope.component import adapter
from zope.globalrequest import getRequest
Expand All @@ -41,6 +39,23 @@
from zope.schema.interfaces import IContextAwareDefaultFactory


try:
# Import fails for Plone < 6.1
# version pin of plone.app.z3cform is set to plone.app.z3cform==4.3.2
# TextLinesFieldWidget is introduced in plone.app.z3cform==4.4.0
from plone.app.z3cform.widgets.text import TextFieldWidget
except ImportError:
from z3c.form.browser.text import TextFieldWidget

try:
# Import fails for Plone < 6.1
# version pin of plone.app.z3cform is set to plone.app.z3cform==4.3.2
# TextLinesFieldWidget is introduced in plone.app.z3cform==4.4.0
from plone.app.z3cform.widgets.textlines import TextLinesFieldWidget
except ImportError:
from z3c.form.browser.textlines import TextLinesFieldWidget


def first_weekday_sun0():
return wkday_to_mon1(first_weekday())

Expand Down

0 comments on commit 0d2079c

Please sign in to comment.