Ticket #12751 (confirmed Bug)

Opened 4 years ago

Last modified 3 years ago

[plone.app.discussion] cannot have recaptcha enabled and comment form extended at the same time

Reported by: erral Owned by:
Priority: minor Milestone: 4.x
Component: Commenting/Discussion Version: 4.1
Keywords: Cc: vangheem

Description

I have followed the documentation at  http://packages.python.org/plone.app.discussion/howtos/howto_extend_the_comment_form.html to add two fields to my comment form and then I have enabled recaptcha con my site but it doesn't appear in the form.

I have removed the conditional statement on captcha.zcml to check what's going on, and found a ZCML error about a double registration of adapters:

zope.configuration.config.ConfigurationConflictError: Conflicting configuration actions
  For: ('adapter', (<InterfaceClass zope.interface.Interface>, <InterfaceClass zope.publisher.interfaces.browser.IDefaultBrowserLayer>, <class 'plone.app.discussion.browser.comments.CommentForm'>), <InterfaceClass plone.z3cform.fieldsets.interfaces.IFormExtender>, '')
    File "/var/csmant/instances/7777_codesyntax/src/codesyntax.theme/codesyntax/theme/browser/configure.zcml", line 181.4-185.10
          <adapter
      
              factory=".comment.CommentExtender"
              provides="plone.z3cform.fieldsets.interfaces.IFormExtender"
              />
    File "/var/csmant/downloads/eggs/plone.app.discussion-2.1.4-py2.6.egg/plone/app/discussion/browser/captcha.zcml", line 18.8-20.74
              <adapter
                  factory=".captcha.CaptchaExtender"
                  provides="plone.z3cform.fieldsets.interfaces.IFormExtender" />

This can be easily solved adding a "name" to one of the adapters (I have done so with my adapter and it works), so I think it is worth to add a name to the captcha adapter, and also to the documentation of how to extend the form.

Change History

comment:1 Changed 4 years ago by eleddy

  • Status changed from new to confirmed
  • Keywords plone.app.discussion removed
  • Cc vangheem added

comment:2 Changed 4 years ago by davisagli

  • Component changed from Infrastructure to General

comment:3 Changed 4 years ago by kleist

  • Milestone set to 4.x

comment:4 Changed 3 years ago by maartenkling

  • Component changed from General to Commenting/Discussion

move to discussion component

Note: See TracTickets for help on using tickets.