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

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

@petermikitsh

Description

@petermikitsh

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions