aldeed / meteor-cfs-autoform

Upload files using CollectionFS as part of AutoForm submission
MIT License
37 stars 32 forks source link

support for uploading multiple files in an array #20

Closed bastiaanterhorst closed 9 years ago

bastiaanterhorst commented 9 years ago

Hi, I'm running into some trouble trying to upload multiple files, and I'm pretty much stuck. And help would be greatly appreciated.

My schema looks like this:

  images: {
    type: [String]
    min: 1
  }

And in my form:

+autoForm collection="Works" doc=this type="insert" id="upsertWorkForm"
<!-- other fields -->
+afQuickField name='images' type='cfs-files' collection='images'

When I submit, I get the following error in the browser console:

 Exception in setTimeout callback: TypeError: Cannot read property 'split' of undefined
    at Object.Util.deepFind (http://localhost:3000/packages/cfs_autoform.js?ca0ee21422d608dd4c429aa4c230839a532b1cd9:289:16)
    at cb (http://localhost:3000/packages/cfs_autoform.js?ca0ee21422d608dd4c429aa4c230839a532b1cd9:168:28)
    at http://localhost:3000/packages/cfs_autoform.js?ca0ee21422d608dd4c429aa4c230839a532b1cd9:220:13
    at http://localhost:3000/packages/raix_eventemitter.js?2698ca3a2e678f77962ebe839ad04615958a4c26:122:16
    at Array.forEach (native)
    at Function._.each._.forEach (http://localhost:3000/packages/underscore.js?0a80a8623e1b40b5df5a05582f288ddd586eaa18:156:11)
    at _runCallbacks (http://localhost:3000/packages/raix_eventemitter.js?2698ca3a2e678f77962ebe839ad04615958a4c26:118:7)
    at EventEmitter.emit (http://localhost:3000/packages/raix_eventemitter.js?2698ca3a2e678f77962ebe839ad04615958a4c26:150:12)
    at oneChunkQueueEnded [as onEnded] (http://localhost:3000/packages/cfs_upload-http.js?cf37b2941c8cdbfd85cdc3948f57fed4bb429081:510:19)
    at PowerQueue.next (http://localhost:3000/packages/cfs_power-queue.js?255f444fbb9de891f6e803923430c0dc1fa40e4f:478:14)

Thanks for reading!

MichalW commented 9 years ago

I have this same trouble but different error on branch master:

Exception in setTimeout callback: TypeError: undefined is not a function
    at cb (http://localhost:3000/packages/cfs_autoform.js?92ec069087406a8d536c1ee5147784343469bf55:168:46)
    at http://localhost:3000/packages/cfs_autoform.js?92ec069087406a8d536c1ee5147784343469bf55:220:13
    at http://localhost:3000/packages/raix_eventemitter.js?2698ca3a2e678f77962ebe839ad04615958a4c26:122:16
    at Array.forEach (native)
    at Function._.each._.forEach (http://localhost:3000/packages/underscore.js?0a80a8623e1b40b5df5a05582f288ddd586eaa18:156:11)
    at _runCallbacks (http://localhost:3000/packages/raix_eventemitter.js?2698ca3a2e678f77962ebe839ad04615958a4c26:118:7)
    at EventEmitter.emit (http://localhost:3000/packages/raix_eventemitter.js?2698ca3a2e678f77962ebe839ad04615958a4c26:150:12)
    at oneChunkQueueEnded [as onEnded] (http://localhost:3000/packages/cfs_upload-http.js?cf37b2941c8cdbfd85cdc3948f57fed4bb429081:510:19)
    at PowerQueue.next (http://localhost:3000/packages/cfs_power-queue.js?255f444fbb9de891f6e803923430c0dc1fa40e4f:478:14)
    at http://localhost:3000/packages/cfs_power-queue.js?255f444fbb9de891f6e803923430c0dc1fa40e4f:572:12
aldeed commented 9 years ago

Should be fixed in 2.1.2 release.