Problem
When you create a new modal, after adding an image into a field "body" and save the modal. After that you will go to the database and do a select query of the table named "file_managed". Look for the image previously uploaded into the modal and verify the column "status" equal zero. This value 0 in the status causes that the image disappear after time.
Steps to reproduce
- Go to route "/admin/structure/modal"
- Click button "Add modal"
- Upload image in Body field
- Click button "Save"
Issue fork modal_page-3266023
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
danielsan18 commentedComment #3
renatog commentedHummmm interesting!
This status = 0 means that is a temporary file right?! And for this reason it'll be deleted in sometime.
It's a real bug, you're right
Comment #4
danielsan18 commentedI have created a fork and added a commit to fix the error. This commit reads the inline images from the body field and changes it's status = 1.
Comment #6
renatog commentedYour Merge Request is amazing! Thanks for your great job!
Jugestion:
I think we can move the methods "extractFilesUuid" and "recordFileUsage" to another Helper instead of keep those in "ModalForm" class. What do you think, is it makes sense?
Comment #7
danielsan18 commentedYes, it's possible. I am going to do the test and I'll send new commits.
Comment #8
renatog commentedAmazing! Thank you so much Daniel 😀👍
Comment #9
renatog commentedAmazing! Thank you so much for your help on that @danielsan18
It's a really good catch!
I tested and it's really working fine
Comment #11
renatog commentedMoved to the dev branch
Thank you so much for your contribution
Comment #12
renatog commented