mplodowski / formbuilder-plugin-public

https://octobercms.com/plugin/renatio-formbuilder
https://octobercms.com/plugin/renatio-formbuilder
2 stars 0 forks source link

File uploader field not work #9

Closed ibrain90 closed 2 years ago

ibrain90 commented 2 years ago

Describe the bug When I chose file for upload in console appear error

Uncaught TypeError: Cannot read properties of undefined (reading 'trim')
    at Dropzone.addedfile (7c669cc6892212012de8bb83b9c90938-1618552474:748:87)
    at Dropzone.emit (7c669cc6892212012de8bb83b9c90938-1618552474:84:20)
    at Dropzone.addFile (7c669cc6892212012de8bb83b9c90938-1618552474:1830:12)
    at HTMLInputElement.<anonymous> (7c669cc6892212012de8bb83b9c90938-1618552474:1246:24)

To Reproduce Steps to reproduce the behavior:

  1. Add field with "File uploader" type to form and fill: Name = 'file', Placeholder = 'Attach file'. Default value, CSS classes, Custom attributes, Help block is empty.
  2. Render form on page: {% component "contactForm" %}
  3. Open page with form
  4. Click on 'Attach file' button
  5. Select file and click on 'Open' button
  6. See error in console

Expected behavior No error in console and attach file

Screenshots

October version 2.1.25

Plugin version 2.1.6

Responsiv.Uploader plugin version 1.0.5

mplodowski commented 2 years ago

I tested default form, which has example of file upload field and it works for me.

I tested contact form and added upload field as you did and still it works for me. I aliased component with "contactForm" instead "renderForm" and still it works.

Check you layout file for following:

You have styles tag in the end of head section:

    {% styles %}
</head>

You have correct order of loading javascript files and have framework extras and scripts in the end of body tag:

    <!-- Your scripts -->

    {% framework extras %}
    {% scripts %}
</body>