verbb / formie

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

[5.x] Cannot submit form with file upload fields #1846

Closed manibae closed 1 month ago

manibae commented 2 months ago

Describe the bug

I have a form with file upload type fields, and when submitting the form, it shows errors below.

When I remove the file upload types fields from the form, then the form submits okay.

Steps to reproduce

  1. Create a form with file upload field
  2. Try to submit the form
  3. Remove the file upload field from the form
  4. The form submits okay

Form settings

Craft CMS version

5.0.2

Plugin version

dev-craft-5 as 3.0.0-beta.5

Multi-site?

No

Additional context

No response

engram-design commented 2 months ago

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

manibae commented 2 months ago

Hi, Just tested it locally and still getting the same error. I've changed the file upload field optional, then tested without a file attachment, then the form submitted okay. However, when I attach a file to the field, then it shows the same error. Thanks.

engram-design commented 2 months ago

Interesting. Is there any Group or Repeater combination going on here? I certainly can't replicate any errors on my end. Could you maybe send through the full stack trace of the error with Page Reload enabled and devMode enabled?

manibae commented 2 months ago

The form has name (first name, last name), email, single line text, multiline text, checkbox and one hidden field with two file upload fields. Below is the error on Page Reload.

PHP Warning – yii\base\ErrorException
Array to string conversion
1. in /var/www/html/vendor/yiisoft/yii2/db/ColumnSchema.phpat line 168
159160161162163164165166167168169170171172173174175176177                ) {
                    // https://github.com/yiisoft/yii2/issues/14663
                    return $value;
                }

                if (PHP_VERSION_ID >= 80100 && is_object($value) && $value instanceof \BackedEnum) {
                    return (string) $value->value;
                }

                return (string) $value;
            case 'integer':
                if (PHP_VERSION_ID >= 80100 && is_object($value) && $value instanceof \BackedEnum) {
                    return (int) $value->value;
                }
                return (int) $value;
            case 'boolean':
                // treating a 0 bit value as false too
                // https://github.com/yiisoft/yii2/issues/9006
                return (bool) $value && $value !== "\0";
2. in /var/www/html/vendor/craftcms/cms/src/web/ErrorHandler.php at line 79– yii\base\ErrorHandler::handleError(2, 'Array to string conversion', '/var/www/html/vendor/yiisoft/yii...', 168)
73747576777879808182838485    {
        // Because: https://bugs.php.net/bug.php?id=74980
        if (str_contains($message, 'Narrowing occurred during type inference. Please file a bug report')) {
            return true;
        }

        return parent::handleError($code, $message, $file, $line);
    }

    /**
     * @inheritdoc
     */
    public function getExceptionName($exception): ?string
