xpertbot / craft-wheelform

Craft CMS 4 Form with Database integration
MIT License
66 stars 32 forks source link

Invalid Configuration on form submission #286

Closed joeqj closed 1 year ago

joeqj commented 1 year ago

On form submission we've started to get the error

Invalid Configuration – Plugin settings need to be configured.

Line 49 in the app/vendor/xpertbot/craft-wheelform/src/Mailer.php file is throwing the error after calling $settings->validate() whenever a form is submitted. A submission email is still sent and the submission is recorded to the form entries however it never makes it past this error screen.

Screenshot 2023-02-28 at 15 47 53

Using the form markup as per the Readme:

{% macro errorList(errors) %}
    {% if errors %}
        <ul class="errors">
            {% for error in errors %}
                <li>{{ error }}</li>
            {% endfor %}
        </ul>
    {% endif %}
{% endmacro %}
{% from _self import errorList %}

{% set form = wheelform.form({
    id: 1,
    redirect: 'contact/thanks'
}) %}

{{ form.open() }}
    {{ wheelformErrors['form'] is defined ? errorList(wheelformErrors['form']) }}
    {{ wheelformErrors['recaptcha'] is defined ? errorList(wheelformErrors['recaptcha']) }}
    {{ wheelformErrors['honeypot'] is defined ? errorList(wheelformErrors['honeypot']) }}

    {% for field in form.fields %}
        {{ field.render() }}
        {{ wheelformErrors[field.name] is defined ? errorList(wheelformErrors[field.name]) }}
    {% endfor %}
{{ form.close() }}

The form ID and redirect page are all setup correctly.

Wondering if you know what could be causing the problem? Happy to help wherever I can :)

xpertbot commented 1 year ago

The error says, "Plugin settings need to be configured". Have you gone to the Craft Admin then into the plugin settings and set a sender email and then saved the settings?

joeqj commented 1 year ago

Yeah so this is what the form settings look like in Craft, we're using a valid email in the "To Email" field

Screenshot 2023-02-28 at 16 20 14

It's also worth noting this setup has been working fine for a couple of months until it was reported by a client today. Great plugin by the way 👍

xpertbot commented 1 year ago

Not the Form Settings but the Plugin Settings; they are usually under "/admin/settings/plugins/wheelform" URL. or Craft Admin > Settings > Plugins > Wheel Form.

joeqj commented 1 year ago

Aww really sorry that was it the "From Email" field was blank in the Plugin settings. Not sure how that happened but thank you for taking the time to respond :) All the best