silverstripe-asset-admin
silverstripe-asset-admin copied to clipboard
STATE: Files embedded in TinyMCE remain marked as draft after Page is published
When using TinyMCE to embed a file, selecting a draft asset from the store modal works as intended. However after publishing the page the asset in the store modal is still represented as being in draft (false information).
- Open a page with a TinyMCE field (e.g. Page) for editing in the CMS
- Click the "Insert Media" button on the TinyMCE toolbar
- Upload a new image and select it
- Publish the page
- Repeat step 2
- 👀 Observe that the file uploaded in step 3 is still represented in draft mode
Strongly related to https://github.com/silverstripe/silverstripe-asset-admin/issues/782 However from a different view.
We have the same issue in SS4.4.2 where it seems that some images inserted into HTMLTextFields are getting saved but not published so when users refresh the CMS or try to view the content in the front end the images don't appear. If i view the HTML via phpMYAdmin I can see the ID of the image inside the tag and then find it and publish it which fixes the problem but obviously isn't easy to explain to CMS users.
I've temporarily solved this by building a BuildTask that finds all unpublished images and calls publishSingle() on them and running that whenever a user complains of missing images which is obviously nowhere near ideal.
FYI, I've just closed #782 as I couldn't recreate it in 1.4.x-dev
. I could however still recreate this issue.
When navigating to the Files area and uploading a file, it appears to first trigger a refresh of the Files app (perhaps why #782 is fixed). That same refresh doesn't appear to happen when you upload a file after accessing the area through the "Insert Media" button on the TinyMCE toolbar.
There's a gif in #782 for more detail.
Related https://github.com/silverstripe/silverstripe-asset-admin/issues/960
Related https://github.com/silverstripe/silverstripe-asset-admin/issues/543
Related https://github.com/silverstripe/silverstripe-asset-admin/issues/1315