silverstripe / silverstripe-framework

Silverstripe Framework, the MVC framework that powers Silverstripe CMS
https://www.silverstripe.org
BSD 3-Clause "New" or "Revised" License
722 stars 822 forks source link

tinyMCE WYSIWYG editor not showing, JS error #8228

Closed anishpixel closed 6 months ago

anishpixel commented 6 years ago

Silverstripe version 4.1.0

Basically just installed SS 4.1 on my local server, everything works fine but the WYSIYWG editor is not showing, and there are a load of errors in the console which I have attached.

screen shot 2018-06-26 at 10 21 23

It is referring to tinyMce and vendor.js with webpack.

I'm using webpack to develop my site but don't think anything it is effecting the CMS.

Has anyone experienced this or know the fix?

obj63mc commented 6 years ago

I am getting this issue as well, logged it here, https://github.com/silverstripe/silverstripe-cms/issues/2177

If you reload a page that has a HTMLEditorField on it, the WYSIWYG seems to load fine then but if you move off to any other section of the CMS and back again you get the same error.

anishpixel commented 6 years ago

Any possible fixes?

dhensby commented 6 years ago

closing as duplicate of https://github.com/silverstripe/silverstripe-cms/issues/2177

kinglozzer commented 6 years ago

Re-opening for people experiencing this issue without S3 installed. If we don’t receive any updates after a little while, let’s close again

andrewnick commented 6 years ago

I'm also experiencing this issue after an upgrade to SS4 and no silverstripe-S3.

The following is installed.

asyncphp/doorman 3.0.0
composer/ca-bundle 1.1.2
composer/installers v1.5.0
composer/semver 1.4.2
composer/xdebug-handler 1.1.0
cwp/cwp 2.1.0
cwp/cwp-core 2.1.0
cwp/cwp-pdfexport 1.0.1
cwp/cwp-recipe-cms 2.1.0
cwp/cwp-recipe-core 2.1.0
cwp/cwp-recipe-search 2.1.0
cwp/cwp-search 1.0.0
dnadesign/silverstripe-elemental 2.1.0
doctrine/annotations v1.6.0  
doctrine/instantiator 1.1.0  
doctrine/lexer v1.0.1  
embed/embed v3.3.5  
friendsofphp/php-cs-fixer v2.12.2  
gdmedia/ss-auto-git-ignore 1.0.2  
guzzlehttp/psr7 1.4.2  
heyday/silverstripe-menumanager 3.0.3  
intervention/image 2.4.2  
jeremeamia/SuperClosure 2.4.0  
league/csv 8.2.3  
league/flysystem 1.0.45  
m1/env 2.1.2  
marcj/topsort 1.1.0  
monolog/monolog 1.23.0  
myclabs/deep-copy 1.8.1  
nikic/php-parser v3.1.5  
paragonie/random_compat v2.0.17  
php-cs-fixer/diff v1.3.0  
phpdocumentor/reflection-common 1.0.1  
phpdocumentor/reflection-docblock 4.3.0  
phpdocumentor/type-resolver 0.4.0  
phpspec/prophecy 1.8.0
phpunit/php-code-coverage 4.0.8
phpunit/php-file-iterator 1.4.5
phpunit/php-text-template 1.2.1
phpunit/php-timer 1.0.9
phpunit/php-token-stream 2.0.2
phpunit/phpunit 5.7.27
phpunit/phpunit-mock-objects 3.4.4
psr/cache 1.0.1
psr/container 1.0.0
psr/http-message 1.0.1
psr/log 1.0.2
psr/simple-cache 1.0.1
ptcinc/solr-php-client v1.0.0
sebastian/code-unit-reverse-lookup 1.0.
sebastian/comparator 1.2.
sebastian/diff 1.4.
sebastian/environment 2.0.
sebastian/exporter 2.0.
sebastian/global-state 1.1.
sebastian/object-enumerator 2.0.
sebastian/recursion-context 2.0.
sebastian/resource-operations 1.0.
sebastian/version 2.0.
sheadawson/silverstripe-linkable 2.0.
sheadawson/silverstripe-zenvalidator dev-master bcc5eda
silverstripe/admin 1.2.0
silverstripe/asset-admin 1.2.0
silverstripe/assets 1.2.0
silverstripe/auditor 2.1.3
silverstripe/campaign-admin 1.2.0
silverstripe/cms 4.2.0
silverstripe/config 1.0.5
silverstripe/contentreview 4.1.
silverstripe/environmentcheck 2.0.0
silverstripe/errorpage 1.2.0
silverstripe/framework 4.2.0
silverstripe/fulltextsearch 3.3.1
silverstripe/fulltextsearch-localsolr dev-master f2a799e
silverstripe/googlesitemaps 2.1.2
silverstripe/graphql 2.0.0
silverstripe/html5 2.0.1
silverstripe/hybridsessions 2.0.0
silverstripe/mimevalidator 2.0.0
silverstripe/recipe-cms 4.2.0
silverstripe/recipe-collaboration 1.1.0
silverstripe/recipe-core 4.2.0
silverstripe/recipe-form-building 1.1.0
silverstripe/recipe-plugin 1.3.0
silverstripe/redirectedurls 2.0.0
silverstripe/reports 4.2.0
silverstripe/segment-field 2.2.1
silverstripe/sharedraftcontent 2.1.0
silverstripe/siteconfig 4.2.0
silverstripe/spamprotection 3.0.0
silverstripe/taxonomy 2.0.1
silverstripe/userforms 5.2.0
silverstripe/vendor-plugin 1.3.3
silverstripe/versioned 1.2.0
swiftmailer/swiftmailer v5.4.12
symbiote/silverstripe-advancedworkflow 5.0.8
symbiote/silverstripe-gridfieldextensions 3.2.0
symbiote/silverstripe-queuedjobs 4.2.3
symfony/cache v3.4.14
symfony/config v3.4.14
symfony/console v4.1.3
symfony/event-dispatcher v4.1.3
symfony/filesystem v4.1.3
symfony/finder v3.4.14
symfony/options-resolver v4.1.3
symfony/polyfill-apcu v1.9.0
symfony/polyfill-ctype v1.9.0
symfony/polyfill-mbstring v1.9.0
symfony/polyfill-php56 v1.9.0
symfony/polyfill-php70 v1.9.0
symfony/polyfill-php72 v1.9.0
symfony/polyfill-util v1.9.0
symfony/process v3.4.14
symfony/stopwatch v4.1.3
symfony/translation v2.8.44
symfony/yaml v3.4.14
tractorcow/classproxy 0.1.2
tractorcow/silverstripe-proxy-db 0.1.0
unclecheese/display-logic 2.0.1
undefinedoffset/silverstripe-nocaptcha 2.0.0
webmozart/assert 1.3.0
webonyx/graphql-php v0.8.0
anishpixel commented 6 years ago

Still getting this issue, this is the SS versions im using:

