diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0d12d98..e3964a2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -38,7 +38,7 @@ jobs: - name: Setup Plone ${{ matrix.plone }} with Python ${{ matrix.python }} id: setup - uses: plone/setup-plone@v2.0.0 + uses: plone/setup-plone@v3.0.0 with: python-version: ${{ matrix.python }} plone-version: ${{ matrix.plone }} diff --git a/CHANGES.rst b/CHANGES.rst index d944b60..ec4e7f0 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -14,7 +14,8 @@ New features: Bug fixes: -- *add item here* +- Use `plone.app.z3cform.widgets.OrderedSelect` in Plone 6.1 + [petschki] 3.1.5 (2024-11-05) diff --git a/src/collective/taxonomy/widget.py b/src/collective/taxonomy/widget.py index 0706849..a8e16aa 100644 --- a/src/collective/taxonomy/widget.py +++ b/src/collective/taxonomy/widget.py @@ -1,7 +1,6 @@ from collective.taxonomy.interfaces import ITaxonomySelectWidget from plone.memoize import ram from z3c.form import interfaces -from z3c.form.browser.orderedselect import OrderedSelectWidget from z3c.form.widget import FieldWidget import zope.component @@ -9,6 +8,13 @@ import zope.schema.interfaces +try: + # Plone 6.1 + from plone.app.z3cform.widgets.orderedselect import OrderedSelectWidget +except ImportError: + from z3c.form.browser.orderedselect import OrderedSelectWidget + + def _items_cachekey(fun, self): # try to get modified time of taxonomy utility try: diff --git a/src/collective/taxonomy/widget_input.pt b/src/collective/taxonomy/widget_input.pt index 0a742d6..ddd4d7b 100644 --- a/src/collective/taxonomy/widget_input.pt +++ b/src/collective/taxonomy/widget_input.pt @@ -3,276 +3,109 @@ xmlns:tal="http://xml.zope.org/namespaces/tal" tal:omit-tag="" > - - - - - - - - - - - - -
- -
- - -
- - - - + + + + + + + + +
+ + + +
+ +
+ + + + + + + +
+ +
-