3. in /var/www/html/vendor/yiisoft/yii2/db/ColumnSchema.php at line 168– craft\web\ErrorHandler::handleError(2, 'Array to string conversion', '/var/www/html/vendor/yiisoft/yii...', 168)
4. in /var/www/html/vendor/craftcms/cms/src/db/mysql/ColumnSchema.php at line 36– yii\db\ColumnSchema::typecast(['e7ac508a-2b73-4648-9c3e-304770ad9997' => 'Welfare rights adviser and triag...', '5b53cf76-0c0b-4442-bb81-54d2f4a3c944' => ['5476b779-3ac8-4665-961e-b2b1c56f9adc' => 'Mani', '9545e59e-728e-4b04-a4d1-26feb124afad' => 'Bae'], '99fd2c7e-5073-445c-a0fa-ea469c663964' => 'mani.bae@williamjoseph.co.uk', '8c05d538-5239-43d0-96b8-be76ac26fcd5' => 'Internet', ...])
303132333435363738                Schema::TYPE_LONGTEXT,
            ], true)
        ) {
            return '';
        }

        return parent::typecast($value);
    }
}
5. in /var/www/html/vendor/yiisoft/yii2/db/mysql/ColumnSchema.php at line 49– craft\db\mysql\ColumnSchema::typecast(['e7ac508a-2b73-4648-9c3e-304770ad9997' => 'Welfare rights adviser and triag...', '5b53cf76-0c0b-4442-bb81-54d2f4a3c944' => ['5476b779-3ac8-4665-961e-b2b1c56f9adc' => 'Mani', '9545e59e-728e-4b04-a4d1-26feb124afad' => 'Bae'], '99fd2c7e-5073-445c-a0fa-ea469c663964' => 'mani.bae@williamjoseph.co.uk', '8c05d538-5239-43d0-96b8-be76ac26fcd5' => 'Internet', ...])
6. in /var/www/html/vendor/yiisoft/yii2/db/QueryBuilder.php at line 652– yii\db\mysql\ColumnSchema::dbTypecast(['e7ac508a-2b73-4648-9c3e-304770ad9997' => 'Welfare rights adviser and triag...', '5b53cf76-0c0b-4442-bb81-54d2f4a3c944' => ['5476b779-3ac8-4665-961e-b2b1c56f9adc' => 'Mani', '9545e59e-728e-4b04-a4d1-26feb124afad' => 'Bae'], '99fd2c7e-5073-445c-a0fa-ea469c663964' => 'mani.bae@williamjoseph.co.uk', '8c05d538-5239-43d0-96b8-be76ac26fcd5' => 'Internet', ...])
7. in /var/www/html/vendor/yiisoft/yii2/db/QueryBuilder.php at line 630– yii\db\QueryBuilder::prepareUpdateSets('{{%formie_submissions}}', ['content' => ['e7ac508a-2b73-4648-9c3e-304770ad9997' => 'Welfare rights adviser and triag...', '5b53cf76-0c0b-4442-bb81-54d2f4a3c944' => ['5476b779-3ac8-4665-961e-b2b1c56f9adc' => 'Mani', '9545e59e-728e-4b04-a4d1-26feb124afad' => 'Bae'], '99fd2c7e-5073-445c-a0fa-ea469c663964' => 'mani.bae@williamjoseph.co.uk', '8c05d538-5239-43d0-96b8-be76ac26fcd5' => 'Internet', ...], 'dateUpdated' => '2024-04-26 15:42:40'], [])
8. in /var/www/html/vendor/yiisoft/yii2/db/Command.php at line 591– yii\db\QueryBuilder::update('{{%formie_submissions}}', ['content' => ['e7ac508a-2b73-4648-9c3e-304770ad9997' => 'Welfare rights adviser and triag...', '5b53cf76-0c0b-4442-bb81-54d2f4a3c944' => ['5476b779-3ac8-4665-961e-b2b1c56f9adc' => 'Mani', '9545e59e-728e-4b04-a4d1-26feb124afad' => 'Bae'], '99fd2c7e-5073-445c-a0fa-ea469c663964' => 'mani.bae@williamjoseph.co.uk', '8c05d538-5239-43d0-96b8-be76ac26fcd5' => 'Internet', ...], 'dateUpdated' => '2024-04-26 15:42:40'], ['id' => 5307], [])
9. in /var/www/html/vendor/craftcms/cms/src/db/Command.php at line 152– yii\db\Command::update('{{%formie_submissions}}', ['content' => ['e7ac508a-2b73-4648-9c3e-304770ad9997' => 'Welfare rights adviser and triag...', '5b53cf76-0c0b-4442-bb81-54d2f4a3c944' => ['5476b779-3ac8-4665-961e-b2b1c56f9adc' => 'Mani', '9545e59e-728e-4b04-a4d1-26feb124afad' => 'Bae'], '99fd2c7e-5073-445c-a0fa-ea469c663964' => 'mani.bae@williamjoseph.co.uk', '8c05d538-5239-43d0-96b8-be76ac26fcd5' => 'Internet', ...], 'dateUpdated' => '2024-04-26 15:42:40'], ['id' => 5307], [])
146147148149150151152153154155156157158    public function update($table, $columns, $condition = '', $params = [], bool $updateTimestamp = true): Command
    {
        if (!isset($columns['dateUpdated']) && $this->_updateTimestamp($updateTimestamp, $table)) {
            $columns['dateUpdated'] = Db::prepareDateForDb(new DateTime());
        }

        return parent::update($table, $columns, $condition, $params);
    }

    /**
     * Returns whether a table’s `dateUpdated` column should be updated.
     *
     * @param bool $updateTimestamp
10. in /var/www/html/vendor/craftcms/cms/src/helpers/Db.php at line 1066– craft\db\Command::update('{{%formie_submissions}}', ['content' => ['e7ac508a-2b73-4648-9c3e-304770ad9997' => 'Welfare rights adviser and triag...', '5b53cf76-0c0b-4442-bb81-54d2f4a3c944' => ['5476b779-3ac8-4665-961e-b2b1c56f9adc' => 'Mani', '9545e59e-728e-4b04-a4d1-26feb124afad' => 'Bae'], '99fd2c7e-5073-445c-a0fa-ea469c663964' => 'mani.bae@williamjoseph.co.uk', '8c05d538-5239-43d0-96b8-be76ac26fcd5' => 'Internet', ...], 'dateUpdated' => '2024-04-26 15:42:40'], ['id' => 5307], [], ...)
1060106110621063106410651066106710681069107010711072    ): int {
        if ($db === null) {
            $db = self::db();
        }

        return $db->createCommand()
            ->update($table, $columns, $condition, $params, $updateTimestamp)
            ->execute();
    }

    /**
     * Creates and executes an SQL statement for replacing some text with other text in a given table column.
     *
11. in /var/www/html/vendor/verbb/formie/src/fields/FileUpload.php at line 643– craft\helpers\Db::update('{{%formie_submissions}}', ['content' => ['e7ac508a-2b73-4648-9c3e-304770ad9997' => 'Welfare rights adviser and triag...', '5b53cf76-0c0b-4442-bb81-54d2f4a3c944' => ['5476b779-3ac8-4665-961e-b2b1c56f9adc' => 'Mani', '9545e59e-728e-4b04-a4d1-26feb124afad' => 'Bae'], '99fd2c7e-5073-445c-a0fa-ea469c663964' => 'mani.bae@williamjoseph.co.uk', '8c05d538-5239-43d0-96b8-be76ac26fcd5' => 'Internet', ...]], ['id' => 5307])
637638639640641642643644645646647648649                }
            }

            // We now need to update the submission with the IDs of asset for this field, so do a direct query
            // because this is triggered after the element has been saved, and we don't want to end up in a loop.
            // The easiest method is to just re-serialize all field values and save the content as a whole
            Db::update(Table::FORMIE_SUBMISSIONS, ['content' => $element->serializeFieldValues()], ['id' => $element->id]);
        }
    }

    public function getContentGqlMutationArgument(): Type|array|null
    {
        return FileUploadInputType::getType($this);
12. in /var/www/html/vendor/verbb/formie/src/fields/FileUpload.php at line 498– verbb\formie\fields\FileUpload::_processAssets(verbb\formie\elements\Submission)
492493494495496497498499500501502503504        return true;
    }

    public function afterElementSave(ElementInterface $element, bool $isNew): void
    {
        // Process any uploads and turn into assets
        $this->_processAssets($element);

        $elementService = Craft::$app->getElements();

        // Were any assets marked as to be deleted?
        if ($this->_assetsToDelete) {
            $assets = Asset::find()->id($this->_assetsToDelete)->all();
13. in /var/www/html/vendor/craftcms/cms/src/base/Element.php at line 5690– verbb\formie\fields\FileUpload::afterElementSave(verbb\formie\elements\Submission, true)
5684568556865687568856895690569156925693569456955696     * @inheritdoc
     */
    public function afterSave(bool $isNew): void
    {
        // Tell the fields about it
        foreach ($this->fieldLayoutFields() as $field) {
            $field->afterElementSave($this, $isNew);
        }

        // Trigger an 'afterSave' event
        if ($this->hasEventHandlers(self::EVENT_AFTER_SAVE)) {
            $this->trigger(self::EVENT_AFTER_SAVE, new ModelEvent([
                'isNew' => $isNew,
14. in /var/www/html/vendor/verbb/formie/src/elements/Submission.php at line 1146– craft\base\Element::afterSave(true)
1140114111421143114411451146114711481149115011511152                        Formie::$plugin->getSubmissions()->sendNotification($notification, $this);
                    }
                }
            }
        }

        parent::afterSave($isNew);
    }

    public function beforeDelete(): bool
    {
        $form = $this->getForm();

15. in /var/www/html/vendor/craftcms/cms/src/services/Elements.php at line 3673– verbb\formie\elements\Submission::afterSave(true)
3667366836693670367136723673367436753676367736783679                if ($trackChanges) {
                    array_push($dirtyAttributes, ...$element->getDirtyAttributes());
                    $element->setDirtyAttributes($dirtyAttributes, false);
                }

                // It is now officially saved
                $element->afterSave($isNewElement);

                // Update the list of dirty attributes
                $dirtyAttributes = $element->getDirtyAttributes();

                // Update the element across the other sites?
                if ($propagate) {
16. in /var/www/html/vendor/craftcms/cms/src/services/Elements.php at line 1169– craft\services\Elements::craft\services\{closure}()
1163116411651166116711681169117011711172117311741175    {
        if (empty($this->bulkKeys)) {
            $bulkKey = $this->beginBulkOp();
        }

        try {
            $callback();
        } finally {
            if (isset($bulkKey)) {
                $this->endBulkOp($bulkKey);
            }
        }
    }
17. in /var/www/html/vendor/craftcms/cms/src/services/Elements.php at line 3489– craft\services\Elements::ensureBulkOp(Closure)
3483348434853486348734883489349034913492349334943495                $element->firstSave = $originalFirstSave;
                $element->propagateAll = $originalPropagateAll;
                return false;
            }
        }

        $this->ensureBulkOp(function() use (
            $element,
            $isNewElement,
            $originalFirstSave,
            $originalPropagateAll,
            $forceTouch,
            $saveContent,
18. in /var/www/html/vendor/craftcms/cms/src/services/Elements.php at line 1250– craft\services\Elements::_saveElementInternal(verbb\formie\elements\Submission, false, false, null, ...)
1244124512461247124812491250125112521253125412551256        $propagate = !$element->id || $propagate;

        // Not currently being duplicated
        $duplicateOf = $element->duplicateOf;
        $element->duplicateOf = null;

        $success = $this->_saveElementInternal(
            $element,
            $runValidation,
            $propagate,
            $updateSearchIndex,
            forceTouch: $forceTouch,
            crossSiteValidate: $crossSiteValidate,
19. in /var/www/html/vendor/verbb/formie/src/controllers/SubmissionsController.php at line 572– craft\services\Elements::saveElement(verbb\formie\elements\Submission, false)
566567568569570571572573574575576577578        }

        // Check events right before our saving
        Formie::$plugin->getSubmissions()->onBeforeSubmission($submission, $submitAction);

        // Save the submission
        $success = Craft::$app->getElements()->saveElement($submission, false);

        // Set the custom title - only if set to save parsing, and after the submission is saved,
        // so we have access to not only field variables, but submission attributes
        if (trim($form->settings->submissionTitleFormat)) {
            $submission->updateTitle($form);
        }
20. verbb\formie\controllers\SubmissionsController::actionSubmit()
21. in /var/www/html/vendor/yiisoft/yii2/base/InlineAction.php at line 57– call_user_func_array([verbb\formie\controllers\SubmissionsController, 'actionSubmit'], [])
22. in /var/www/html/vendor/yiisoft/yii2/base/Controller.php at line 178– yii\base\InlineAction::runWithParams(['job-title' => 'Welfare rights adviser and triag...'])
23. in /var/www/html/vendor/yiisoft/yii2/base/Module.php at line 552– yii\base\Controller::runAction('submit', ['job-title' => 'Welfare rights adviser and triag...'])
24. in /var/www/html/vendor/craftcms/cms/src/web/Application.php at line 349– yii\base\Module::runAction('formie/submissions/submit', ['job-title' => 'Welfare rights adviser and triag...'])
343344345346347348349350351352353354355     * @param string $route
     * @param array $params
     * @return BaseResponse|null The result of the action, normalized into a Response object
     */
    public function runAction($route, $params = []): ?BaseResponse
    {
        $result = parent::runAction($route, $params);

        if ($result === null || $result instanceof BaseResponse) {
            return $result;
        }

        $response = $this->getResponse();
25. in /var/www/html/vendor/craftcms/cms/src/web/Application.php at line 650– craft\web\Application::runAction('formie/submissions/submit', ['job-title' => 'Welfare rights adviser and triag...'])
644645646647648649650651652653654655656        if ($request->getIsActionRequest()) {
            $route = implode('/', $request->getActionSegments());

            try {
                Craft::debug("Route requested: '$route'", __METHOD__);
                $this->requestedRoute = $route;
                return $this->runAction($route, $_GET);
            } catch (Throwable $e) {
                $this->_unregisterDebugModule();
                if ($e instanceof InvalidRouteException) {
                    throw new NotFoundHttpException(Craft::t('yii', 'Page not found.'), $e->getCode(), $e);
                }
                throw $e;
26. in /var/www/html/vendor/craftcms/cms/src/web/Application.php at line 311– craft\web\Application::_processActionRequest(craft\web\Request)
305306307308309310311312313314315316317                    }
                }
            }
        }

        // If this is an action request, call the controller
        if (($response = $this->_processActionRequest($request)) !== null) {
            return $response;
        }

        // If we’re still here, finally let Yii do its thing.
        try {
            return parent::handleRequest($request);
27. in /var/www/html/vendor/yiisoft/yii2/base/Application.php at line 384– craft\web\Application::handleRequest(craft\web\Request)
28. in /var/www/html/web/index.php at line 12– yii\base\Application::run()
6789101112// Load shared bootstrap
require dirname(__DIR__) . '/bootstrap.php';

// Load and run Craft
/** @var craft\web\Application $app */
$app = require CRAFT_VENDOR_PATH . '/craftcms/cms/bootstrap/web.php';
$app->run();
$_GET = [
    'job-title' => 'Welfare rights adviser and triage officer',
];

$_POST = [
    'CRAFT_CSRF_TOKEN' => 'EibrM-bRFtufgGP-YJ9US5YCbm_WsJMWVLDh-bPLzJ6tWRaJOcWeano6wMxk9bbS9dA8XlSJr5LqTBg3cl2KkGHU4TGH1n_16EnqRnPx-ANDOQawl5PEI3mE082O36Yojnf7T0uz5IIKY2M8TtL_BKCsP866pvlyUwjF1Y-DlzQMxuit2V0ao0V0e1t62Q02VmYsekKRRICAYbmy81KKFecdGvlALQCn_sFSAPqXj8H5otOULFLLCav_DgYMofsCx9Dqx-ZYPGHtmqPafS4OR2XupQCw2Abl50bC232MdkqXzzpyWDHVp_amGk_h5v-87pMau0afLn_Q1eFoCwdGObSuc8KBTP_O04E7AmeHluDy2WZIkqLbry8ozQhNDh846WNXMhoa',
    'action' => 'formie/submissions/submit',
    'submitAction' => 'submit',
    'handle' => 'jobApplication',
    'siteId' => '1',
    'redirect' => '155ada39a402ae3ec10075cb84cfd621e87fe9e5cb16404571bc4f0d3cdadddb/job-application/form-submitted?job-title=Welfare+rights+adviser+and+triage+officer',
    'fields' => [
        'jobTitle' => 'Welfare rights adviser and triage officer',
        'yourDetails' => [
            'firstName' => 'Mani',
            'lastName' => 'Bae',
        ],
        'emailAddress' => 'mani.bae@williamjoseph.co.uk',
        'howDidYouFirstHearAboutThisRole' => 'Internet',
        'doYouHaveTheRightToWorkInTheUk' => [
            'I confirm I have the right to work in the UK',
        ],
    ],
];

$_FILES = [
    'fields' => [
        'name' => [
            'uploadYourCv' => [
                'Lighthouse Report - Health Play Services Hub - desktop.pdf',
            ],
            'uploadACoverLetter' => [
                'Lighthouse Report - Health Play Services Hub - mobile.pdf',
            ],
        ],
        'full_path' => [
            'uploadYourCv' => [
                'Lighthouse Report - Health Play Services Hub - desktop.pdf',
            ],
            'uploadACoverLetter' => [
                'Lighthouse Report - Health Play Services Hub - mobile.pdf',
            ],
        ],
        'type' => [
            'uploadYourCv' => [
                'application/pdf',
            ],
            'uploadACoverLetter' => [
                'application/pdf',
            ],
        ],
        'tmp_name' => [
            'uploadYourCv' => [
                '/tmp/php5s5hCL',
            ],
            'uploadACoverLetter' => [
                '/tmp/phpUnpugK',
            ],
        ],
        'error' => [
            'uploadYourCv' => [
                0,
            ],
            'uploadACoverLetter' => [
                0,
            ],
        ],
        'size' => [
            'uploadYourCv' => [
                300916,
            ],
            'uploadACoverLetter' => [
                327132,
            ],
        ],
    ],
];

$_COOKIE = [
    '1031b8c41dfff97a311a7ac99863bdc5_username' => 'f71a5e4aa0b4ed976440d8a01e2bf1f883d033e4c40305b5fcb1815782f9da0ea:2:{i:0;s:41:"1031b8c41dfff97a311a7ac99863bdc5_username";i:1;s:7:"wj-mani";}',
    '__stripe_mid' => '7df6303a-866b-494f-88be-fa42bbadc53d419a71',
    '_ga_QB035CD2B7' => 'GS1.1.1708689611.1.1.1708689673.0.0.0',
    '_fbp' => 'fb.1.1708939605110.362085744',
    '_ga_E9T35KEGD7' => 'GS1.1.1708939604.1.1.1708942047.60.0.0',
    '46d5d7ecd25d1fc1dfcc6d83726ba6ce_username' => 'be773584288a458921d5a1405cdcd4762cbaf1fc649c379b91d7b5fb4cc27395a:2:{i:0;s:41:"46d5d7ecd25d1fc1dfcc6d83726ba6ce_username";i:1;s:7:"wj-mani";}',
    '_ga_1BBZDSTZBV' => 'GS1.1.1711018778.1.0.1711018793.0.0.0',
    '_ga_18RYZEXVGC' => 'GS1.1.1712135207.5.0.1712135218.49.0.0',
    '_ga_8K571ZQZ7B' => 'GS1.1.1712218110.2.1.1712220214.0.0.1193958722',
    'Craft-976ac7d6-272f-4a66-919c-d43d5ceeba11:sidebar' => 'expanded',
    '_hjSessionUser_1932475' => 'eyJpZCI6ImNkOGJiMGM1LWIxMTAtNWNkNS04M2U0LWViMWE2OWE2M2UwNiIsImNyZWF0ZWQiOjE3MTM3NzMyOTA2MjIsImV4aXN0aW5nIjp0cnVlfQ==',
    '_ga_HE1JCDXGCN' => 'GS1.1.1713773290.1.1.1713778160.60.0.0',
    '_ga' => 'GA1.1.506245841.1708688338',
    '_gcl_au' => '1.1.1037904314.1708689612.806934456.1713780340.1713780340',
    '_hjSessionUser_2517477' => 'eyJpZCI6IjhmN2FhYjlkLWQ2MzAtNWVlNi1iYjQ1LTAzODExNGEzZGRjNyIsImNyZWF0ZWQiOjE3MTQwMzI0MjMxMjgsImV4aXN0aW5nIjp0cnVlfQ==',
    '_ga_STVPWHCK3S' => 'GS1.1.1714032422.1.0.1714032427.0.0.0',
    '_ga_JDHF1MTESF' => 'GS1.1.1714144655.13.1.1714145153.60.0.0',
    'CraftSessionId' => '9b8ddccdef4a43155e9ac8473794d31e',
    '46d5d7ecd25d1fc1dfcc6d83726ba6ce_identity' => 'e6ac9b8b852c4cde2a0344b0b3d6ff98e17f6293b988104d032a9850358129c4a:2:{i:0;s:41:"46d5d7ecd25d1fc1dfcc6d83726ba6ce_identity";i:1;s:159:"[6,"[\\"Yo3aoIiCgXQmYkN6REHYTjptz9WwkcmzyNx6oBuf-P05YEj9TzS4nsE6MUDvF-QP_6kNNBgAAVOmZbSsh6HH1YbDdMMcFH_nLDHX\\",null,\\"7f43958fcd8b0148374f10f8a0c96f26\\"]",3600]";}',
    'CRAFT_CSRF_TOKEN' => 'a7506f4af35bfdb6211969263e3ab1b91db8882a6c13ba0e40d099da36dda4efa:2:{i:0;s:16:"CRAFT_CSRF_TOKEN";i:1;s:147:"hdzwfQwb-s1tuxIQoBCoqNRDTJvvr2nM9uDB0nad|6a7f2f826db5d51016958d5ad97b19734f09f791a7e0eb96e52215251da4c1cbhdzwfQwb-s1tuxIQoBCoqNRDTJvvr2nM9uDB0nad|6";}',
];

$_SESSION = [
    'e193e6e3b6f599e2e7fcbcf3b01abf8e__flash' => [],
    '46d5d7ecd25d1fc1dfcc6d83726ba6ce__token' => 'Yo3aoIiCgXQmYkN6REHYTjptz9WwkcmzyNx6oBuf-P05YEj9TzS4nsE6MUDvF-QP_6kNNBgAAVOmZbSsh6HH1YbDdMMcFH_nLDHX',
    '46d5d7ecd25d1fc1dfcc6d83726ba6ce__id' => 6,
    '__authKey' => '["Yo3aoIiCgXQmYkN6REHYTjptz9WwkcmzyNx6oBuf-P05YEj9TzS4nsE6MUDvF-QP_6kNNBgAAVOmZbSsh6HH1YbDdMMcFH_nLDHX",null,"7f43958fcd8b0148374f10f8a0c96f26"]',
    '46d5d7ecd25d1fc1dfcc6d83726ba6ce__expire' => 1714149759,
    '__duration' => 3600,
    '__elevated_timeout' => 1714146159,
    'formie:5128:snapshot' => [
        'form' => [
            'redirectUrl' => '/job-application/form-submitted?job-title=Welfare rights adviser and triage officer',
        ],
    ],
    'e193e6e3b6f599e2e7fcbcf3b01abf8e__auth_access' => [
        'seomaticPreviewAuthorizationKey5139',
        'previewElement:5139',
        'saveAssets:e31218a7-12e3-4433-869c-51334d404ced',
    ],
];
engram-design commented 2 months ago

Thanks for that. Can I also ask what database engine and version you're using?

manibae commented 2 months ago

Hi,

Thanks.

engram-design commented 2 months ago

Ah, I think that may have been the issue.

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

manibae commented 2 months ago

Ah, brilliant! That works. Thanks 👍

rickmerkelbach commented 2 months ago

Hi there, I seem to be having the same issue (running on MySQL 8.0). Using "dev-craft-5 as 3.0.0-beta.9" fixed the server-side issue for us, though the same error persists when using "Validate Form on Submit". When "Validate Form on Submit" is turned off it processes the submission without issue (though without client-side validation).

engram-design commented 2 months ago

@rickmerkelbach That's not something I can replicate. Is it the exact same error message as the original post? What does the Network request's preview show for it?

rickmerkelbach commented 2 months ago

After some more testing on a fresh Craft install it seems to be completely limited to the client-side validation of file inputs that have an amount or size limit. So whenever "Validate Form on Submit" is active and a file input has one or more limits on the size or amount of files, the client-side validation blocks the form from submitting (so no network requests or server-side errors).

engram-design commented 2 months ago

@rickmerkelbach Right, I think that's another unrelated issue with just the client-side validation when limiting uploads.

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

engram-design commented 1 month ago

Updated in 3.0.0-beta.10