craftcms / contact-form

Add a simple contact form to your Craft CMS site.
https://plugins.craftcms.com/contact-form
MIT License
294 stars 93 forks source link

Typo in example code results in no validation errors displaying, and no field values re-populating #220

Closed realjoshharrison closed 2 years ago

realjoshharrison commented 2 years ago

Description

The example code in the readme includes the line:

{% set message = message ?? null %}

I couldn't get this to work displaying errors or repopulating field values using the example code. I'm no expert but dug around in the source a bit and tried some stuff, and found this works:

{% set message = submission ?? null %}

Steps to reproduce

  1. Copy example code
  2. Fill in a couple of fields but make sure it won't validate (e.g. leave 'message' blank)
  3. Send
  4. Errors do not display and any fields you filled in do not maintain their values

Additional info

realjoshharrison commented 2 years ago

First ever PR! Hope it's all ok?

angrybrad commented 2 years ago

You did great!!! Thank you.