verbb / formie

The most user-friendly forms plugin for Craft CMS.
Other
93 stars 69 forks source link

New Form from 'Contact Us' Stencil fails #1865

Closed afairhurst closed 1 month ago

afairhurst commented 1 month ago

Describe the bug

New installation of Formie, New Form from 'Contact Us' Stencil fails with the following on page error:

[
    {
        "rows": [
            {
                "fields": [
                    {
                        "label": [
                            "Label cannot be blank."
                        ],
                        "handle": [
                            "Handle cannot be blank."
                        ]
                    }
                ]
            },
            {
                "fields": [
                    {
                        "label": [
                            "Label cannot be blank."
                        ],
                        "handle": [
                            "Handle cannot be blank."
                        ]
                    }
                ]
            },
            {
                "fields": [
                    {
                        "label": [
                            "Label cannot be blank."
                        ],
                        "handle": [
                            "Handle cannot be blank."
                        ]
                    }
                ]
            }
        ]
    },
    {
        "fields": [
            {
                "label": [
                    "Label cannot be blank."
                ],
                "handle": [
                    "Handle cannot be blank."
                ]
            }
        ]
    },
    {
        "label": [
            "Label cannot be blank."
        ],
        "handle": [
            "Handle cannot be blank."
        ]
    },
    {
        "fields": [
            {
                "label": [
                    "Label cannot be blank."
                ],
                "handle": [
                    "Handle cannot be blank."
                ]
            }
        ]
    },
    {
        "label": [
            "Label cannot be blank."
        ],
        "handle": [
            "Handle cannot be blank."
        ]
    },
    {
        "fields": [
            {
                "label": [
                    "Label cannot be blank."
                ],
                "handle": [
                    "Handle cannot be blank."
                ]
            }
        ]
    },
    {
        "label": [
            "Label cannot be blank."
        ],
        "handle": [
            "Handle cannot be blank."
        ]
    }
]

Console Log:

2024-05-03 14:28:28 [ERROR] Couldn’t save form - [{"rows":[{"fields":[{"label":["Label cannot be blank."],"handle":["Handle cannot be blank."]}]},{"fields":[{"label":["Label cannot be blank."],"handle":["Handle cannot be blank."]}]},{"fields":[{"label":["Label cannot be blank."],"handle":["Handle cannot be blank."]}]}]},{"fields":[{"label":["Label cannot be blank."],"handle":["Handle cannot be blank."]}]},{"label":["Label cannot be blank."],"handle":["Handle cannot be blank."]},{"fields":[{"label":["Label cannot be blank."],"handle":["Handle cannot be blank."]}]},{"label":["Label cannot be blank."],"handle":["Handle cannot be blank."]},{"fields":[{"label":["Label cannot be blank."],"handle":["Handle cannot be blank."]}]},{"label":["Label cannot be blank."],"handle":["Handle cannot be blank."]}].
2024-05-03 14:28:28 [INFO] Request context:
$_GET = []

$_POST = [
    'action' => 'formie/forms/save'
    'redirect' => 'a4a4c03e2f926511b897adc217f5b2fc1e4e395410d2dfb08714bca6f90eb27eformie/forms/edit/{id}'
    'CraftCMS--65b02b82-49ed-4d34-9747-ea0dad6a709c' => 'fIqEnmT1i8UQuKvaKQONNvkDfTAJsKm51mmYJs6P1y9JB54N7FK8jFAwFKaexgGyIXoCtDxybyWh__BktOZDKFVjIfpthBVy0vg4YdF5npl2a_IsEq6-AKfy6n0IPdlLy8KmCIvP6eVZmwzNYhSZFq5xi0mfzvwlbbZ-t6AkMnggNVcvy35SM68RLelB1jUvB1-ZOtrq_TaG-oRB1tqIWmW0YZtzTnV5497OjB2hC5TFpWAjbtpko2GFvywEdsWopTWKGBxjgwgWXBGQz5ZV1tdxGjMBEJ5VvSIQtssPArJNqK1BXsEYK5eNN8TFjx4_Wbh8_PSfOemsj9c43VyjAUbqZ-8g5TjNvZocOtQOhOVUYQ9XbyMW5iQYQeB7RK0omQYWNCOo'
    'title' => 'New Form'
    'applyStencilId' => '1'
    'handle' => 'newForm'
]

