2

How can I fix the AJAX HTTP error 500 to make the "Edit media" button in the body of the CKeditor work?

I am trying to use the "Edit media" function to edit an image, which was directly uploaded in the CKeditor with the Media button. The image itself can be easily uploaded directly or inserted from the Media Library. However an AJAX HTTP error 500 occurs and prevents the server from loading, as soon I click on the Edit button. This affects all image sizes, and occurs both locally and on production.

enter image description here

I used Mac OS X El Capitan Version 10.11.6 to set up this Drupal 8 page with the core-dev 8.8. The site was built with composer on MAMP Pro 5.3.

Php 7.0.8 is used. The modules involved in the issue are Paragraphs, Language and Media. I tested this in Chrome 85.0.4183.121 (Official Build) (64-bit), Firefox 75.0 (64-bit), Firefox Developer 78.0b9 (64-bit).

This is the log message that accompanies the issue:

enter image description here

The full error message is as follows:

An AJAX HTTP error occurred. HTTP Result Code: 500 Debugging information follows. Path: /editor/dialog/media/full_html StatusText: 500 Service unavailable (with message) ResponseText: The website encountered an unexpected error. Please try again later.Symfony\Component\Routing\Exception\MethodNotAllowedException: in Drupal\Core\Routing\MethodFilter->filter() (line 46 of core/lib/Drupal/Core/Routing/MethodFilter.php). Drupal\Core\Routing\Router->applyRouteFilters(Object, Object) (Line: 127) Drupal\Core\Routing\Router->matchRequest(Object) (Line: 92) Drupal\Core\Routing\AccessAwareRouter->matchRequest(Object) (Line: 150) Drupal\Core\Routing\AccessAwareRouter->match('/editor/dialog/media/full_html') (Line: 138) Drupal\user\Plugin\LanguageNegotiation\LanguageNegotiationUserAdmin->isAdminPath(Object) (Line: 104) Drupal\user\Plugin\LanguageNegotiation\LanguageNegotiationUserAdmin->getLangcode(Object) (Line: 186) Drupal\language\LanguageNegotiator->negotiateLanguage('language_interface', 'language-user-admin') (Line: 131) Drupal\language\LanguageNegotiator->initializeType('language_interface') (Line: 218) Drupal\language\ConfigurableLanguageManager->getCurrentLanguage() (Line: 92) Drupal\language\EventSubscriber\LanguageRequestSubscriber->setLanguageOverrides() (Line: 74) Drupal\language\EventSubscriber\LanguageRequestSubscriber->onKernelRequestLanguage(Object, 'kernel.request', Object) call_user_func(Array, Object, 'kernel.request', Object) (Line: 111) Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.request', Object) (Line: 127) Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68) Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57) Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47) Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106) Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85) Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47) Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52) Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23) Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 708) Drupal\Core\DrupalKernel->handle(Object) (Line: 19) "

4
  • 1
    Welcome to Drupal Answers! đź‘‹ Remember to include a question in your post, right now it's just stating facts. Next you must include the steps to reproduce this issue from a fresh Drupal installation, as there are too many unknown variables: your page setup and config, and all involved modules, your server setup and config, your browser name and version, the OS, the size and type of the file you tried to upload etc.
    – leymannx
    Oct 7 '20 at 12:45
  • Thank you so much for your guidance @leymannx! I edited the post and actually inserted the question this time, as per your instructions. Please let me know if this works now. I would be most grateful if I could get some help to fix my issue.
    – Tita
    Oct 8 '20 at 8:35
  • Googling for that error MethodNotAllowedException and ckeditor gives me drupal.org/project/drupal/issues/3119247 for example. Did you check file system permissions and ownership already? Also maybe try out the patch from drupal.org/project/drupal/issues/2706241.
    – leymannx
    Oct 8 '20 at 11:49
  • 1
    Thanks again! This patch fixed my problem, indeed: drupal.org/files/issues/2018-12-12/2706241-34.patch
    – Tita
    Oct 9 '20 at 9:24

Browse other questions tagged or ask your own question.