eapearson
Forum Replies Created
-
Forum: Plugins
In reply to: [Relevanssi - A Better Search] PHP NoticesI can confirm the former, but not the latter.
My site is set up to display all errors, so this actually appeared for me on the site as well.
It is a simple fix at line 468 — a variable that is not always initialized. The danger of “if” without curly braces!It looks like the apply_filters for wp_recaptcha_cf7_shortcode_wrap also needs to pass
$tag->nameas a second argument, allowing a wrapper like<div class="form-group recaptcha-82"> .. </div>i tested that change and it works.
Also, perhaps the default wrapper can be dispensed with if there is a wp_recaptcha_cf7_shortcode_wrap filter?Thanks, I appreciate that, thanks for explaining and for such a quick fix!
Yes, I was looking the the boostrap plugin code too. Maybe part of the problem is that the usage of the tag + class to select a field container for adding the error message. If CF7 kept those two things separate, e.g. using a data- attribute or a class not associated with a styling, to flag a container to receive the message, then any custom field could retain the ability to display error messages.But honestly I have no idea how contact form plugins are supposed to interact with each other at this level, so don’t know who to blame! Please feel free to point me over to the contact form bootstrap author if that is where the problem lies.
Must be due to the contact form bootstrap plugin.
Okay, so I found the problem. The wrapper for the reaptcha control is a span instead of div and does not include the form-group class. The error response specifically targets a selector depending on this structure. E.g. “div.form-group.recaptcha-82”
If I make that change directly in the browser inspector or to recaptcha_shortcode_handler in class-wp_recaptcha_contactform7.php it works as you have described.
'<div class="wpcf7-form-control-wrap form-group %1$s">%2$s %3$s</div>',was
'<span class="wpcf7-form-control-wrap %1$s">%2$s %3$s</span>',It isn’t empty. I’ll poke around.
Is the recaptcha even attempted if it isn’t clicked? That is — I would expect that if the checkbox isn’t clicked that it should be treated as an empty required field rather than an erroneously filled out captcha.Also, note that the recaptcha field correctly stops the form from submitting if it is not checked. It is just that the “Please fill the required field” does not show. And actually, in this case, since it is a special field, the missing field message should probably be something like “Please click the checkbox to prove that you are a human”.
Right. Other required fields show the standard “Please fill the required field.” message in red (and since it uses the bootstrap plugin, the field is also outlined in red.)
Other validation works for the standard fields as well. E.g. for an email field an invalid entry yields “Email address seems invalid.”