composer/ca-bundle                        1.1.1              Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.
composer/installers                       v1.5.0             A multi-framework Composer library installer
doctrine/instantiator                     1.0.5              A small, lightweight utility to instantiate objects in PHP without invoking their constructors
embed/embed                               v3.3.1             PHP library to retrieve page info using oembed, opengraph, etc
google/recaptcha                          1.1.3              Client library for reCAPTCHA, a free service that protect websites from spam and abuse.
guzzlehttp/psr7                           1.4.2              PSR-7 message implementation that also provides common utility methods
heyday/silverstripe-responsive-images     2.0.0              Configure and send a series of image size options to the client without loading any resources until a media query can be executed.
intervention/image                        2.4.1              Image handling and manipulation library with support for Laravel integration
league/flysystem                          1.0.44             Filesystem abstraction: Many filesystems, one API.
m1/env                                    2.1.0              Env is a lightweight library bringing .env file parser compatibility to PHP. In short - it enables you to read .env files with PHP.
marcj/topsort                             1.1.0              High-Performance TopSort/Dependency resolving algorithm
monolog/monolog                           1.23.0             Sends your logs to files, sockets, inboxes, databases and various web services
myclabs/deep-copy                         1.7.0              Create deep copies (clones) of your objects
nikic/php-parser                          v3.1.5             A PHP parser written in PHP
paragonie/random_compat                   v2.0.12            PHP 5.x polyfill for random_bytes() and random_int() from PHP 7
phpdocumentor/reflection-common           1.0.1              Common reflection classes used by phpdocumentor to reflect the code structure
phpdocumentor/reflection-docblock         3.3.2              With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.
phpdocumentor/type-resolver               0.4.0             
phpspec/prophecy                          1.7.6              Highly opinionated mocking framework for PHP 5.3+
phpunit/php-code-coverage                 4.0.8              Library that provides collection, processing, and rendering functionality for PHP code coverage information.
phpunit/php-file-iterator                 1.4.5              FilterIterator implementation that filters files based on a list of suffixes.
phpunit/php-text-template                 1.2.1              Simple template engine.
phpunit/php-timer                         1.0.9              Utility class for timing
phpunit/php-token-stream                  1.4.12             Wrapper around PHP's tokenizer extension.
phpunit/phpunit                           5.7.27             The PHP Unit Testing framework.
phpunit/phpunit-mock-objects              3.4.4              Mock Object library for PHPUnit
psr/cache                                 1.0.1              Common interface for caching libraries
psr/container                             1.0.0              Common Container Interface (PHP FIG PSR-11)
psr/http-message                          1.0.1              Common interface for HTTP messages
psr/log                                   1.0.2              Common interface for logging libraries
psr/simple-cache                          1.0.1              Common interfaces for simple caching
sebastian/code-unit-reverse-lookup        1.0.1              Looks up which function or method a line of code belongs to
sebastian/comparator                      1.2.4              Provides the functionality to compare PHP values for equality
sebastian/diff                            1.4.3              Diff implementation
sebastian/environment                     2.0.0              Provides functionality to handle HHVM/PHP environments
sebastian/exporter                        2.0.0              Provides the functionality to export PHP variables for visualization
sebastian/global-state                    1.1.1              Snapshotting of global state
sebastian/object-enumerator               2.0.1              Traverses array structures and object graphs to enumerate all referenced objects
sebastian/recursion-context               2.0.0              Provides functionality to recursively process PHP variables
sebastian/resource-operations             1.0.0              Provides a list of PHP built-in functions that operate on resources
sebastian/version                         2.0.1              Library that helps with managing the version number of Git-hosted PHP projects
silverstripe-themes/simple                dev-master 4d546a4 The SilverStripe simple theme (default SilverStripe 3 theme)
silverstripe/admin                        1.1.0              SilverStripe admin interface
silverstripe/asset-admin                  1.1.0              Asset management for the SilverStripe CMS
silverstripe/assets                       1.1.0              SilverStripe Assets component
silverstripe/campaign-admin               1.1.0              SilverStripe campaign admin interface
silverstripe/cms                          4.1.0              The SilverStripe Content Management System
silverstripe/config                       1.0.4              SilverStripe configuration based on YAML and class statics
silverstripe/errorpage                    1.1.0              ErrorPage component for SilverStripe CMS
silverstripe/framework                    4.1.0              The SilverStripe framework
silverstripe/graphql                      1.1.0              GraphQL server for SilverStripe models and other data
silverstripe/recipe-cms                   1.1.0              SilverStripe recipe for fully featured page and asset content editing
silverstripe/recipe-core                  1.1.0              SilverStripe framework-only core recipe
silverstripe/recipe-plugin                1.2.0              Helper plugin to install SilverStripe recipes
silverstripe/redirectedurls               dev-master 042ece4 Provides a system for users to configure arbitrary redirections in the CMS
silverstripe/reports                      4.1.0              Reports module for SilverStripe CMS
silverstripe/siteconfig                   4.1.0              Site wide settings administration.
silverstripe/vendor-plugin                1.3.3              Allows vendor modules to expose directories to the webroot
silverstripe/versioned                    1.1.0              SilverStripe Versioned component
swiftmailer/swiftmailer                   v5.4.9             Swiftmailer, free feature-rich PHP mailer
symbiote/silverstripe-gridfieldextensions 3.1.1              A collection of useful grid field components
symfony/cache                             v3.4.8             Symfony Cache component with PSR-6, PSR-16, and tags
symfony/config                            v3.4.8             Symfony Config Component
symfony/filesystem                        v3.4.8             Symfony Filesystem Component
symfony/finder                            v3.4.8             Symfony Finder Component
symfony/polyfill-apcu                     v1.7.0             Symfony polyfill backporting apcu_* functions to lower PHP versions
symfony/polyfill-mbstring                 v1.7.0             Symfony polyfill for the Mbstring extension
symfony/translation                       v2.8.39            Symfony Translation Component
symfony/yaml                              v3.4.8             Symfony Yaml Component
undefinedoffset/sortablegridfield         2.0.4              Adds drag and drop functionality to SilverStripe 4.x's GridField
webmozart/assert                          1.3.0              Assertions to validate method input/output with nice error messages.
webonyx/graphql-php                       v0.8.0             A PHP port of GraphQL reference implementation
maxime-rainville commented 6 years ago

@anishpixel @andrewnick

I've dug into this a bit. SilverStripe will generate a tinyMCE config file under assets. The name of the file will very but it will usually look something like this assets/_tinymce/tinymce-cms-02427fcd4f.js.

If the file is not being generated properly, you're likely to see that error. Can you check if the file is being generate in your assets folder and can you check in your browser network monitor to see if the file is being fetched.

Make sure to double check that your webserver's got write access to that folder.

maxime-rainville commented 6 years ago

@chillu I'm setting the impact as high on this one because it's affecting multiple users in the WYSIWIG with vanilla configuration.

The S3 issue mentioned above is probably related as the TinyMCE config is not being written to the S3 bucket. The fix might be something like being more explicit when the TinyMCE config can not be written, rather than let the WYSIWYG silently fail.

anishpixel commented 6 years ago

@maxime-rainville I seem to have solved the issue, not sure what the exact reasoning for it was but I was running 4.0 and posted the issue on the silverstripe forum of someone who had the same issue.

Basically just updated from 4.0 to 4.2 and the WYSIWYG started appearing again

robbieaverill commented 6 years ago

Great, I’ll close this then. If anyone experiences this again in 4.2 we can reopen it

eehondas commented 6 years ago

Hi Guys, this is my configuration. I'm on 4.2.1 and it is still happening consistently for me

asyncphp/doorman                          3.0.0             Child process management
axllent/silverstripe-cms-tweaks           2.0.11            Several CMS usability improvements
axllent/silverstripe-form-fields          1.2.5             Custom forms & fields for the SilverStripe framework & CMS
composer/ca-bundle                        1.1.2             Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.
composer/installers                       v1.5.0            A multi-framework Composer library installer
dnadesign/silverstripe-elemental          3.0.x-dev a643f4d Elemental pagetype and collection of Elements
doctrine/instantiator                     1.0.5             A small, lightweight utility to instantiate objects in PHP without invoking their constructors
embed/embed                               v3.3.5            PHP library to retrieve page info using oembed, opengraph, etc
guzzlehttp/guzzle                         6.3.3             Guzzle is a PHP HTTP client library
guzzlehttp/promises                       v1.3.1            Guzzle promises library
guzzlehttp/psr7                           1.4.2             PSR-7 message implementation that also provides common utility methods
heyday/silverstripe-colorpalette          2.0.3             A color palette picker for SilverStripe CMS
intervention/image                        2.4.2             Image handling and manipulation library with support for Laravel integration
jeremeamia/SuperClosure                   2.4.0             Serialize Closure objects, including their context and binding
jonom/focuspoint                          3.0.0             Smarter automatic image cropping for SilverStripe
jonom/silverstripe-text-target-length     2.0.2             Set character length recommendations on SilverStripe text form fields
league/csv                                8.2.3             Csv data manipulation made easy in PHP
league/flysystem                          1.0.46            Filesystem abstraction: Many filesystems, one API.
m1/env                                    2.1.2             Env is a lightweight library bringing .env file parser compatibility to PHP. In short - it enables you to read .env files with PHP.
marcj/topsort                             1.1.0             High-Performance TopSort/Dependency resolving algorithm
monolog/monolog                           1.23.0            Sends your logs to files, sockets, inboxes, databases and various web services
myclabs/deep-copy                         1.7.0             Create deep copies (clones) of your objects
nikic/php-parser                          v3.1.5            A PHP parser written in PHP
paragonie/random_compat                   v2.0.17           PHP 5.x polyfill for random_bytes() and random_int() from PHP 7
phpdocumentor/reflection-common           1.0.1             Common reflection classes used by phpdocumentor to reflect the code structure
phpdocumentor/reflection-docblock         3.3.2             With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.
phpdocumentor/type-resolver               0.4.0
phpspec/prophecy                          1.8.0             Highly opinionated mocking framework for PHP 5.3+
phpunit/php-code-coverage                 4.0.8             Library that provides collection, processing, and rendering functionality for PHP code coverage information.
phpunit/php-file-iterator                 1.4.5             FilterIterator implementation that filters files based on a list of suffixes.
phpunit/php-text-template                 1.2.1             Simple template engine.
phpunit/php-timer                         1.0.9             Utility class for timing
phpunit/php-token-stream                  1.4.12            Wrapper around PHP's tokenizer extension.
phpunit/phpunit                           5.7.27            The PHP Unit Testing framework.
phpunit/phpunit-mock-objects              3.4.4             Mock Object library for PHPUnit
psr/cache                                 1.0.1             Common interface for caching libraries
psr/container                             1.0.0             Common Container Interface (PHP FIG PSR-11)
psr/http-message                          1.0.1             Common interface for HTTP messages
psr/log                                   1.0.2             Common interface for logging libraries
psr/simple-cache                          1.0.1             Common interfaces for simple caching
ryanpotter/silverstripe-cms-theme         2.3.0             CMS Theme
sebastian/code-unit-reverse-lookup        1.0.1             Looks up which function or method a line of code belongs to
sebastian/comparator                      1.2.4             Provides the functionality to compare PHP values for equality
sebastian/diff                            1.4.3             Diff implementation
sebastian/environment                     2.0.0             Provides functionality to handle HHVM/PHP environments
sebastian/exporter                        2.0.0             Provides the functionality to export PHP variables for visualization
sebastian/global-state                    1.1.1             Snapshotting of global state
sebastian/object-enumerator               2.0.1             Traverses array structures and object graphs to enumerate all referenced objects
sebastian/recursion-context               2.0.0             Provides functionality to recursively process PHP variables
sebastian/resource-operations             1.0.0             Provides a list of PHP built-in functions that operate on resources
sebastian/version                         2.0.1             Library that helps with managing the version number of Git-hosted PHP projects
sheadawson/silverstripe-linkable          2.0.0             A couple of handy form fields and objects for managing external and internal links on DataObjects
silverstripe/admin                        1.2.1             SilverStripe admin interface
silverstripe/asset-admin                  1.2.1             Asset management for the SilverStripe CMS
silverstripe/assets                       1.2.1             SilverStripe Assets component
silverstripe/blog                         3.2.1             A fresh take on blogging in Silverstripe set out to tackle the issue of a cluttered Site Tree.
silverstripe/campaign-admin               1.2.1             SilverStripe campaign admin interface
silverstripe/cms                          4.2.1             The SilverStripe Content Management System
silverstripe/config                       1.0.6             SilverStripe configuration based on YAML and class statics
silverstripe/errorpage                    1.2.1             ErrorPage component for SilverStripe CMS
silverstripe/framework                    4.2.1             The SilverStripe framework
silverstripe/graphql                      2.0.1             GraphQL server for SilverStripe models and other data
silverstripe/lumberjack                   2.0.0             A module to make managing pages in a GridField easy without losing any of the functionality that you're used to in the CMS.
silverstripe/recipe-cms                   4.2.1             SilverStripe recipe for fully featured page and asset content editing
silverstripe/recipe-core                  4.2.1             SilverStripe framework-only core recipe
silverstripe/recipe-plugin                1.3.0             Helper plugin to install SilverStripe recipes
silverstripe/redirectedurls               2.0.0             Provides a system for users to configure arbitrary redirections in the CMS
silverstripe/reports                      4.2.1             Reports module for SilverStripe CMS
silverstripe/segment-field                2.2.1             A reusable approach to segment-generating fields
silverstripe/siteconfig                   4.2.1             Site wide settings administration.
silverstripe/staticpublishqueue           4.0.0-beta.1      Static publishing queue to create static versions of pages for enhanced performance and security
silverstripe/tagfield                     2.1.0             Tag field for Silverstripe
silverstripe/userforms                    5.2.1             UserForms enables CMS users to create dynamic forms via a drag and drop interface and without getting involved in any PHP code
silverstripe/vendor-plugin                1.3.3             Allows vendor modules to expose directories to the webroot
silverstripe/versioned                    1.2.1             SilverStripe Versioned component
silverstripe/versioned-admin              1.0.0             SilverStripe versioned admin interface
silverstripe/widgets                      2.0.1             Widgets are small pieces of functionality such as showing the latest Comments or Flickr Photos. They normally display on the sidebar of your website.
silverware/validator                      1.2.0             SilverWare Validator Module.
swiftmailer/swiftmailer                   v5.4.12           Swiftmailer, free feature-rich PHP mailer
symbiote/silverstripe-gridfieldextensions 3.2.0             A collection of useful grid field components
symbiote/silverstripe-queuedjobs          4.2.3             A framework for defining and running background jobs in a queued manner
symfony/cache                             v3.4.14           Symfony Cache component with PSR-6, PSR-16, and tags
symfony/config                            v3.4.14           Symfony Config Component
symfony/filesystem                        v3.4.14           Symfony Filesystem Component
symfony/finder                            v3.4.14           Symfony Finder Component
symfony/polyfill-apcu                     v1.9.0            Symfony polyfill backporting apcu_* functions to lower PHP versions
symfony/polyfill-ctype                    v1.9.0            Symfony polyfill for ctype functions
symfony/polyfill-mbstring                 v1.9.0            Symfony polyfill for the Mbstring extension
symfony/polyfill-php56                    v1.9.0            Symfony polyfill backporting some PHP 5.6+ features to lower PHP versions
symfony/polyfill-util                     v1.9.0            Symfony utilities for portability of PHP codes
symfony/translation                       v2.8.44           Symfony Translation Component
symfony/yaml                              v3.4.14           Symfony Yaml Component
unclecheese/display-logic                 2.0.1             Allows assignment of conditions for display and hide of specific form fields based on client side behavior.
undefinedoffset/sortablegridfield         2.0.6             Adds drag and drop functionality to SilverStripe 4.x's GridField
webmozart/assert                          1.3.0             Assertions to validate method input/output with nice error messages.
webonyx/graphql-php                       v0.8.0            A PHP port of GraphQL reference implementation

I suggest we re-open this

chillu commented 6 years ago

Reopening. Please file specific bug reports to help us action these things. Like ... which browser are you using? The original screenshot kind of indicates Chrome, but none of the follow-up posters have noted this important detail.

eehondas commented 6 years ago

Hi @chillu. This isn't browser specific, It happens on any given browser for me and @spark-green. Apologies for not posting here earlier but there are multiple threads with the same issue and we didn't know about this one. Anyway, the problem we have is related to tinymce not loading in first instance but only after a page reload. The issue is well described and broken down here: https://github.com/silverstripe/silverstripe-cms/issues/2177 This thread got bounced to the S3 but since this problem it's not S3 related (or not only) we finally posted here. Please use above thread for info as it is more informative.

kinglozzer commented 6 years ago

Sorry, I split that thread up as it was a combo of people who were and weren’t using the S3 module - two different route causes of similar symptoms.

@eehondas Could you please share the following?

I note that a few people have said they’re running a webpack-based frontend build process. If that’s the case for you too, are you viewing the CMS through webpack-dev-server? Does the issue still occur if you don’t have webpack-dev-server enabled, or you view the CMS outside of it?

eehondas commented 6 years ago

Hi @kinglozzer Sure no problem. This is the error in the console. image I checked and as a matter of fact when this happens tinyMCE is not in the list of requested JS files. This is a list of every loaded file from Network tab in Chrome DevTools when the error happens: image And this is (part of) the list once I reload the page: 2018-08-31 10_14_40-clipboard So essentially as some users explained in the other thread it looks like a timing issue when tinyMCE is invoked before is available or loaded at all. Also to answer the webpack question: we do use webpack, we do not use webpack-dev-server at all. Also I am testing the error on a website where I don't have a frontend or theme plugged in at all, Just Backend.

Hope this helps

eehondas commented 6 years ago

Sorry to bother but is there any update on this?

kinglozzer commented 6 years ago

Sorry @eehondas, but I still can’t recreate this, which makes it almost impossible to try to debug :/

When you click to edit a page, under the headers for the request to pages/edit/show/123 there should be an x-include-js header - can you see the TinyMCE JS file in the list of files?

eehondas commented 6 years ago

Hi @kinglozzer, you can close this issue. Long story short, it was happening with a base installation of SS 4.1 for us. Then we moved to 4.2 and we thought it was the same problem. However I tried with a base installation of 4.2 and it does not happen anymore. There were multiple things happening at once and one was a third party module stopping tiny mce from loading. We tracked that one down and it is not a framework problem anymore. Thank you for the help.

kinglozzer commented 6 years ago

Great, thanks for feeding back @eehondas and glad everything’s working for you now 😀

chillu commented 6 years ago

This came up in a CWP recipe context again: https://github.com/silverstripe/cwp/issues/141

ohararyan commented 6 years ago

Experiencing the same issue on SS4.2.1 and CWP2.1.1 using the following DataExtension.

    public function updateCMSFields(FieldList $fields)
    {
        $fields->replaceField('Content', HiddenField::create('Content', 'Content'));
    }

If I load the page directly it works fine. But If I load /admin/pages and then visit my page it breaks.

Uncaught ReferenceError: tinymce is not defined
    at Object.create (bundle.js?m=1532959962:1)
    at Object.init (bundle.js?m=1532959962:1)
    at init.onadd (bundle.js?m=1532959962:1)
    at s (vendor.js?m=1532959962:1)
    at Array.<anonymous> (vendor.js?m=1532959962:1)
    at HTMLDocument.<anonymous> (vendor.js?m=1532959962:1)
    at HTMLDocument.dispatch (eval at e.exports (vendor.js?m=1532959962:1), <anonymous>:3332:9)
    at HTMLDocument.eventHandle (eval at e.exports (vendor.js?m=1532959962:1), <anonymous>:2941:28)
    at Object.trigger (eval at e.exports (vendor.js?m=1532959962:1), <anonymous>:3210:12)
    at init.triggerHandler (eval at e.exports (vendor.js?m=1532959962:1), <anonymous>:3874:24)
Codesesh commented 6 years ago

I'm experiencing this issue on a few SS 4.2.1 sites. Non CWP sites. Seems to only happen when going to edit the Home Page in the admin area, if I go to other pages it works fine. If I click Home, it bugs out showing that tinymce js error, then refresh and it works.

cjsewell commented 6 years ago

Just resolved this issue after doing a 4.2 upgrade. The culprit for me was the pre 4.2 /assets/.htaccess file, which denies access to js files. It appears /public/assets/.htaccess is ignored with Apache 4.2 if /assets/.htaccess file exists.

Removing /assets (after ensuring uploaded content was moved to /public/assets/) was the fix.

Hope that helps

Codesesh commented 6 years ago

Interesting, I tried removing the .htaccess form /public/assets/.htacess & /public/.htaccess and replacing with a fresh copy from a SS 4.2.1 .zip download but still got the same issue.

Codesesh commented 6 years ago

@kinglozzer - Got a video here demonstrating this in action as well, as you can see tinyMCE isn't defined on the homepage only for the first time. Viewing other pages it works fine. https://cl.ly/f2d862d65931

MrJamesEllis commented 6 years ago

Hi folks

Hitting this issue on a number of 4.1 and 4.2 sites without the silverstripe-s3 module installed

In my case I tracked the issue down to the jquery-ui-timepicker-addon.js requirement in the symbiote/silverstripe-advancedworkflow module. All of the requirements were showing in the X-Include-JS header but no requirements after the timepicker JS file were firing - including JS for GridFieldExtensions and the tinymce-cms-xxx.js requirement in /assets/_tinymce/

This particular case is probably just a symptom rather than the cause - not everyone is going to have this requirement. My thinking is that there are certain requirements being returned in X-Include-JS that are failing silently and causing things like the tinymce JS to not load. Maybe these errors should be caught and a warning logged somehow, allowing requirement processing to complete?

Easiest way to pick the bad requirement up is to check which assets are returned in X-Include-JS then see which one is the last one to load in the browser dev console / network tab.

Cheers James

christopherdarling commented 6 years ago

While my issue is slightly different to those in this thread, I believe they're quite likely related. Happy to open a new issue if you want me to do so.

I am using the gridfieldextensions module and applying GridFieldOrderableRows to one of my GridFields, this should load the GridFieldExtensions.js file, it's in my X-Include-JS header but doesn't load when loading the EditForm via XHR. The file is loaded fine if I then refresh the CMS.

I've been digging into the jQuery.onDemand() plugin and it looks as though the issues lies there. Well, kind of. I've tracked down the issue to a line in /resources/vendor/silverstripe/admin/client/dist/js/vendor.js?m=1539630646

0 !== this._ondemand_loaded_list[t(n)]

from line 65338 which is different to what it is in the plugin

(this._ondemand_loaded_list[decodePath(scriptUrl)] !== undefined);

so the above line in the webpack bundle returns true when a file is not in the _ondemand_loaded_list array (because undefined !== 0).

So looks as though our webpack bundling is messing with our strict equality comparison, we either need to change this to != undefined or webpack needs fixing so it doesn't change undefined to 0.

MrJamesEllis commented 5 years ago

Don't know if this helps but here's some of what is loaded in my case via Requirements in one of my SS4.1 sites (same result in 4.2.1) when the Symbiote\AdvancedWorkflow\Extensions\WorkflowEmbargoExpiryExtension is applied to SilverStripe\CMS\Model\SiteTree in config, these all appear in the X-Include-JS header.

//  .. lots of other files required before these
/resources/vendor/silverstripe/campaign-admin/client/dist/js/bundle.js?m=1541382588
/resources/vendor/silverstripe/sharedraftcontent/client/dist/js/main.js?m=1535697527
/resources/vendor/silverstripe/cms/client/lang/en.js?m=1532959965
/resources/vendor/symbiote/silverstripe-advancedworkflow/client/lang/en.js?m=1530484913
/resources/vendor/symbiote/silverstripe-advancedworkflow/thirdparty/javascript/jquery-ui/timepicker/jquery-ui-sliderAccess.js?m=1530484913
/resources/vendor/symbiote/silverstripe-advancedworkflow/thirdparty/javascript/jquery-ui/timepicker/jquery-ui-timepicker-addon.js?m=1530484913
/resources/vendor/symbiote/silverstripe-advancedworkflow/client/dist/js/advancedworkflow.js?m=1530484913
/resources/vendor/symbiote/silverstripe-gridfieldextensions/javascript/GridFieldExtensions.js?m=1530653403
// final requirement loaded:
/assets/_tinymce/tinymce-cms-267525e4ec.js

According to the Chrome dev console, the following JS files are loaded:

// these 3 show in the JS tab
/resources/vendor/silverstripe/campaign-admin/client/dist/js/bundle.js?m=1541382588
/resources/vendor/silverstripe/sharedraftcontent/client/dist/js/main.js?m=1535697527
/resources/vendor/silverstripe/cms/client/lang/en.js?m=1532959965

// these show in the XHR tab
/resources/vendor/symbiote/silverstripe-advancedworkflow/client/lang/en.js?m=1530484913
/resources/vendor/symbiote/silverstripe-advancedworkflow/thirdparty/javascript/jquery-ui/timepicker/jquery-ui-sliderAccess.js?m=1530484913
/resources/vendor/symbiote/silverstripe-advancedworkflow/thirdparty/javascript/jquery-ui/timepicker/jquery-ui-timepicker-addon.js?m=1530484913

Missing are:

/resources/vendor/symbiote/silverstripe-advancedworkflow/client/dist/js/advancedworkflow.js?m=1530484913
/resources/vendor/symbiote/silverstripe-gridfieldextensions/javascript/GridFieldExtensions.js?m=1530653403
/assets/_tinymce/tinymce-cms-267525e4ec.js

If I remove/block jquery-ui-timepicker-addon.js from loading, here's what loads in the XHR tab of the Chrome dev console, the page edit screen then loads without error.

// these show in the XHR tab
/resources/vendor/symbiote/silverstripe-advancedworkflow/client/lang/en.js?m=1530484913
/resources/vendor/symbiote/silverstripe-advancedworkflow/thirdparty/javascript/jquery-ui/timepicker/jquery-ui-sliderAccess.js?m=1530484913
/resources/vendor/symbiote/silverstripe-advancedworkflow/client/dist/js/advancedworkflow.js?m=1530484913
/resources/vendor/symbiote/silverstripe-gridfieldextensions/javascript/GridFieldExtensions.js?m=1530653403
/assets/_tinymce/tinymce-cms-267525e4ec.js

Possible the tinymce error appearing in the console is causing focus on tinymce but as above neither advancedworkflow.js and GridFieldExtensions.js are loading.

It looks like a JS file is causing the ondemand loader to fail? (jquery-ui-timepicker-addon.js in this case)

chillu commented 5 years ago

@christopherdarling @MrJamesEllis Does this still happen with 4.3.1-rc1?

christopherdarling commented 5 years ago

@chillu I've tested with recipe-cms 4.3.0-rc1 (couldn't see 4.3.1) and no change I'm afraid.

