You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The UploadField state depends on a md5 hash of files. This doesn't always work, in particular in the cms (model admin) when the ID stays the same between records (ex: Form_ItemEditForm_Image). The same id being used, navigating between the records AND saving (so this only happens in my cms-actions module where you can save & next lekoala/silverstripe-cms-actions#27) leads to files being displayed again on the next record.
This means that in the current state, even if you have a default state without files
data-state="{"name":"Images","id":"Form_ItemEditForm_Images","value":{"Files":[]},"message":null,"data":{"files":[]}}"
you will end up with files being displayed regardless.
i'm not sure relying a on hash of files is a proper solution for this:
The md5 solution isn't perfect - as the comment hints at and as discussion on the PR that introduced it points out (and as is discussed on at least one of the issues you linked to) there is a deeper redux puzzle here which needs to be resolved for assets. The correct solution here is to spend some time looking at how we use redux - which is not something the core team is likely to do in the near future.
I'll leave the issue open for now - the more issues related to this that get reported, the easier it will be to justify dedicating time to solving this overall problem.
Affected version : 4.* (tested in 4.12)
The UploadField state depends on a md5 hash of files. This doesn't always work, in particular in the cms (model admin) when the ID stays the same between records (ex: Form_ItemEditForm_Image). The same id being used, navigating between the records AND saving (so this only happens in my cms-actions module where you can save & next lekoala/silverstripe-cms-actions#27) leads to files being displayed again on the next record.
This means that in the current state, even if you have a default state without files
data-state="{"name":"Images","id":"Form_ItemEditForm_Images","value":{"Files":[]},"message":null,"data":{"files":[]}}"
you will end up with files being displayed regardless.
i'm not sure relying a on hash of files is a proper solution for this:
silverstripe-asset-admin/client/src/components/UploadField/UploadField.js
Lines 67 to 79 in 487e62c
Related:
#960
#543
#1001
My temporary fix: append a random suffix to the id, and therefore it gets a distinct state.
The text was updated successfully, but these errors were encountered: