{"action":"created","issue":{"url":"https://api.github.com/repos/WordPress/gutenberg/issues/4678","repository_url":"https://api.github.com/repos/WordPress/gutenberg","labels_url":"https://api.github.com/repos/WordPress/gutenberg/issues/4678/labels{/name}","comments_url":"https://api.github.com/repos/WordPress/gutenberg/issues/4678/comments","events_url":"https://api.github.com/repos/WordPress/gutenberg/issues/4678/events","html_url":"https://github.com/WordPress/gutenberg/issues/4678","id":291661408,"number":4678,"title":"Classic Editor fails to load in Visual edit","user":{"login":"bobbingwide","id":2474435,"avatar_url":"https://avatars2.githubusercontent.com/u/2474435?v=4","gravatar_id":"","url":"https://api.github.com/users/bobbingwide","html_url":"https://github.com/bobbingwide","followers_url":"https://api.github.com/users/bobbingwide/followers","following_url":"https://api.github.com/users/bobbingwide/following{/other_user}","gists_url":"https://api.github.com/users/bobbingwide/gists{/gist_id}","starred_url":"https://api.github.com/users/bobbingwide/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bobbingwide/subscriptions","organizations_url":"https://api.github.com/users/bobbingwide/orgs","repos_url":"https://api.github.com/users/bobbingwide/repos","events_url":"https://api.github.com/users/bobbingwide/events{/privacy}","received_events_url":"https://api.github.com/users/bobbingwide/received_events","type":"User","site_admin":false},"labels":[{"id":816933178,"url":"https://api.github.com/repos/WordPress/gutenberg/labels/Needs%20Testing","name":"Needs Testing","color":"67dff7","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-01-25T17:58:51Z","updated_at":"2018-02-14T23:12:09Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"<!--\r\nBEFORE POSTING YOUR ISSUE:\r\n- These comments won't show up when you submit the issue.\r\n- Try to add as much detail as possible. Be specific!\r\n- Please add the version of Gutenberg you are using in the description.\r\n- If you're requesting a new feature, explain why you'd like it to be added.\r\n- Search this repository for issues and pull requests and whether it has been fixed or reported already.\r\n- Ensure you are using the latest code before logging bugs.\r\n- Disable all plugins to ensure it's not a plugin conflict issue.\r\n- To report a security issue, please visit the WordPress HackerOne program: https://hackerone.com/wordpress.\r\n-->\r\n\r\n## Issue Overview\r\nIf an extension plugin responds to `enqueue_block_assets` and it enqueues its own script, with dependencies on Gutenberg's scripts, then this can break the Classic Editor in Visual mode.\r\n\r\n<!-- This is a brief overview of the issue --->\r\n\r\n## Steps to Reproduce (for bugs)\r\n<!-- Provide a link to a live example, or an unambiguous set of steps to -->\r\n<!-- reproduce this bug. Include code to reproduce, if relevant -->\r\n\r\n1. Deactivate Gutenberg\r\n2. Create a new post in Text mode with any content you like.\r\n3. Save\r\n4. Activate Gutenberg and a plugin that responds to `enqueue_block_assets` using code similar to below.\r\n5. Edit the post using the Classic Editor.\r\n6. Attempt to switch to Visual.\r\n7. The Visual editor does not load.\r\n\r\n```\r\n    wp_enqueue_script(\r\n        'oik_block-blocks-frontend-js',\r\n        plugins_url( $blockPath, __FILE__ ),\r\n        [ 'wp-i18n', 'wp-element', 'wp-blocks', 'wp-components', 'wp-api' ],\r\n        filemtime( plugin_dir_path(__FILE__) . $blockPath )\r\n    );\r\n```\r\n\r\n<!-- Provide what browser you are using and any other specifics to your setup -->\r\n\r\n## Expected Behavior\r\nYou should be able to toggle between the Text and Visual editor modes without failure. \r\n<!-- If you're describing a bug, tell us what should happen -->\r\n<!-- If you're suggesting a change/improvement, tell us how it should work -->\r\n\r\n## Current Behavior\r\nYou can merrily edit in Text mode, but attempting to switch to Visual will lead to an empty TinyMCE window with no icons. Once this has happened it's very difficult to get back to Text without deactivating a plugin or two.  \r\n<!-- If describing a bug, tell us what happens instead of the expected behavior -->\r\n<!-- If suggesting a change/improvement, explain the difference from current behavior -->\r\n\r\n## Possible Solution\r\nWhen using the Classic Editor there should be no need for Gutenberg blocks.\r\nThe `classic-editor` parameter is passed in the request and is available from `$_GET`.\r\n\r\nA new test is required to avoid invoking `enqueue_block_assets`.\r\n\r\nAs a workaround, for my plugin, I added the test to my own action hook function.\r\n\r\n\r\n<!-- Not obligatory, but suggest a fix/reason for the bug, -->\r\n<!-- or ideas how to implement the addition or change -->\r\n\r\n## Screenshots / Video\r\n<!-- Visual records are oxygen for others to understand what you are sharing -->\r\n![image](https://user-images.githubusercontent.com/2474435/35405431-07bd2e46-01fe-11e8-8bd0-5a27224b7c71.png)\r\n\r\n\r\n\r\n\r\n## Related Issues and/or PRs\r\n<!-- List related issues or PRs against other branches -->\r\nThis was originally raised as Scenario 3 in #4672.\r\n\r\n## Todos\r\n- [ ] Tests\r\n- [ ] Documentation\r\n"},"comment":{"url":"https://api.github.com/repos/WordPress/gutenberg/issues/comments/365776300","html_url":"https://github.com/WordPress/gutenberg/issues/4678#issuecomment-365776300","issue_url":"https://api.github.com/repos/WordPress/gutenberg/issues/4678","id":365776300,"user":{"login":"bobbingwide","id":2474435,"avatar_url":"https://avatars2.githubusercontent.com/u/2474435?v=4","gravatar_id":"","url":"https://api.github.com/users/bobbingwide","html_url":"https://github.com/bobbingwide","followers_url":"https://api.github.com/users/bobbingwide/followers","following_url":"https://api.github.com/users/bobbingwide/following{/other_user}","gists_url":"https://api.github.com/users/bobbingwide/gists{/gist_id}","starred_url":"https://api.github.com/users/bobbingwide/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bobbingwide/subscriptions","organizations_url":"https://api.github.com/users/bobbingwide/orgs","repos_url":"https://api.github.com/users/bobbingwide/repos","events_url":"https://api.github.com/users/bobbingwide/events{/privacy}","received_events_url":"https://api.github.com/users/bobbingwide/received_events","type":"User","site_admin":false},"created_at":"2018-02-14T23:12:08Z","updated_at":"2018-02-14T23:12:08Z","author_association":"CONTRIBUTOR","body":"There's a similar problem with the Text Widget. \r\nWe'll have to put some more work into PR 4693."}}
{"actor":{"display_login":"bobbingwide"}}