christopherdarling commented 5 years ago

I've dug into my case further (slightly different to this thread but assumed it may be down to the same underlying issue), what appears to be the issue at least in my case is that some XHR loaded scripts are not firing a success callback, this breaks the rest of the x-include-js chain from being loaded. One of the files in my x-include-js header is /resources/vendor/colymba/gridfield-bulk-editing-tools/client/dist/js/main.js which was triggering an error callback of type parsererror. I see there's an issue open over at that plugin (https://github.com/colymba/GridFieldBulkEditingTools/issues/176).

Should we: a) be continuing to load the rest of the x-include-js requirements if a file fails? if so, perhaps we should move our $.ajax to use .complete or add a .error callback. b) add some form of console.log if a script fails to load so at least it's easier to track down

mmativ commented 5 years ago

I try to remove my

->addComponent(new BulkUploader(null, null, true)) ->addComponent(new BulkManager())

on my gridfield and the issue are gone, thanks @christopherdarling

pjayme commented 5 years ago

Hi there,

We are currently upgrading a site from SS3 to SS4 and we are still experiencing this issue on 4.3.0

Any advancements on this?

Cheers

chillu commented 5 years ago

@pjayme Can you please list composer info here, and a stripped down test case on when that's happening (page type configs)? Which browser, and what's the error?

Should we be continuing to load the rest of the x-include-js requirements if a file fails

@christopherdarling That sounds like a good idea. Maybe make a pull request for that?

Reopening the issue for now.

pjayme commented 5 years ago

@chillu sure thing, the error I am experiencing is identical to the responses on this thread https://github.com/silverstripe/silverstripe-cms/issues/2177 - 'tinyMCE' not defined:

Test case:

List of modules installed:

