Skip to content
This repository has been archived by the owner on Mar 25, 2020. It is now read-only.

Update for deeply nested cfs-file's broken #40

Open
petermikitsh opened this issue Jul 7, 2015 · 2 comments · May be fixed by #41
Open

Update for deeply nested cfs-file's broken #40

petermikitsh opened this issue Jul 7, 2015 · 2 comments · May be fixed by #41

Comments

@petermikitsh
Copy link

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
@macrozone macrozone linked a pull request Jul 23, 2015 that will close this issue
@ukk000
Copy link

ukk000 commented Sep 15, 2015

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

@livimonte
Copy link

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

Uncaught TypeError: Cannot read property '0' of undefined

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants