meteor-cfs-autoform icon indicating copy to clipboard operation
meteor-cfs-autoform copied to clipboard

Update for deeply nested cfs-file's broken

Open petermikitsh opened this issue 9 years ago • 2 comments

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

petermikitsh avatar Jul 07 '15 19:07 petermikitsh

+1, Having files in objects in arrays is a must

ukk000 avatar Sep 15 '15 20:09 ukk000

Here too, when i add new nested item on update form:

Uncaught TypeError: Cannot read property '0' of undefined

livimonte avatar Dec 03 '15 04:12 livimonte