Adding honeypot to BetterComments crashed site

I added the honeypot according to the example and that’s why it crashed everything.

Screenshot from 2024-01-15 22-12-49

I reformatted it to match the format used with the rest of the bettercomments.yaml and it works! The form now has a hidden element…

<input aria-hidden="true" type="text" 
style="visibility:hidden;position:absolute!important;height:1px;width:1px;overflow:hidden;clip:rect(1px,1px,1px,1px);" 
class="form-honeybear" name="data[honeypot]" value="">

FWIW, the first few lines of bettercomments.yaml looked like this…

form:
  name: bettercomments
  fields:
    - name: name
      label: PLUGIN_COMMENTS.NAME_LABEL
      placeholder: PLUGIN_COMMENTS.NAME_PLACEHOLDER
      autocomplete: on
      type: text
      validate:
        required: true
    - name: email
      label: PLUGIN_COMMENTS.EMAIL_LABEL
      placeholder: PLUGIN_COMMENTS.EMAIL_PLACEHOLDER
      type: email
      validate:
        required: true

When I added the honeypot code to it, I basically copy/pasted it from the user manual so it looked like this…

form:
  name: bettercomments
  fields:
    - honeypot:
        type: honeypot
    - name: name
      label: PLUGIN_COMMENTS.NAME_LABEL
      placeholder: PLUGIN_COMMENTS.NAME_PLACEHOLDER
      autocomplete: on
      type: text
      validate:
        required: true
    - name: email
      label: PLUGIN_COMMENTS.EMAIL_LABEL
      placeholder: PLUGIN_COMMENTS.EMAIL_PLACEHOLDER
      type: email
      validate:
        required: true

To make it work, I had to reformat it like this…

form:
  name: bettercomments
  fields:
    - name: honeypot
      type: honeypot
    - name: name
      label: PLUGIN_COMMENTS.NAME_LABEL
      placeholder: PLUGIN_COMMENTS.NAME_PLACEHOLDER
      autocomplete: on
      type: text
      validate:
        required: true
    - name: email
      label: PLUGIN_COMMENTS.EMAIL_LABEL
      placeholder: PLUGIN_COMMENTS.EMAIL_PLACEHOLDER
      type: email
      validate:
        required: true

Hopefully that helps someone in the future. :+1:t2: