-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Editor]: Fix cleanup attachments function #1023
Conversation
Affected libs:
|
📷 Screenshots are here! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! I wonder if the original mapping wasn't done against another version of GN? It's possible that the API response differs (e.g. with localized names) between 4.2.5 and 4.4.0 for instance.
Maybe having a test of this in an e2e test would make sure this works against all version; essentially we just need to test that once an image has been uploaded and the record saved the image still shows up correctly (i.e. it has not been cleaned up).
@jahow I think this e2e covers it already, and it passed with all versions on the CI 🙂 [](
|
OK so there's already an e2e test, but the test would not fail if the underlying image file ends up being deleted. Could you try and expand a bit the test to make sure that the url of the image does not end up in a 404? thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Description
This PR fixes a wrong behavior in the editor's form, where the cleanup attachment function deletes the newly added attachments (eg : if an image is added, then the record saved, and then reloaded, the new image would be deleted).
This was because of a mapping that was not working : the names of the saved attachments were supposed to match the names of the new attachments, and the mapping was not taking into account that the name object had language keys in it, thus returning "undefined" for all attachment's names.
Quality Assurance Checklist
breaking change
labelbackport <release branch>
label