I’m receiving the following error when submitting a form:
key() expects parameter 1 to be array, null given
I’m using the Blog skeleton. I used the Grav suggested frontmatter code but removed the Recaptur stuff, I wanted to get it working… Ha!
Filled in all the Form, email SMTP server guff (my own smtp site server info).
The form crashes with a Server error.
This is the form.md
---
title: Contact
form:
name: contact-form
fields:
-
name: name
label: Name
placeholder: 'Enter your name'
autofocus: 'on'
autocomplete: 'on'
type: text
validate:
required: true
-
name: email
label: Email
placeholder: 'Enter your email address'
type: text
validate:
rule: email
required: true
-
name: message
label: Message
size: long
placeholder: 'Enter your message'
type: textarea
validate:
required: true
buttons:
-
type: submit
value: Submit
classes: 'gdlr-button with-border excerpt-read-more'
process:
-
email:
from: '{{ config.plugins.email.from }}'
to:
- '{{ config.plugins.email.from }}'
- '{{ form.value.email }}'
subject: '[Feedback] {{ form.value.name|e }}'
body: '{% include ''forms/data.html.twig'' %}'
-
save:
fileprefix: feedback-
dateformat: Ymd-His-u
extension: txt
body: '{% include ''forms/data.txt.twig'' %}'
message: 'Thank you for your feedback!'
- null
cache_enable: false
---
Here are the first few entries from the error log:
[2022-03-28 11:32:01] grav.CRITICAL: key() expects parameter 1 to be array, null given - Trace:
#0 /home/micexcha/gmwit.com/system/src/Grav/Common/Debugger.php(843): Whoops\Run->handleError(2, ‘key() expects p…’, ‘/home/micexcha/…’, 930)
#1 [internal function]: Grav\Common\Debugger->deprecatedErrorHandler(2, ‘key() expects p…’, ‘/home/micexcha/…’, 930, Array)
#2 /home/micexcha/gmwit.com/user/plugins/form/classes/Form.php(930): key(NULL)
#3 /home/micexcha/gmwit.com/user/plugins/form/form.php(280): Grav\Plugin\Form\Form->post()
Any advice on what to do is welcome. Please keep in mind I am VERY new to Grav so be clear about what to do, please don’t assume I know where to look Thanks