plone / Products.CMFPlone

The core of the Plone content management system
https://plone.org
GNU General Public License v2.0
243 stars 186 forks source link

Available languages widget requiring selection #3841

Closed wesleybl closed 11 months ago

wesleybl commented 11 months ago

BUG/PROBLEM REPORT (OR OTHER COMMON ISSUE)

Available languages widget requiring selection, even after sending the languages from one box to another.

What I did:

What I expect to happen:

What actually happened:

The form displays the validation message Select an item from the list. This appears to be javascript validation, since no request is made.

download

What version of Plone/ Addons I am using:

Plone 6.0.6 (6017) CMF 3.0 Zope 5.8.3 Python 3.11.1 (main, Dec 7 2022, 01:11:34) [GCC 11.3.0] PIL 9.5.0 (Pillow) WSGI: On Server: waitress 2.1.2

wesleybl commented 11 months ago

@petschki @thet is this something from the mockup?

petschki commented 11 months ago

This is because the values on the right side must be pre-selected, otherwise they are missing in the request. This is fixed in plone.app.z3cform==4.3.0 (see https://github.com/plone/plone.app.z3cform/commit/2c85c7cf204fa291e3d64b67c4f862b1bed6e40c) but Plone 6.0.6 uses 4.2.1... so defintifely fixed in the upcoming 6.0.7 version...

wesleybl commented 11 months ago

@petschki would it still be a problem if someone unchecked all or items in the right box?

petschki commented 11 months ago

If you uncheck all values from a required orderedselectfieldwidget pat-validationshows the message above immediately and you cannot click the save button (in 6.0.6 cancel button is also disabled, but that got fixed in mockup and patternslib also some time ago). This widget is based on a very old z3c.form template and JS implementation which is pretty outdated (see also https://github.com/plone/plone.app.z3cform/issues/184) and I would be happy to see a better implementation than this (eg. AjaxSelectWidget like the keywords field uses ... )

wesleybl commented 11 months ago

Yes. It shouldn't be necessary to select an item. The box itself is the selection. Thanks!