kartik-v / yii2-builder

Build forms (single or tabular) easily for Yii Framework 2.0.
http://demos.krajee.com/builder
Other
100 stars 50 forks source link

TabularForm doesn't play well with INPUT_FILE #135

Closed skills-up closed 5 years ago

skills-up commented 6 years ago

Prerequisites

Steps to reproduce the issue

  1. Add a INPUT_FILE field type in a TabularForm widget, for related models.
  2. Open the form in browser.
  3. You will see a javascript error.

Expected behavior and actual behavior

When I follow those steps, I see...

Uncaught TypeError: self.previewCache.data.content.filter is not a function
    at Object.fetch (fileinput.js:608)
    at Object.count (fileinput.js:614)
    at FileInput._initPreview (fileinput.js:1171)
    at FileInput._init (fileinput.js:329)
    at new FileInput (fileinput.js:239)
    at HTMLInputElement.<anonymous> (fileinput.js:3417)
    at Function.each (jquery.js:365)
    at jQuery.fn.init.each (jquery.js:137)
    at jQuery.fn.init.$.fn.fileinput (fileinput.js:3405)
    at HTMLDocument.<anonymous> (update?client=ChrysCapital+VI.+LLC&traveller_name=Test+Traveller:1218)

I was expecting... The file input to work correctly. I think a part of the problem may be absence of enctype attribute for the tabular form (at least it is not documented anywhere if it is present).

Environment

PHP v5.6.28 on Mac OS X 10.12 using MAMP server

Browsers

Operating System

Libraries

Isolating the problem

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.