When I click the image icon in CKEditor I get a "loading" message and thats all, I can never add an inline image (node, content block etc, makes no difference).

Note the very first time I try to add an image it pops up the dialog (very first time after a clean install), but on subsequent attempts to add an image the dialog never appears etc.

CommentFileSizeAuthor
Create Article D8 Nov 7.png134.48 KBJeff Burnz

Comments

Jeff Burnz created an issue. See original summary.

cilefen’s picture

Priority: Major » Normal

I cannot reproduce this on HEAD. Please post whatever errors are seen in your browser's console log and any PHP errors in the server log.

casismary’s picture

Like cilefen I cannot reproduce the issue as well on 8.0.x-dev, with the admin theme as seven.
Tested with Chrome on mac.

Jeff Burnz’s picture

There are two console errors logged, I'll check for PHP errors shortly:

POST http://d8nov7:8888/editor/dialog/image/basic_html?_wrapper_format=drupal_modal 500 (Internal Server Error)k.cors.a.crossDomain.send @ jquery.js:8630n.extend.ajax @ jquery.js:8166Drupal.Ajax.execute @ ajax.js?v=8.0.0-dev:496Drupal.ckeditor.openDialog @ ckeditor.js?v=8.0.0-dev:238editor.addCommand.exec @ plugin.js?t=FA3A:238exec @ ckeditor.js?v=4.5.4:172window.CKEDITOR.window.CKEDITOR.dom.CKEDITOR.tools.extend.execCommand @ ckeditor.js?v=4.5.4:235(anonymous function) @ plugin.js?t=FA3A:215b @ ckeditor.js?v=4.5.4:10window.CKEDITOR.window.CKEDITOR.dom.CKEDITOR.event.CKEDITOR.event.fire @ ckeditor.js?v=4.5.4:11window.CKEDITOR.window.CKEDITOR.dom.e.edit @ ckeditor.js?v=4.5.4:998a.addCommand.exec @ ckeditor.js?v=4.5.4:958exec @ ckeditor.js?v=4.5.4:172window.CKEDITOR.window.CKEDITOR.dom.CKEDITOR.tools.extend.execCommand @ ckeditor.js?v=4.5.4:235CKEDITOR.tools.extend.click @ ckeditor.js?v=4.5.4:666p.execute @ ckeditor.js?v=4.5.4:667(anonymous function) @ ckeditor.js?v=4.5.4:668(anonymous function) @ ckeditor.js?v=4.5.4:29window.CKEDITOR.window.CKEDITOR.dom.CKEDITOR.tools.callFunction @ ckeditor.js?v=4.5.4:29onclick @ article:1

Uncaught AjaxError: 
An AJAX HTTP error occurred.
HTTP Result Code: 500
Debugging information follows.
Path: /editor/dialog/image/basic_html
StatusText: Internal Server Error
ResponseText: {}Drupal.Ajax.error @ ajax.js?v=8.0.0-dev:815ajax.options.complete @ ajax.js?v=8.0.0-dev:419j @ jquery.js:3099k.fireWith @ jquery.js:3211x @ jquery.js:8279(anonymous function) @ jquery.js:8605

I am using Chrome on OSX.

cilefen’s picture

This is unusual. CORS errors indicate there is some kind of disconnect between where your site is served and where it tried to POST when the button was clicked. Is this site being browsed on http://d8nov7:8888?

Did this install change URLs recently? A drush cr may help.

cilefen’s picture

Title: Can''t add inline images » CORS JavaScript error when toolbar image button is pressed
Issue tags: +JavaScript
Jeff Burnz’s picture

Yes, its being browsed on http://d8nov7:8888.
No change to the URL, clean install on Mamp Pro.

Note I am using Seven admin theme for editing content.

I am getting this error:

Drupal\Core\Asset\Exception\InvalidLibrariesExtendSpecificationException: The specified library "classy/file" does not exist. in Drupal\Core\Asset\LibraryDiscoveryCollector->applyLibrariesExtend() (line 168 of /Users/jmburnz/Sites/contrib/drupal8head/nov7/drupal/core/lib/Drupal/Core/Asset/LibraryDiscoveryCollector.php).

OK, heres the very strange bit... I have this in my front end theme:

libraries-override:
  classy/file: false

I actually set false on all the Classy libraries and load my own in hook_page_attachments_alter(), if I remove this classy/file: false, everything works (the modal pops up and I can add images etc).

This seems very strange to me since I am actually using Seven as my admin theme for adding/editing content, not my front end custom theme.

cilefen’s picture

Title: CORS JavaScript error when toolbar image button is pressed » CORS JavaScript error from a InvalidLibrariesExtendSpecificationException when using libraries-override on a Classy library and toolbar image button is pressed
Component: ckeditor.module » theme system
Issue tags: -JavaScript

Based on this interesting discovery I am moving this issue to the theme system component because the problem is there.

Jeff Burnz’s picture

Component: theme system » asset library system

Lets get some asset library team eyes on this, are you there Wim? :)

I have worked around this by removing the library-override from the info file and unset the libraries in hook_page_attachments_alter().

star-szr’s picture

It may have something to do with the fact that classy/file is a libraries-extend of file/drupal.file. So there may be a bug where removing classy/file (the library extending another library) removes the library/libraries it's extending as well.

technotim2010’s picture

I have this same issue on a D8 site runing 8.0.1 but using a subtheme of the Adaptive Theme. Error logges

Drupal\Core\Asset\Exception\InvalidLibrariesExtendSpecificationException: The specified library "classy/file" does not exist. in Drupal\Core\Asset\LibraryDiscoveryCollector->applyLibrariesExtend() (line 168 of /var/www/html/d8/core/lib/Drupal/Core/Asset/LibraryDiscoveryCollector.php).

I reverted to Bartik (which is based on Classy) and can confirm this issue is resolved.

Should I cross post on the Adaptive Theme issue queue or is this a Core issue?

Regards

Tim

Jeff Burnz’s picture

#11, see #7, the bug is in Drupal, your sub theme is doing something you are supposed to be able to do in a drupal theme.

To work around this bug you can manually remove this code from your theme .info.yml file:

libraries-override:
  classy/file: false

This is OK as long as you are running the latest dev of Adaptivetheme because it no longer relies on Classy.

technotim2010’s picture

Hi

I have updated to the latest version of adaptive theme, created a new subtheme and can confirm the fix in #12 works.

Totally buggered my theming though!!! What are Sundays for though, (hello git my old friend)

Tim

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

larowlan’s picture