When I use the captcha module with this theme some description information ("This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.") is missing from the displayed captcha.

The "smart description" feature in this module applies special processing to any element #description.

The captcha module uses a field #description for a different purpose - it's just a normal element as far as captcha is concerned and it should not be processed.

If you can provide a link to some documentation that specifies that #description should only be used for a particular purpose, then I can alter this bug to the captcha module.

Otherwise, there seems to be a bug with this module. It is assuming every instance of #description will have a particular meaning, but modules might not follow that convention.

Thanks!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

AdamPS created an issue. See original summary.

markhalliwell’s picture

Category: Bug report » Support request
Status: Active » Closed (works as designed)

There is nothing wrong with either project.

This is a theme setting that can easily be disabled.

Either globally, in the theme settings, or by setting '#smart_descriptions' => FALSE on the element in question in your sub-theme (see Element::smartDescription()).

AdamPS’s picture

FileSize
1.98 KB
7.41 KB

Thanks for a quick response. Yes, I realise that I can disable the theme setting entirely. No problem I can do that.

My point is that at the moment, when used with the captcha module, the "smart description" setting is buggy - it causes a whole section of the UI to vanish without offering a smart replacement. I have now uploaded attachments correct versus smart - sorry should have done that in the first place.

Seeing as you had put time and effort into "smart descriptions" it could be useful in general. It's a shame if everyone who uses CAPTCHA (currently reported as 275,859 sites) has to spend a while debugging the same problem then eventually disable "smart descriptions" for the whole site.

markhalliwell’s picture

Title: Smart description breaks captcha module » Forcibly disable smart descriptions on captcha elements
Category: Support request » Feature request
Status: Closed (works as designed) » Active

For the record, this is not "breaking" anything. It doesn't remove the description, it just moves it into a tooltip to help clean up the UI.

Honestly though, this doesn't seem to be very "vital" information in the first place.

That being said, this isn't the first time that someone has misunderstood the intentions behind what a captcha is and I suspect it's probably because they provide their instructions inside a description property (not an appropriate place IMO, should be separate/dedicated text).

Thus, I'm changing this issue to a feature request and I'll post a patch shortly that should remedy this minor annoyance.

markhalliwell’s picture

Status: Active » Needs review
FileSize
2.01 KB

Ok, see if this "fixes" it for you. Just make sure you re-enable smart descriptions and then test before/after the patch.

AdamPS’s picture

Status: Needs review » Needs work

Thanks, but not working.

My first thought was to reverse the two lines of code in Captcha::preRenderElement.

However even then it's not working. PluginManager::preRender gets called before PrerenderBase::preRenderElement.

Sorry I'm now getting out of my depth to figure out how to fix it. I can apply another patch if you can figure it out.

markhalliwell’s picture

Status: Needs work » Needs review
FileSize
2.12 KB
506 bytes

Try this.

AdamPS’s picture

Status: Needs review » Reviewed & tested by the community

Great, many thanks!

I agree with you re instructions versus description. In case it helps any others who find this issue, here is a clarification of the "symptoms".

Is it breaking anything?

UI text was lost.

  • There was not a tooltip containing the missing text 'This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.'
  • Because the tooltip is already in use for the text 'Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.'
  • D'oh.

Is it vital?

well I guess that is up to each site to decide, but we have found it useful and you do see something similar on some major sites.

  • markcarver committed fd8fde2 on 8.x-3.x
    Issue #2887284 by AdamPS, markcarver: Forcibly disable smart...
markhalliwell’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.