I am using Forms 3.4.13 and Snaptcha 1.7.5.

I just created a single contact form in Forms, and enabled Snaptcha. When outputting my form, I am noticing the the word "Array" is getting added to my form.

It's showing up right after the <div class="hiddenfields"></div> and right before the <div class="snap" ...>

If I disable Snaptcha in my form, it goes away.

I prepended and appended some test text to the $field value in line 91 of ext.snaptcha.php to see if the "Array" text was part of that, but it wasn't, it came before that.

UPDATE: I dug deeper and found where the word "Array" is getting added.

On line 730 of mod.forms.php $OUT_FORM_PREPEND .= $SNAP->comment_field($OUT_FORM_PREPEND); it calls comment_field(). I'm not totally sure why. But in comment_field() in ext.snaptcha.php, the $tagdata variable is what has the text 'Array'.

I added the following to line 203 of ext.snaptcha.php to convert the string 'Array' to an actual array to see what was in it: $tagdata = "<pre>".print_r($tagdata,true)."</pre>"; and it appears to contain 3 values. One is the contents of my {page_body} field in my previous, closed channel entries loop. The other two are empty...


Ok, this seems to be a bug in DevDemon's Forms addon.

On line 730 of mod.forms.php it has: $OUT_FORM_PREPEND .= $SNAP->comment_field($OUT_FORM_PREPEND);

Changing this to $OUT_FORM_PREPEND .= $SNAP->snaptcha_field($OUT_FORM_PREPEND); fixes this issue.

  • 1
    Thanks for debugging this! Updated our internal build with the changes. Feb 20 '15 at 14:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.