asyncphp/doorman                               3.0.0                                    Child process management
cheddam/silverstripe-flash-messages            dev-master b7a232a                       A simple module for sending flash messages in y...
colymba/gridfield-bulk-editing-tools           3.0.0-beta4                              SilverStripe GridField component to upload imag...
composer/ca-bundle                             1.1.4                                    Lets you find a path to the system CA bundle, a...
composer/installers                            v1.6.0                                   A multi-framework Composer library installer
cwp/cwp                                        2.2.0                                    CWP features module. We strongly recommend usin...
cwp/cwp-core                                   2.2.0                                    CWP basic compatibility module. Use for migrati...
cwp/cwp-pdfexport                              1.0.1                                    Add PDF export capability for pages in CWP
cwp/cwp-recipe-cms                             2.2.0                                    CWP CMS requirements recipe
cwp/cwp-recipe-core                            2.2.0                                    CWP core requirements recipe
cwp/cwp-recipe-search                          2.2.0                                    CWP search requirements recipe
cwp/cwp-search                                 1.1.x-dev 5c0b6ea                        CWP fulltextsearch integration module
dnadesign/silverstripe-populate                2.0.0                                    Populate your database through YAML files
doctrine/instantiator                          1.1.0                                    A small, lightweight utility to instantiate obj...
embed/embed                                    v3.3.7                                   PHP library to retrieve page info using oembed,...
guzzlehttp/guzzle                              6.3.3                                    Guzzle is a PHP HTTP client library
guzzlehttp/promises                            v1.3.1                                   Guzzle promises library
guzzlehttp/psr7                                1.5.2                                    PSR-7 message implementation that also provides...
heyday/silverstripe-colorpalette               2.0.3                                    A color palette picker for SilverStripe CMS
heyday/silverstripe-menumanager                3.0.4                                    Allows complex menu management to be handled th...
intervention/image                             2.4.2                                    Image handling and manipulation library with su...
jdorn/sql-formatter                            dev-master 7ef9b85                       a PHP SQL highlighting library
jeremeamia/SuperClosure                        2.4.0                                    Serialize Closure objects, including their cont...
league/csv                                     8.2.3                                    Csv data manipulation made easy in PHP
league/flysystem                               1.0.50                                   Filesystem abstraction: Many filesystems, one API.
lekoala/silverstripe-debugbar                  2.0.1                                    DebugBar for SilverStripe CMS
m1/env                                         2.1.2                                    Env is a lightweight library bringing .env file...
marcj/topsort                                  1.1.0                                    High-Performance TopSort/Dependency resolving a...
maximebf/debugbar                              v1.15.0                                  Debug bar in the browser for php application
monolog/monolog                                1.24.0                                   Sends your logs to files, sockets, inboxes, dat...
myclabs/deep-copy                              1.8.1                                    Create deep copies (clones) of your objects
nikic/php-parser                               v4.2.0                                   A PHP parser written in PHP
nzta/silverstripe-sitebanner                   dev-feature/session-banners a783294      Site-wide banners activated through the CMS
paragonie/random_compat                        v2.0.18                                  PHP 5.x polyfill for random_bytes() and random_...
phpdocumentor/reflection-common                1.0.1                                    Common reflection classes used by phpdocumentor...
phpdocumentor/reflection-docblock              4.3.0                                    With this component, a library can provide supp...
phpdocumentor/type-resolver                    0.4.0                                   
phpspec/prophecy                               1.8.0                                    Highly opinionated mocking framework for PHP 5.3+
phpunit/php-code-coverage                      4.0.8                                    Library that provides collection, processing, a...
phpunit/php-file-iterator                      1.4.5                                    FilterIterator implementation that filters file...
phpunit/php-text-template                      1.2.1                                    Simple template engine.
phpunit/php-timer                              1.0.9                                    Utility class for timing
phpunit/php-token-stream                       2.0.2                                    Wrapper around PHP's tokenizer extension.
phpunit/phpunit                                5.7.27                                   The PHP Unit Testing framework.
phpunit/phpunit-mock-objects                   3.4.4                                    Mock Object library for PHPUnit
psr/cache                                      1.0.1                                    Common interface for caching libraries
psr/container                                  1.0.0                                    Common Container Interface (PHP FIG PSR-11)
psr/http-message                               1.0.1                                    Common interface for HTTP messages
psr/log                                        1.1.0                                    Common interface for logging libraries
psr/simple-cache                               1.0.1                                    Common interfaces for simple caching
ptcinc/solr-php-client                         v1.0.0                                   A purely PHP library for indexing and searching...
ralouphie/getallheaders                        2.0.5                                    A polyfill for getallheaders.
sebastian/code-unit-reverse-lookup             1.0.1                                    Looks up which function or method a line of cod...
sebastian/comparator                           1.2.4                                    Provides the functionality to compare PHP value...
sebastian/diff                                 1.4.3                                    Diff implementation
sebastian/environment                          2.0.0                                    Provides functionality to handle HHVM/PHP envir...
sebastian/exporter                             2.0.0                                    Provides the functionality to export PHP variab...
sebastian/global-state                         1.1.1                                    Snapshotting of global state
sebastian/object-enumerator                    2.0.1                                    Traverses array structures and object graphs to...
sebastian/recursion-context                    2.0.0                                    Provides functionality to recursively process P...
sebastian/resource-operations                  1.0.0                                    Provides a list of PHP built-in functions that ...
sebastian/version                              2.0.1                                    Library that helps with managing the version nu...
sheadawson/silverstripe-dependentdropdownfield 2.0.0                                    A silverstripe dropdown field that has it's opt...
sheadawson/silverstripe-linkable               2.0.0                                    A couple of handy form fields and objects for m...
silverstripe-archive/silverstripe-bbcodeparser dev-feature/update-vendor-module 6c70801 Abandoned moduled providing BBCodeParser and Te...
silverstripe/admin                             1.3.0                                    SilverStripe admin interface
silverstripe/akismet                           4.0.1                                    Akismet antispam module for Silverstripe
silverstripe/asset-admin                       1.3.0                                    Asset management for the SilverStripe CMS
silverstripe/assets                            1.3.0                                    SilverStripe Assets component
silverstripe/auditor                           2.1.4                                    Adds security audit trail to SilverStripe.
silverstripe/blog                              3.2.1                                    A fresh take on blogging in Silverstripe set ou...
silverstripe/campaign-admin                    1.3.0                                    SilverStripe campaign admin interface
silverstripe/cms                               4.3.0                                    The SilverStripe Content Management System
silverstripe/comment-notifications             2.0.1                                    Provides email notifications for visitor comments
silverstripe/comments                          3.1.5                                    This module provides commenting functionality f...
silverstripe/config                            1.0.9                                    SilverStripe configuration based on YAML and cl...
silverstripe/content-widget                    2.0.1                                    Display HTML content in a widget
silverstripe/contentreview                     4.1.1                                    Flags pages for periodical author review (incl....
silverstripe/environmentcheck                  2.0.0                                    Provides an API for building environment tests
silverstripe/errorpage                         1.3.0                                    ErrorPage component for SilverStripe CMS
silverstripe/framework                         4.3.0                                    The SilverStripe framework
silverstripe/fulltextsearch                    3.4.1                                    Adds support for Fulltext Search engines like S...
silverstripe/fulltextsearch-localsolr          dev-master f2a799e                       A pre-configured, ready to use Solr instance fo...
silverstripe/graphql                           3.0.0                                    GraphQL server for SilverStripe models and othe...
silverstripe/gridfieldqueuedexport             2.1.1                                    Export large data sets from your GridField in t...
silverstripe/html5                             2.0.1                                    HTML5 support for SilverStripe
silverstripe/hybridsessions                    2.1.0                                    Cookie/DB session support for SilverStripe
silverstripe/lumberjack                        2.0.1                                    A module to make managing pages in a GridField ...
silverstripe/mimevalidator                     2.0.0                                    Checks uploaded file content roughly matches a ...
silverstripe/recipe-blog                       1.1.2                                    SilverStripe Blog Project Template
silverstripe/recipe-cms                        4.3.0                                    SilverStripe recipe for fully featured page and...
silverstripe/recipe-collaboration              1.2.0                                    Add extra functionality to enhance CMS user col...
silverstripe/recipe-core                       4.3.0                                    SilverStripe framework-only core recipe
silverstripe/recipe-form-building              1.2.0                                    A recipe of modules to help you build forms in ...
silverstripe/recipe-plugin                     1.3.0                                    Helper plugin to install SilverStripe recipes
silverstripe/reports                           4.3.0                                    Reports module for SilverStripe CMS
silverstripe/segment-field                     2.2.2                                    A reusable approach to segment-generating fields
silverstripe/sharedraftcontent                 2.2.0                                    Share draft page content with non-CMS users
silverstripe/siteconfig                        4.3.0                                    Site wide settings administration.
silverstripe/sitewidecontent-report            3.0.2                                    Report of all pages and files across all subsites
silverstripe/spamprotection                    3.0.1                                    Spam protection module for SilverStripe.
silverstripe/tagfield                          2.2.2                                    Tag field for SilverStripe
silverstripe/taxonomy                          2.0.1                                    Provide extra taxonomy for cataloguing the data.
silverstripe/textextraction                    3.0.0                                    Text Extraction API for SilverStripe CMS (mostl...
silverstripe/userforms                         5.3.0                                    UserForms enables CMS users to create dynamic f...
silverstripe/vendor-plugin                     1.4.0                                    Allows vendor modules to expose directories to ...
silverstripe/versioned                         1.3.0                                    SilverStripe Versioned component
silverstripe/versioned-admin                   1.1.x-dev 747c508                        SilverStripe versioned admin interface
silverstripe/widgets                           2.0.2                                    Widgets are small pieces of functionality such ...
squizlabs/php_codesniffer                      3.4.0                                    PHP_CodeSniffer tokenizes PHP, JavaScript and C...
swiftmailer/swiftmailer                        v5.4.12                                  Swiftmailer, free feature-rich PHP mailer
symbiote/silverstripe-advancedworkflow         5.1.0                                    Adds configurable workflow support to the CMS, ...
symbiote/silverstripe-gridfieldextensions      3.2.1                                    A collection of useful grid field components
symbiote/silverstripe-queuedjobs               4.3.0                                    A framework for defining and running background...
symfony/cache                                  v3.4.22                                  Symfony Cache component with PSR-6, PSR-16, and...
symfony/config                                 v3.4.22                                  Symfony Config Component
symfony/filesystem                             v4.2.3                                   Symfony Filesystem Component
symfony/finder                                 v3.4.22                                  Symfony Finder Component
symfony/polyfill-apcu                          v1.10.0                                  Symfony polyfill backporting apcu_* functions t...
symfony/polyfill-ctype                         v1.10.0                                  Symfony polyfill for ctype functions
symfony/polyfill-mbstring                      v1.10.0                                  Symfony polyfill for the Mbstring extension
symfony/polyfill-php56                         v1.10.0                                  Symfony polyfill backporting some PHP 5.6+ feat...
symfony/polyfill-php72                         v1.10.0                                  Symfony polyfill backporting some PHP 7.2+ feat...
symfony/polyfill-util                          v1.10.0                                  Symfony utilities for portability of PHP codes
symfony/process                                v3.4.22                                  Symfony Process Component
symfony/translation                            v2.8.49                                  Symfony Translation Component
symfony/var-dumper                             v4.2.3                                   Symfony mechanism for exploring and dumping PHP...
symfony/yaml                                   v3.4.22                                  Symfony Yaml Component
tijsverkoyen/akismet                           1.1.0                                    Akismet is a wrapper-class to communicate with ...
tractorcow/classproxy                          0.1.2                                   
tractorcow/silverstripe-proxy-db               0.1.0                                   
unclecheese/display-logic                      2.0.2                                    Allows assignment of conditions for display and...
webmozart/assert                               1.4.0                                    Assertions to validate method input/output with...
webonyx/graphql-php                            v0.8.0                                   A PHP port of GraphQL reference implementation
micmania1 commented 5 years ago

Following on from @pjayme's post above, we can consistently reproduce this by logging into the cms and then clicking a page.

The problem seems to lie with how the javascript is loaded.

For example, going directly to the page /admin/pages/edit/show/6 the tinymce javascript will be loaded via a script tag in the DOM. However, when you go via /admin/pages and then navigate to a page, that area is loaded using an ajax call and the script should be loaded through the x-include-js header but isn't. The script is in the header, but never gets loaded (not sure why yet).

This explains why refreshing the page works (because the javascript is loaded differently).

NightJar commented 5 years ago

This issue appears double layered.

  1. Generated TinyMCE script is not being saved and thus cannot be loaded - why do we generate our own TinyMCE bundle per EditorConfig in SS4?
  2. jQuery.onDemand which is a "third party" script (that SilverStripe totally wrote and maintain) that is not fault tolerant - any error (server/transport/syntax/runtime) will cause every subsequent file in the queue to not be loaded. This breaks the CMS.

I've run into this trying to solve a cryptic "parsererror" toast message (that is also green, indicating success 🤷‍♂️) from appearing in various select pages in the CMS. In the end it was the same as @christopherdarling has also run into above (described at https://github.com/silverstripe/silverstripe-framework/issues/8228#issuecomment-437579836) - the root cause being that this file attempt to use (register a transformation with) the JavaScript Injector after it has been initialised, resulting in Injector throwing an error, thereby halting the dynamic include chain.

I see a number of actions to be taken here.

  1. Fix this issue for the OP description (lets not conflate issues) whereby the failure to write the TinyMCE config should be more ... "loud" - and perhaps a fallback default could be loaded.
  2. A new issue is made to address fault tolerance in the jQuery.onDemand plugin heavily used by the CMS
  3. Another issue is opened to consider ways Injector may be made more flexible to allow on-demand loaded scripts to mutate the container

@Cheddam is currently looking into https://github.com/silverstripe/cwp/issues/141 and may have thoughts on this.

Thanks @micmania1 for pointing out this connected issue :)

bergice commented 5 years ago

@NightJar jQuery.onDemand will no longer fail silently and should not stop subsequent script loading.

See https://github.com/silverstripe/silverstripe-admin/commit/e624376dc6ea354dd271bcbee285d28b6d123f95#diff-023e4c16d7408481b09f8ee6fba162cb

micmania1 commented 5 years ago

I've pulled in silverstripe/admin 1.3.2 (as per above commit) and this helps solve the problem.

mhenden commented 5 years ago

I'm having issues with TinyMCE not loading in a clean 'Vanilla'' install of SS4.3.2. Have tracked the problem down to a 403 error with /Public/assets/_tinymce/tinymce-cms-9a0ff8de32.js?_=1553045079110 which I believe stems from a 'permissions' issue. In my local (Mac OS) development environment the nested folder permissions are as follows:

I can change the first two folders for R/W for everyone. When I change permissions on /_tinymce and admin?flush=all the settings on _tinymce revert to 'write only' for user 'everyone'. Is this the root of the problem?

maxime-rainville commented 5 years ago

@mhenden I presume you are hosting this on Windows and IIS?

For anyone else experiencing this issue, could you clarify what OS/Server stack you are using?

mhenden commented 5 years ago

Hi Maxime

Should have clarified: I’m running this in my development environment (MacPro running OS 10.11.6). Development stack is MAMP 5.0.1, PHP 7.2.7

Hope this helps mike

14 Brees Street, Lower Hutt, Wellington, New Zealand

p: 04-577 0243, m: 027 4419 273, e: mike@mhdesign.co.nz mailto:mike@mhdesign.co.nz w: www.mhdesign.co.nz http://www.mhdesign.co.nz/

On 21/03/2019, at 9:40 AM, Maxime Rainville notifications@github.com wrote:

@mhenden https://github.com/mhenden I presume you are hosting this on Windows and IIS?

For anyone else experiencing this issue, could you clarify what OS/Server stack you are using?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/silverstripe/silverstripe-framework/issues/8228#issuecomment-475019101, or mute the thread https://github.com/notifications/unsubscribe-auth/AFB9zFzirPC8iS_rFCDFI_zIdGBl6q4jks5vYpyxgaJpZM4U8vXh.

chillu commented 5 years ago

It looks like this migh be resolved by @bergice BUG: Always continue loading scripts even if one script fails which he referenced above, and was released with 4.3.2.

If anyone still experiences this issue with 4.3.2 or newer, please ping us here in the next 48h, otherwise I'll close this issue

For every further report on this issue, we need the following info. There's so much back and forth here that we need accurate and actionable bug reports to track this down:

@mhenden: I think your issue seems unrelated. You're getting 403 (permission denied) errors on that file, which indicates filesystem permission issues. That's different from parsing errors around TinyMCE. It looks like there's an existing issue for this, let's continue that discussion thread there.

christopherdarling commented 5 years ago

@chillu I'm no longer facing the issues I had previously, thanks @bergice for the fix!

chillu commented 5 years ago

OK thanks for your patience everyone, I'm closing this ... again ;)

a2nt commented 5 years ago

I have noticed that one of bug reports was made with my webpack module: https://github.com/a2nt/silverstripe-webpack

Someone thought that it appeared cuz of using webpack, but it has nothing to deal with CMS Requirements and my module serves only frontend using webpack.

I have experienced the same issue with following modules installed:

a2nt/silverstripe-font-awesome-field              dev-master 4635537 A simple form field for selecting font...
axllent/silverstripe-bootstrap-forms              2.0.3              An extension to add CSS classes to Sil...
axllent/silverstripe-version-truncator            2.0.3              Automatically delete old SiteTree page...
betterbrief/silverstripe-googlemapfield           v2.2.1             Save locations using latitude/longitud...
bramus/ansi-php                                   3.0.2              ANSI Control Functions and ANSI Contro...
bramus/monolog-colored-line-formatter             2.0.3              Colored Line Formatter for Monolog
colymba/gridfield-bulk-editing-tools              dev-master 7f871a7 SilverStripe GridField component to up...
composer/ca-bundle                                1.2.3              Lets you find a path to the system CA ...
composer/installers                               v1.6.0             A multi-framework Composer library ins...
dnadesign/silverstripe-elemental                  4.1.0              Elemental pagetype and collection of E...
dnadesign/silverstripe-elemental-list             1.2.0              Adds a new element for nested elements
dnadesign/silverstripe-elemental-userforms        3.0.0              Adds a new element for usersforms
dnadesign/silverstripe-elemental-virtual          1.2.2              Adds ability for Elemental to share co...
doctrine/instantiator                             1.2.0              A small, lightweight utility to instan...
drmartingonzo/ss-tinymce-charcount                1.1.1              Plugin for tinyMCE in siverstripe to c...
dynamic/flexslider                                4.0.1              Display a FlexSlider on pages of your ...
dynamic/silverstripe-elemental-accordion          2.0.3              Display content in collapsable panels
dynamic/silverstripe-elemental-baseobject         2.0.3              A simple base DataObject to use with E...
dynamic/silverstripe-elemental-blocks             3.0.1              A recipe to require additional element...
dynamic/silverstripe-elemental-blog               2.1.2              Show recent posts from a featured blog.
dynamic/silverstripe-elemental-countdown          2.0.3              Display a countdown to a specific date...
dynamic/silverstripe-elemental-customer-service   2.0.4              Additional customer service element fo...
dynamic/silverstripe-elemental-embedded-code      2.0.2              Embed code like iFrames or Javascript ...
dynamic/silverstripe-elemental-features           2.0.5              A block that displays featured content...
dynamic/silverstripe-elemental-filelist           2.0.2              A multi file block for SilverStripe El...
dynamic/silverstripe-elemental-flexslider         2.0.2              Flexslider slideshow content block for...
dynamic/silverstripe-elemental-gallery            2.0.4              A block to display a collection of images
dynamic/silverstripe-elemental-image              2.0.1              A block to add a single image to your ...
dynamic/silverstripe-elemental-oembed             2.1.1              A block to embed media from other webs...
dynamic/silverstripe-elemental-promos             2.0.3              A content block to display a group of ...
dynamic/silverstripe-elemental-section-navigation 2.0.2              A block to display a list of links to ...
dynamic/silverstripe-elemental-sponsors           2.0.1              Display a list of sponsor logos with l...
dynamic/silverstripe-elemental-tabset             2.0.1              Create a tabbed interface that uses el...
dynamic/silverstripe-elemental-testimonials       2.0.1              Testimonials element for the SilverStr...
dynamic/silverstripe-geocoder                     1.0.0              SilverStripe wrapper for Geocoder
egeloen/http-adapter                              0.8.0              Issue HTTP request for PHP 5.3+.
embed/embed                                       v3.4.1             PHP library to retrieve page info usin...
firesphere/googlemapsfield                        dev-master ecf39a4 Google places api field for SilverStripe
gorriecoe/silverstripe-dataobjecthistory          1.2.2              Adds a history tab to dataobjects
guzzlehttp/psr7                                   1.6.1              PSR-7 message implementation that also...
igorw/get-in                                      v1.0.3             Functions for for hash map (assoc arra...
innoweb/silverstripe-sitemap                      2.1.1              Adds a page type that automatically bu...
intervention/image                                2.5.0              Image handling and manipulation librar...
jdorn/sql-formatter                               dev-master 7ef9b85 a PHP SQL highlighting library
jonom/silverstripe-betternavigator                4.1.1              Front-end utility menu for SilverStrip...
league/csv                                        8.2.3              Csv data manipulation made easy in PHP
league/flysystem                                  1.0.53             Filesystem abstraction: Many filesyste...
lekoala/silverstripe-debugbar                     2.0.3              DebugBar for SilverStripe CMS
m1/env                                            2.1.2              Env is a lightweight library bringing ...
marcj/topsort                                     1.1.0              High-Performance TopSort/Dependency re...
maximebf/debugbar                                 v1.15.0            Debug bar in the browser for php appli...
monolog/monolog                                   1.24.0             Sends your logs to files, sockets, inb...
myclabs/deep-copy                                 1.9.1              Create deep copies (clones) of your ob...
nikic/php-parser                                  v4.2.2             A PHP parser written in PHP
paragonie/random_compat                           v2.0.18            PHP 5.x polyfill for random_bytes() an...
phar-io/manifest                                  1.0.3              Component for reading phar.io manifest...
phar-io/version                                   2.0.1              Library for handling version informati...
phpdocumentor/reflection-common                   1.0.1              Common reflection classes used by phpd...
phpdocumentor/reflection-docblock                 4.3.1              With this component, a library can pro...
phpdocumentor/type-resolver                       0.4.0             
phpspec/prophecy                                  1.8.1              Highly opinionated mocking framework f...
phpunit/php-code-coverage                         7.0.7              Library that provides collection, proc...
phpunit/php-file-iterator                         2.0.2              FilterIterator implementation that fil...
phpunit/php-text-template                         1.2.1              Simple template engine.
phpunit/php-timer                                 2.1.2              Utility class for timing
phpunit/php-token-stream                          3.1.0              Wrapper around PHP's tokenizer extension.
phpunit/phpunit                                   8.3.3              The PHP Unit Testing framework.
psr/cache                                         1.0.1              Common interface for caching libraries
psr/container                                     1.0.0              Common Container Interface (PHP FIG PS...
psr/http-message                                  1.0.1              Common interface for HTTP messages
psr/log                                           1.1.0              Common interface for logging libraries
psr/simple-cache                                  1.0.1              Common interfaces for simple caching
ralouphie/getallheaders                           3.0.3              A polyfill for getallheaders.
sebastian/code-unit-reverse-lookup                1.0.1              Looks up which function or method a li...
sebastian/comparator                              3.0.2              Provides the functionality to compare ...
sebastian/diff                                    3.0.2              Diff implementation
sebastian/environment                             4.2.2              Provides functionality to handle HHVM/...
sebastian/exporter                                3.1.0              Provides the functionality to export P...
sebastian/global-state                            3.0.0              Snapshotting of global state
sebastian/object-enumerator                       3.0.3              Traverses array structures and object ...
sebastian/object-reflector                        1.1.1              Allows reflection of object attributes...
sebastian/recursion-context                       3.0.0              Provides functionality to recursively ...
sebastian/resource-operations                     2.0.1              Provides a list of PHP built-in functi...
sebastian/type                                    1.1.3              Collection of value objects that repre...
sebastian/version                                 2.0.1              Library that helps with managing the v...
sheadawson/silverstripe-dependentdropdownfield    2.0.0              A silverstripe dropdown field that has...
sheadawson/silverstripe-linkable                  2.0.0              A couple of handy form fields and obje...
silverstripe/admin                                1.4.1              SilverStripe admin interface
silverstripe/asset-admin                          1.4.1              Asset management for the SilverStripe CMS
silverstripe/assets                               1.4.1              SilverStripe Assets component
silverstripe/blog                                 3.3.0              A fresh take on blogging in Silverstri...
silverstripe/campaign-admin                       1.4.1              SilverStripe campaign admin interface
silverstripe/cms                                  4.4.1              The SilverStripe Content Management Sy...
silverstripe/config                               1.0.15             SilverStripe configuration based on YA...
silverstripe/errorpage                            1.4.1              ErrorPage component for SilverStripe CMS
silverstripe/externallinks                        2.0.4              Adds tracking of broken external links...
silverstripe/framework                            4.4.1              The SilverStripe framework
silverstripe/graphql                              3.1.1              GraphQL server for SilverStripe models...
silverstripe/lumberjack                           2.0.1              A module to make managing pages in a G...
silverstripe/recaptcha                            3.0.0-alpha1       Provides a form field which allows for...
silverstripe/recipe-cms                           4.4.1              SilverStripe recipe for fully featured...
silverstripe/recipe-core                          4.4.1              SilverStripe framework-only core recipe
silverstripe/recipe-plugin                        1.3.0              Helper plugin to install SilverStripe ...
silverstripe/redirectedurls                       dev-master c0d4cde Provides a system for users to configu...
silverstripe/reports                              4.4.1              Reports module for SilverStripe CMS
silverstripe/segment-field                        2.2.2              A reusable approach to segment-generat...
silverstripe/siteconfig                           4.4.1              Site wide settings administration.
silverstripe/spamprotection                       3.0.1              Spam protection module for SilverStripe.
silverstripe/tagfield                             2.3.0              Tag field for SilverStripe
silverstripe/userforms                            5.4.1              UserForms enables CMS users to create ...
silverstripe/vendor-plugin                        1.4.0              Allows vendor modules to expose direct...
silverstripe/versioned                            1.4.1              SilverStripe Versioned component
silverstripe/versioned-admin                      1.2.1              SilverStripe versioned admin interface
stevie-mayhew/silverstripe-svg                    2.2.0              Basic SVG support for SilverStripe
swiftmailer/swiftmailer                           v5.4.12            Swiftmailer, free feature-rich PHP mailer
symbiote/silverstripe-gridfieldextensions         3.2.1              A collection of useful grid field comp...
symfony/cache                                     v3.4.30            Symfony Cache component with PSR-6, PS...
symfony/config                                    v3.4.30            Symfony Config Component
symfony/filesystem                                v4.3.3             Symfony Filesystem Component
symfony/finder                                    v3.4.30            Symfony Finder Component
symfony/polyfill-apcu                             v1.11.0            Symfony polyfill backporting apcu_* fu...
symfony/polyfill-ctype                            v1.11.0            Symfony polyfill for ctype functions
symfony/polyfill-mbstring                         v1.11.0            Symfony polyfill for the Mbstring exte...
symfony/polyfill-php72                            v1.11.0            Symfony polyfill backporting some PHP ...
symfony/translation                               v2.8.50            Symfony Translation Component
symfony/var-dumper                                v4.3.3             Symfony mechanism for exploring and du...
symfony/yaml                                      v3.4.30            Symfony Yaml Component
theseer/tokenizer                                 1.1.3              A small library for converting tokeniz...
tractorcow/classproxy                             0.1.2             
tractorcow/silverstripe-autocomplete              4.0.0-beta1        Autocomplete text field for Silverstripe
tractorcow/silverstripe-proxy-db                  0.1.0             
unclecheese/display-logic                         2.0.2              Allows assignment of conditions for di...
undefinedoffset/silverstripe-nocaptcha            2.0.4              A spam protector and form field using ...
undefinedoffset/sortablegridfield                 2.0.8              Adds drag and drop functionality to Si...
webmozart/assert                                  1.4.0              Assertions to validate method input/ou...
webonyx/graphql-php                               v0.12.6            A PHP port of GraphQL reference implem...
willdurand/geocoder                               v3.3.0             The almost missing Geocoder PHP 5.4 li...
wilr/silverstripe-googlesitemaps                  2.1.5              SilverStripe support for the Google Si...
zendframework/zend-diactoros                      1.8.6              PSR HTTP Message implementations

Following configuration at app/_config/requirements.yml resolved the issue:

SilverStripe\View\Requirements:
  disable_flush_combined: true
SilverStripe\View\Requirements_Backend:
  combine_in_dev: true
  combine_hash_querystring: true
  default_combined_files_folder: 'combined'
SilverStripe\Core\Injector\Injector:
  # Create adapter that points to the custom directory root
  SilverStripe\Assets\Flysystem\PublicAdapter.custom-adapter:
    class: SilverStripe\Assets\Flysystem\PublicAssetAdapter
    constructor:
      Root: ./app/javascript
  # Set flysystem filesystem that uses this adapter
  League\Flysystem\Filesystem.custom-filesystem:
    class: 'League\Flysystem\Filesystem'
    constructor:
      Adapter: '%$SilverStripe\Assets\Flysystem\PublicAdapter.custom-adapter'
  # Create handler to generate assets using this filesystem
  SilverStripe\Assets\Storage\GeneratedAssetHandler.custom-generated-assets:
    class: SilverStripe\Assets\Flysystem\GeneratedAssets
    properties:
      Filesystem: %$League\Flysystem\Filesystem.custom-filesystem
  # Assign this generator to the requirements builder
  SilverStripe\View\Requirements_Backend:
    properties:
      AssetHandler: '%$SilverStripe\Assets\Storage\GeneratedAssetHandler.custom-generated-assets'

Don't know why had no time to debug

a2nt commented 5 years ago

UPD: made a request to /admin/pages?flush, confirmed action - the issue reappeared, made another request to /dev/build?flush - the issue disappeared

dnsl48 commented 5 years ago

the issue reappeared

is it still the same issue that was reported in the first message?

a2nt commented 5 years ago

the issue reappeared

is it still the same issue that was reported in the first message?

unable to load tinyMCE from assets/_tinymce/tinymce-cms-hash.js and as the result tinyMCE.editor initializing function is undefined

I suppose tinymce-cms-hash.js file deleted on ?flush, but SS doesn't regenerate it without /dev/build So something wrong happens on ?flush and looks like /dev/build?flush sometimes doesn't regenerate the file too

robbieaverill commented 5 years ago

I haven't been able to reproduce this issue yet on my local dev environment, but I can see how it could potentially be an issue.

When you flush from the frontend, TinyMCECombinedGenerator::flush() is called which deletes the TinyMCE JavaScript file. The is regenerated via HTMLEditorField::Field() which calls TinyMCEConfig::init() - this in turn calls TinyMCECombinedGenerator::generateContent() via a chain.

If you were to do this on a scaled server setup where the assets folder hasn't had a chance to synchronise between instances, there may be a short period of time where you could experience this issue.

There were some notes that this was reproducible in a local (single) environment though, which is interesting.

We might be able to regenerate the file content on flush after it has been deleted - the problem with that is that flush() doesn't care about which TinyMCE config instance is active, it just nukes all of them. We could easily regenerate the default config by adding static::singleton()->getScriptURL(TinyMCEConfig::get()) after it has deleted the folder.

It sounds like the browser call to get the JS is happening before it has been generated. Since the Requirements call that adds it (TinyMCEConfig::init()) internally generates it if it doesn't exist, I'm not really sure why this would happen anyway.

Some thoughts anyway - I'm not able to reproduce this