Closed kinglozzer closed 5 years ago
Migrated from https://github.com/silverstripe/silverstripe-cms/issues/2177. There’s a workaround available here https://github.com/silverstripe/silverstripe-cms/issues/2177#issuecomment-411688248
Hi @kinglozzer , thanks for opening this. It is happening consistently for me as well on any given SS4 project. This is a sample composer extract
"require":{
"php": ">=5.6.0",
"silverstripe/cms": "^4.2",
"silverstripe/framework": "^4.2",
"silverstripe/recipe-plugin": "*",
"silverstripe/recipe-cms": "*",
"silverstripe/versioned": "1.*",
"silverstripe/blog": "3.*",
"silverstripe/widgets": "2.*",
"silverstripe/userforms": "5.*",
"silverstripe/redirectedurls": "2.*",
"ryanpotter/silverstripe-cms-theme": "2.*",
"undefinedoffset/sortablegridfield": "2.*",
"silverstripe/staticpublishqueue": "4.*",
"silverware/validator": "1.*",
"unclecheese/display-logic": "2.*",
"sheadawson/silverstripe-linkable": "2.*",
"jonom/silverstripe-text-target-length": "2.*",
"jonom/focuspoint": "3.*",
"dnadesign/silverstripe-elemental": "3.0.x-dev",
"axllent/silverstripe-cms-tweaks": "2.*",
"heyday/silverstripe-menumanager": "~3.0.0",
"heyday/silverstripe-colorpalette": "2.*"
}
Unfortunately your proposed solution does not seem to fix the issue at all for me.
@eehondas It doesn't look like you have the s3 module installed. If you’re experiencing that issue without using the s3 module, can you please post here instead: https://github.com/silverstripe/silverstripe-framework/issues/8228? Thanks :)
@kinglozzer Yes. Done thank you. I just posted here because I followed from the other thread.
Is there any movement on this? This is holding up a client upgrade for us. Cheers.
Bump for great justice.
Hey @JoshuaCarter, sorry for the delay - there's not a lot of support for this module as I'm not actively using it in production, and it was only ever meant as a proof-of-concept to test the new SS4 filesystem layer (I'm not entirely sure of the reasons why it was picked up under the silverstripe
GitHub org :))
Anyway - have you been able to try the workaround that was posted by @kinglozzer here: https://github.com/silverstripe/silverstripe-cms/issues/2177#issuecomment-411688248? I'm keen to know if that still works for you or not, as it might help us assess where the problem lies.
I have a feeling it could be a race condition (TinyMCE file is written to S3 -> attempts to read immediately -> file can't be read -> file gets rewritten next request -> etc) but I haven't been able to confirm that as the cause yet. Theoretically the module shouldn't return an S3 URL unless the file was successfully replicated to S3 and exists in the S3 bucket (e.g. it should wait until the file is replicated within S3 before returning the URL) but perhaps we're missing something there.
@JoshuaCarter - I submitted a PR that has the workaround for this bug auto included (force tinymce files to write to the local filesystem). If you checkout the TinyMCEAdapter as well as the .yml file. If you implement that on your project you should have no issues.
Hey @JoshuaCarter, I've just merged this in, so using the latest dev-master
should resolve this for you now. Either @obj63mc or I will probably release a new version once #23 is merged.
From @obj63mc on May 29, 2018 21:32
Currently testing using v4.1.x and dev/master of silverstripe-s3.
I wasn't sure where the best place to log this issue but assuming it will probably need to be moved to a fix in silverstripe/framework as it is an issue with the HTMLEditorField, or possibly needs to go to the silverstripe-s3 repo.
Steps to reproduce
Create a clean install of SS4.x using the composer command -
Configure the site as normal and require silverstripe-s3
Complete configuration of S3
Go to your site/admin and login
Edit the Home Page- I get the following JS error -
Screen shot -
I notice though that in my network console it is trying to load the tinymce script from the amazon public directory, not the local server address - example :
vs /assets/tinymce/tinymce-cms-92563982d3.js?=1527628916905
Since this is loading the tinymce script file from S3 not sure if that is the cause of a race condition, cross domain origin issue or ?
If I refresh the page in the browser (eg /admin/pages/edit/show/1), the CMS loads normally and the WYSIWYG loads normally. If I go to a different section of the CMS besides pages though such as say 'Settings' and then back to pages I get the same issue until I reload the site.
Is this possibly an issue as the file is being generated into the /public/assets directory instead of the /public/resources directory? If there is a way to exclude this file from loading on S3 or a way to change the write path for the tinymce js I can test this some more to try and confirm what exactly is causing the issue.
Copied from original issue: silverstripe/silverstripe-cms#2177