0

I created a form on the frontend that allows users to upload their profile photos:

<form method="post" accept-charset="UTF-8" enctype="multipart/form-data">
    {{ csrfInput() }}
    <input type="hidden" name="action" value="users/save-user">
    <input type="hidden" name="redirect" value="users/{{ currentUser.username }}">
    <input type="hidden" name="userId" value="{{ currentUser.id }}">

    <input type="file" name="photo">
    <input type="submit" value="upload">
</form>

But I get the following error:

Serialization of 'Closure' is not allowed from /Users/rain/dev/valet/tr3ndsideas/vendor/yiisoft/yii2-queue/src/serializers/PhpSerializer.php

Any ideas on how to fix this problem?

  • Are you on the latest version of Craft 3? There was a similar bug fixed in RC14 around entries and entry types: github.com/craftcms/cms/blob/develop/CHANGELOG-v3.md#fixed-2 Can you enable devMode and share the full stack trace leading up to the error? – Brad Bell Mar 15 '18 at 19:11
  • @BradBell devMode is enabled, but where is the tracing file? Sorry, a noob I'm and totally new to craft... – yu xia Mar 16 '18 at 2:40
1

I found the problem which is because of a plugin called "Scout". I just update it and everything seems to be fine now.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.