If I edit the 'Contact Form' stencil, I see this error in the form layout:

Missing Field — Unable to Find Component Class

Steps to reproduce

  1. Formie > + New Form
  2. Select 'Contact Form' from Stencil dropdown
  3. Click Next

Form settings

Craft CMS version

5.1.1

Plugin version

3.0.0-beta.9

Multi-site?

No

Additional context

I've tried uninstalling / reinstalling, however issue persists.

Thank you!

Screenshot 2024-05-03 at 14 38 46
engram-design commented 1 month ago

Looks like an issue with the default stencil being created on a new install of Formie. I believe Craft 4 upgrades will be unaffected.

Fixed for the next release. To get this early, run composer require verbb/formie:"dev-craft-5 as 3.0.0-beta.9".

You can either re-install the plugin which will re-create the stencil, or manually alter the data column in the formie_stencils database table to be the following:

{"dataRetention":"forever","dataRetentionValue":"","fileUploadsAction":"retain","notifications":[{"attachAssets":null,"attachFiles":true,"attachPdf":null,"bcc":null,"cc":null,"conditions":null,"content":"[{\"type\":\"paragraph\",\"content\":[{\"type\":\"text\",\"text\":\"A user submission has been made on the \\\"\"},{\"type\":\"variableTag\",\"attrs\":{\"label\":\"Form Name\",\"value\":\"{formName}\"}},{\"type\":\"text\",\"text\":\"\\\" form on \"},{\"type\":\"variableTag\",\"attrs\":{\"label\":\"Site Name\",\"value\":\"{siteName}\"}},{\"type\":\"text\",\"text\":\" at \"},{\"type\":\"variableTag\",\"attrs\":{\"label\":\"Timestamp (yyyy-mm-dd hh:mm:ss)\",\"value\":\"{timestamp}\"}}]},{\"type\":\"paragraph\",\"content\":[{\"type\":\"text\",\"text\":\"Their submission details are:\"}]},{\"type\":\"paragraph\",\"content\":[{\"type\":\"variableTag\",\"attrs\":{\"label\":\"All Form Fields\",\"value\":\"{allFields}\"}}]}]","enableConditions":null,"enabled":true,"from":null,"fromName":null,"handle":"adminNotification","name":"Admin Notification","pdfTemplateId":null,"recipients":"email","replyTo":"{field:emailAddress}","replyToName":null,"sender":null,"subject":"A new submission was made on \"{formName}\"","templateId":null,"to":"{systemEmail}","toConditions":null},{"attachAssets":null,"attachFiles":true,"attachPdf":null,"bcc":null,"cc":null,"conditions":null,"content":"[{\"type\":\"paragraph\",\"content\":[{\"type\":\"text\",\"text\":\"Thanks again for contacting us. Our team will get back to you as soon as we can.\"}]},{\"type\":\"paragraph\",\"content\":[{\"type\":\"text\",\"text\":\"As a reminder, you submitted the following details at \"},{\"type\":\"variableTag\",\"attrs\":{\"label\":\"Timestamp (yyyy-mm-dd hh:mm:ss)\",\"value\":\"{timestamp}\"}}]},{\"type\":\"paragraph\",\"content\":[{\"type\":\"variableTag\",\"attrs\":{\"label\":\"All Form Fields\",\"value\":\"{allFields}\"}}]}]","enableConditions":null,"enabled":true,"from":null,"fromName":null,"handle":"userNotification","name":"User Notification","pdfTemplateId":null,"recipients":"email","replyTo":null,"replyToName":null,"sender":null,"subject":"Thanks for contacting us!","templateId":null,"to":"{field:emailAddress}","toConditions":null}],"pages":[{"label":"Page 1","rows":[{"fields":[{"settings":{"conditions":null,"containerAttributes":null,"contentTable":null,"cssClasses":null,"defaultValue":null,"emailValue":null,"enableConditions":false,"enableContentEncryption":false,"enabled":true,"errorMessage":null,"handle":"yourName","includeInEmail":true,"inputAttributes":null,"instructions":"Please enter your full name.","instructionsPosition":"verbb\\formie\\positions\\AboveInput","label":"Your Name","labelPosition":"verbb\\formie\\positions\\Hidden","matchField":null,"nestedLayoutId":null,"placeholder":"Your name","prePopulate":null,"required":false,"rows":[{"fields":[{"settings":{"conditions":null,"containerAttributes":null,"cssClasses":null,"defaultValue":null,"emailValue":null,"enableConditions":false,"enableContentEncryption":false,"enabled":false,"errorMessage":null,"handle":"prefix","includeInEmail":true,"inputAttributes":[{"label":"autocomplete","value":"honorific-prefix"}],"instructions":null,"instructionsPosition":null,"label":"Prefix","labelPosition":null,"layout":null,"limitOptions":false,"matchField":null,"max":null,"min":null,"multi":false,"optgroups":true,"options":[{"isDefault":true,"label":"Select an option","value":""}],"placeholder":null,"prePopulate":null,"required":false,"visibility":null},"type":"verbb\\formie\\fields\\subfields\\NamePrefix"},{"settings":{"conditions":null,"containerAttributes":null,"cssClasses":null,"defaultValue":null,"emailValue":null,"enableConditions":false,"enableContentEncryption":false,"enabled":true,"errorMessage":null,"handle":"firstName","includeInEmail":true,"inputAttributes":[{"label":"autocomplete","value":"given-name"}],"instructions":null,"instructionsPosition":null,"label":"First Name","labelPosition":null,"limit":false,"matchField":null,"max":null,"maxType":"characters","min":null,"minType":"characters","placeholder":"e.g. Peter","prePopulate":null,"required":true,"uniqueValue":false,"visibility":null},"type":"verbb\\formie\\fields\\subfields\\NameFirst"},{"settings":{"conditions":null,"containerAttributes":null,"cssClasses":null,"defaultValue":null,"emailValue":null,"enableConditions":false,"enableContentEncryption":false,"enabled":false,"errorMessage":null,"handle":"middleName","includeInEmail":true,"inputAttributes":[{"label":"autocomplete","value":"additional-name"}],"instructions":null,"instructionsPosition":null,"label":"Middle Name","labelPosition":null,"limit":false,"matchField":null,"max":null,"maxType":"characters","min":null,"minType":"characters","placeholder":null,"prePopulate":null,"required":false,"uniqueValue":false,"visibility":null},"type":"verbb\\formie\\fields\\subfields\\NameMiddle"},{"settings":{"conditions":null,"containerAttributes":null,"cssClasses":null,"defaultValue":null,"emailValue":null,"enableConditions":false,"enableContentEncryption":false,"enabled":true,"errorMessage":null,"handle":"lastName","includeInEmail":true,"inputAttributes":[{"label":"autocomplete","value":"family-name"}],"instructions":null,"instructionsPosition":null,"label":"Last Name","labelPosition":null,"limit":false,"matchField":null,"max":null,"maxType":"characters","min":null,"minType":"characters","placeholder":"e.g. Sherman","prePopulate":null,"required":true,"uniqueValue":false,"visibility":null},"type":"verbb\\formie\\fields\\subfields\\NameLast"}]}],"subFieldLabelPosition":null,"useMultipleFields":true,"visibility":null},"type":"verbb\\formie\\fields\\Name"}]},{"fields":[{"settings":{"conditions":null,"containerAttributes":null,"cssClasses":null,"defaultValue":null,"emailValue":null,"enableConditions":false,"enableContentEncryption":false,"enabled":true,"errorMessage":null,"handle":"emailAddress","includeInEmail":true,"inputAttributes":null,"instructions":"Please enter your email so we can get in touch.","instructionsPosition":null,"label":"Email Address","labelPosition":null,"matchField":null,"placeholder":"e.g. psherman@wallaby.com","prePopulate":null,"required":true,"uniqueValue":false,"validateDomain":false,"visibility":null},"type":"verbb\\formie\\fields\\Email"}]},{"fields":[{"settings":{"conditions":null,"containerAttributes":null,"cssClasses":null,"defaultValue":null,"emailValue":null,"enableConditions":false,"enableContentEncryption":false,"enabled":true,"errorMessage":null,"handle":"message","includeInEmail":true,"inputAttributes":null,"instructions":"Please enter your comments.","instructionsPosition":null,"label":"Message","labelPosition":null,"limit":false,"matchField":null,"max":null,"maxType":"characters","min":null,"minType":"characters","placeholder":"e.g. The reason for my enquiry is...","prePopulate":null,"required":true,"richTextButtons":["bold","italic"],"uniqueValue":false,"useRichText":false,"visibility":null},"type":"verbb\\formie\\fields\\MultiLineText"}]}],"settings":{"backButtonLabel":"Back","buttonsPosition":"left","containerAttributes":null,"cssClasses":null,"enableJsEvents":false,"enableNextButtonConditions":false,"enablePageConditions":false,"inputAttributes":null,"saveButtonLabel":"Save","saveButtonStyle":"link","showBackButton":false,"showSaveButton":false,"submitButtonLabel":"Contact us"}}],"settings":{"collectIp":false,"collectUser":false,"dataRetention":null,"dataRetentionValue":null,"defaultEmailTemplateId":null,"defaultInstructionsPosition":"verbb\\formie\\positions\\AboveInput","defaultLabelPosition":"verbb\\formie\\positions\\AboveInput","disableCaptchas":false,"displayCurrentPageTitle":false,"displayFormTitle":false,"displayPageProgress":false,"displayPageTabs":false,"errorMessage":"[{\"type\":\"paragraph\",\"attrs\":{\"textAlign\":\"start\"},\"content\":[{\"type\":\"text\",\"text\":\"Couldn’t save submission due to errors.\"}]}]","errorMessagePosition":"top-form","fileUploadsAction":null,"limitSubmissions":false,"limitSubmissionsMessage":"[{\"type\":\"paragraph\",\"attrs\":{\"textAlign\":\"start\"}}]","limitSubmissionsNumber":null,"limitSubmissionsType":"total","loadingIndicator":"spinner","loadingIndicatorText":null,"pageRedirectUrl":null,"progressPosition":"end","redirectUrl":null,"requireUser":false,"requireUserMessage":"[{\"type\":\"paragraph\",\"attrs\":{\"textAlign\":\"start\"}}]","requiredIndicator":"asterisk","scheduleForm":false,"scheduleFormEnd":null,"scheduleFormExpiredMessage":"[{\"type\":\"paragraph\",\"attrs\":{\"textAlign\":\"start\"}}]","scheduleFormPendingMessage":"[{\"type\":\"paragraph\",\"attrs\":{\"textAlign\":\"start\"}}]","scheduleFormStart":null,"scrollToTop":true,"submissionTitleFormat":"{timestamp}","submitAction":"message","submitActionFormHide":false,"submitActionMessage":"[{\"type\":\"paragraph\",\"attrs\":{\"textAlign\":\"start\"},\"content\":[{\"type\":\"text\",\"text\":\"Thank you for contacting us! Our team will get in touch shortly to follow up on your message.\"}]}]","submitActionMessagePosition":"top-form","submitActionMessageTimeout":null,"submitActionTab":null,"submitActionUrl":null,"submitMethod":"ajax","validationOnFocus":true,"validationOnSubmit":true},"userDeletedAction":"retain"}
afairhurst commented 1 month ago

Thank you. I'll update with the next release

afairhurst commented 1 month ago

Also, not sure if it's connected, however when I try to save Settings, I get an error Alert popup — "Couldn’t save settings."

I'm using the default config/formie.php

engram-design commented 1 month ago

Is that after you've grabbed the latest changes and uninstalled/reinstalled? And is that when saving the form, or the stencil?

Have a look in your /storage/logs/formie.log for more detail on the error.

engram-design commented 1 month ago

Updated in 3.0.0-beta.10