You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think this needs to be HCaptchaField instead of a widget.
When I add this to userschema.xml in a GS profile and import it, I get a warning and the field is ignored:
INFO [plone.app.users.browser.schemaeditor:78][waitress-0] Unsupported field: captcha (CaptchaField)
Looking further, I add a patch to add captcha to two lists in plone.app.users:
full_field = "plone.formwidget.hcaptcha.HCaptchaField"
if full_field not in schemaeditor.ALLOWED_FIELDS:
schemaeditor.ALLOWED_FIELDS.append(full_field)
field_class = "HCaptchaField"
if field_class not in schemaeditor.field_type_mapping:
schemaeditor.field_type_mapping[field_class] = "string"
logger.info("Added hcaptcha to allowed fields and mapping in plone.app.users")
With this I no longer get the warning about an unsupported field. But importing fails, because plone.supermodel does not support it:
Traceback (innermost last):
Module ZPublisher.WSGIPublisher, line 167, in transaction_pubevents
Module ZPublisher.WSGIPublisher, line 376, in publish_module
Module ZPublisher.WSGIPublisher, line 271, in publish
Module ZPublisher.mapply, line 85, in mapply
Module ZPublisher.WSGIPublisher, line 63, in call_object
Module Products.GenericSetup.tool, line 577, in manage_importSelectedSteps
Module Products.GenericSetup.tool, line 375, in runImportStepFromProfile
Module Products.GenericSetup.tool, line 1323, in _doRunImportStep
- __traceback_info__: usersschema
Module plone.app.users.setuphandlers, line 21, in import_schema
Module plone.app.users.browser.schemaeditor, line 136, in applySchema
Module plone.app.users.browser.schemaeditor, line 178, in get_ttw_edited_schema
Module plone.app.users.browser.schemaeditor, line 275, in load_ttw_schema
Module plone.supermodel, line 37, in loadString
Module plone.supermodel.parser, line 78, in parse
plone.supermodel.parser.SupermodelParseError: Field type plone.formwidget.hcaptcha.HCaptchaField specified for field captcha is not supported
File "<unknown>", line 79
File "/Users/maurits/shared-eggs/cp38/plone.supermodel-1.6.5-py3.8.egg/plone/supermodel/parser.py", line 72, in parse
return _parse(source, policy)
File "/Users/maurits/shared-eggs/cp38/plone.supermodel-1.6.5-py3.8.egg/plone/supermodel/parser.py", line 161, in _parse
readField(
File "/Users/maurits/shared-eggs/cp38/plone.supermodel-1.6.5-py3.8.egg/plone/supermodel/parser.py", line 121, in readField
raise ValueError(
The zcml of plone.formwidget.hcaptchadoes get loaded, and it has some code for supermodel.
In the TTW schema editor (the member-fields view) no options for adding a captcha are visible either. I suppose this is also due to some missing supermodel/schemaeditor integration.
Does anyone know what is missing? Maybe someone has a patch lying around already?
The text was updated successfully, but these errors were encountered:
I am trying this in Plone 5.2, Python 3.8.
The readme says you can add this in an XML model:
I think this needs to be
HCaptchaField
instead of a widget.When I add this to
userschema.xml
in a GS profile and import it, I get a warning and the field is ignored:Looking further, I add a patch to add captcha to two lists in
plone.app.users
:With this I no longer get the warning about an unsupported field. But importing fails, because
plone.supermodel
does not support it:The zcml of
plone.formwidget.hcaptcha
does get loaded, and it has some code for supermodel.In the TTW schema editor (the
member-fields
view) no options for adding a captcha are visible either. I suppose this is also due to some missing supermodel/schemaeditor integration.Does anyone know what is missing? Maybe someone has a patch lying around already?
The text was updated successfully, but these errors were encountered: