removing file in bubble editor does update correctly

removing file in bubble editor does update correctly

BalubaerBalubaer Posts: 16Questions: 2Answers: 0

Hi Allen,

I've a thing you might not have tested, yet, so far and it's maybe also a bit specific.

I've a setup of a table incl. a file upload (using type "uploadMany"), all with server-side processing.
The problem I face now is that I use the bubble editor for quick editing of the files column where adding new files (and pressing "update") works as expected.

But when I remove a file from the bubble editor window and press "update" the file is not removed. I checked, what content is send to the server and it seems that no data related to that files column is send to the server then.

Calling the "normal" editor (by marking the row and call editor.edit(...)) and removing a file from the list and press "update" the file will be removed (from DB).

Can you do a check of this please?

Thanks.

Greetings,
Dennis

P.S. Unfortunately I cannot make the project public because of internal use but if you tell me what info you need I'll post it of course.

P.P.S. Although the project uses a bit of an older version of the editor at the moment I tested it also with the current release 1.7.4 facing the same problem.

Replies

  • allanallan Posts: 61,697Questions: 1Answers: 10,102 Site admin

    Hi,

    Thanks for letting me know about this - you are absolutely correct. It isn't actually the upload that is in error here, but rather than checking to see if the value has changed. When in full form mode, by default, it will submit all parameters regardless of any changes. In bubble and inline modes will will only (again by default) submit if there are changes.

    The uploadMany stores information in an array and that array wasn't being cloned, so when deleting an image it would delete it from the original array and thus the check to see if there are any changes wouldn't see any!

    To fix, in the Editor.prototype._edit function you will find:

                    editData[ name ][ idSrc ] = val === null ?
                        '' :
                        val;
    

    it should be:

                    editData[ name ][ idSrc ] = val === null ?
                        '' :
                        $.isArray(val) ?
                            val.slice() :
                            val;
    

    This has been committed and will be in the next release.

    Altneratively, use formOptions.bubble and set the submit option to all which will stop the check for changed data and just always submit the edit.

    Regards,
    Allan

This discussion has been closed.