meteor-cfs-autoform
meteor-cfs-autoform copied to clipboard
Update for deeply nested cfs-file's broken
The experimental update image functionality seems to work, but only if the property is defined at the document root. Nested properties raise errors.
Example:
AutoForm declaration:
{{ #autoForm collection='MyCollection' doc=myDoc id='myForm' type='update' }}
{{ >afQuickField name="deeply.nested.imageId" type="cfs-file" collection='images' }}
<button type="submit" class="btn btn-primary">Update</button>
{{ /autoForm }}
It seems to be an issue with the deepDelete function called in cfs-autoforms-hooks.js:
Call Stack:
Uncaught TypeError: Cannot read property 'nested' of undefined
Util.deepDo @ cfs-autoform-util.js:26
Util.deepDelete @ cfs-autoform-util.js:5
(anonymous function) @ cfs-autoform-hooks.js:183
jQuery.extend.each @ jquery.js:384
jQuery.fn.jQuery.each @ jquery.js:136
Hooks.beforeUpdate @ cfs-autoform-hooks.js:165
runHook @ autoform-events.js:241
runBeforeHooks @ autoform-events.js:250
AutoForm.addFormType.onSubmit @ update.js:17
autoFormSubmitHandler @ autoform-events.js:326
+1, Having files in objects in arrays is a must
Here too, when i add new nested item on update form:
Uncaught TypeError: Cannot read property '0' of undefined