AI Translate not translating to Spanish (or any language)

Created on 5 September 2025, 8 days ago

Problem/Motivation

I will outline my setup in steps to reproduce. I'm using a fresh, local Drupal CMS installation in ddev. I'm editing a Basic Page node which uses CK Editor for the description. I've toggled over to "Spanish" and I want to translate my content to Spanish using the CK Editor Translate tool. I believe I have everything configured for languages, but I'll go into more depth. I'm seeing an error, most likely related to when I attempt to translate. When I click translate, nothing happens. I waited for at least 15 minutes and nothing is happening. No messaging about what the AI assistant is doing in real time. Nothing is happening in the Translate API Explorer either. I've tried a couple models provided by Amazee.

Error: Call to a member function getName() on null in Drupal\ai_ckeditor\Plugin\AICKEditor\Translate->ajaxGenerate() (line 204 of /var/www/html/web/modules/contrib/ai/modules/ai_ckeditor/src/Plugin/AiCKEditor/Translate.php)

I will attach the full trace as a text file.

Steps to reproduce (required for bugs, but not feature requests)

Using Drupal CMS. My provider is Amazee.ai. I've installed the AI core module, API Explorer and AI Translate submodule. In AI Default Settings, I configured Amazee under Translate using their "chat" model. I configured Languages to support "Spanish". I configured Languages to support the Basic Page content type. The Language selector does show up while editing a Basic Page. I configured a Taxonomy for Languages, and I'm able to select Spanish in the AI Translate dialog box. I configured CK Editor, in the text format that I'm using, to use the AI Assistant. I configured Translate in CK Editor to use the provider.

To reproduce, make sure Spanish is configured in Languages in Drupal. Make sure the Basic Page content type is configured in Languages, under "Content language and translation". Create a Language taxonomy vocabulary with English and Spanish as taxonomy items. Configure AI Default settings with a provider for Translate. Configure a text format with AI Assistant, making sure to configure the sub-option for Translate in the text format settings.

Test the API Explorer. This will tell you if it's working at all. If it is, test the AI Assistant. I haven't been able to get anything working in the Explorer.

Proposed resolution

...

Remaining tasks

...

Optional: Other details as applicable (e.g., User interface changes, API changes, Data model changes)

...

💬 Support request
Status

Active

Version

1.1

Component

...to be triaged

Created by

🇺🇸United States rraney

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @rraney
  • 🇺🇸United States rraney
  • 🇺🇸United States rraney
  • 🇺🇸United States rraney

    I'm seeing another error triggered by using the CK Editor AI Assistant.

    Warning: Undefined array key 4 in Drupal\ai_ckeditor\Plugin\AICKEditor\Translate->ajaxGenerate() (line 204 of /var/www/html/web/modules/contrib/ai/modules/ai_ckeditor/src/Plugin/AiCKEditor/Translate.php)

    #0 /var/www/html/web/core/includes/bootstrap.inc(104): _drupal_error_handler_real()
    #1 /var/www/html/web/modules/contrib/ai/modules/ai_ckeditor/src/Plugin/AiCKEditor/Translate.php(204): _drupal_error_handler()
    #2 [internal function]: Drupal\ai_ckeditor\Plugin\AICKEditor\Translate->ajaxGenerate()
    #3 /var/www/html/web/core/lib/Drupal/Core/Form/FormAjaxResponseBuilder.php(69): call_user_func_array()
    #4 /var/www/html/web/core/lib/Drupal/Core/Form/EventSubscriber/FormAjaxSubscriber.php(112): Drupal\Core\Form\FormAjaxResponseBuilder->buildResponse()
    #5 /var/www/html/vendor/symfony/event-dispatcher/EventDispatcher.php(246): Drupal\Core\Form\EventSubscriber\FormAjaxSubscriber->onException()
    #6 /var/www/html/vendor/symfony/event-dispatcher/EventDispatcher.php(206): Symfony\Component\EventDispatcher\EventDispatcher::Symfony\Component\EventDispatcher\{closure}()
    #7 /var/www/html/vendor/symfony/event-dispatcher/EventDispatcher.php(56): Symfony\Component\EventDispatcher\EventDispatcher->callListeners()
    #8 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(241): Symfony\Component\EventDispatcher\EventDispatcher->dispatch()
    #9 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(91): Symfony\Component\HttpKernel\HttpKernel->handleThrowable()
    #10 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/Session.php(53): Symfony\Component\HttpKernel\HttpKernel->handle()
    #11 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
    #12 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
    #13 /var/www/html/web/core/modules/big_pipe/src/StackMiddleware/ContentLength.php(32): Drupal\Core\StackMiddleware\ContentLength->handle()
    #14 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(116): Drupal\big_pipe\StackMiddleware\ContentLength->handle()
    #15 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(90): Drupal\page_cache\StackMiddleware\PageCache->pass()
    #16 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle()
    #17 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
    #18 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(53): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
    #19 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle()
    #20 /var/www/html/web/core/lib/Drupal/Core/DrupalKernel.php(715): Drupal\Core\StackMiddleware\StackedHttpKernel->handle()
    #21 /var/www/html/web/index.php(19): Drupal\Core\DrupalKernel->handle()
    #22 {main}

  • 🇬🇧United Kingdom yautja_cetanu

    A couple of things:

    - Translate using the AI Translation is different to CK Editor, Translate translates the whole page and uses the tabs along the top of the page when enabled. It's a blunt instrument and is aimed at just working.
    - The CK Editor Translation plugin is different, it uses a taxonomy for the languages and you get to it by going to the CKEditor settings and enabling the translate with AI AI Assistant plugin for that specific CKEditor toolbar for that style (such as the WYSIWYG style).

    - It's probably worth enabling the AI Logging module and going into the AI Logging settings and enabling it to see what happens and posting that here too.
    - Its also worth checking the default AI settings to make sure something has been set for all of the different operations and the model that has been set has the ability to do the translation. Providers can set defaults, the amazee provider may need defaults.

  • 🇺🇸United States rraney

    Hello, logging is on. I haven't been able to get AI Translate able to work in Explorer whatsoever. Also, I have Translate configured with Taxonomy, CK Editor, etc. When I try to translate in CK Editor, nothing happens. I have logging enabled. Nothing goes to logging unless it's successful. Nothing is logged because nothing is happening. I don't think it's a provider issue (Amazee.ai) but I'm speaking with them to see if they can get it working. Thus far, I haven't been able to get anything related to Translate working. I realize there are a lot of configuration steps and I think I've covered them all. What I have not tried is creating a custom content type instead of using Basic Page.

    In Basic Page, I'm switching to Spanish in the edit form, then selecting the text and clicking on AI Assistant "Translate". It opens up a dialog box where I can once again choose Spanish from the language vocabulary. When I click "Translate", it says, "AI Writer: Idle" and nothing happens. If I go to logs, there is no record because apparently nothing happens.

  • 🇺🇸United States rraney

    I have some more info. I noticed I'm getting an AJAX error in CK Editor when I click Translate.

    Uncaught Drupal.AjaxError {message: '\nAn AJAX HTTP error occurred.\nHTTP Result Code: 20…ai_ckeditor/src/Plugin/AiCKEditor/Translate.php).', name: 'AjaxError', stack: 'Error\n    at https://amazee-ai.ddev.site:33001/sit…OmXaHjcBE480OOELx0uD-e0bdkvxNe8b_AazOdiw:27:19718'}message: "\nAn AJAX HTTP error occurred.\nHTTP Result Code: 200\nDebugging information follows.\nPath: /api/ai-ckeditor/dialog?_wrapper_format=drupal_modal&ajax_form=1\nStatusText: parsererror\nResponseText: Error: Call to a member function getName() on null in Drupal\\ai_ckeditor\\Plugin\\AICKEditor\\Translate->ajaxGenerate() (line 204 of /var/www/html/web/modules/contrib/ai/modules/ai_ckeditor/src/Plugin/AiCKEditor/Translate.php)."name: "AjaxError"stack: "Error\n    at https://amazee-ai.ddev.site:33001/sites/default/files/js/js_mO82Kt7VyJ7TTGpJdeaLZ2mhUyiCdlvL-aYU8c4vi7c.js?scope=footer&delta=3&language=en&theme=gin&include=eJyNUkt2pDAMvJA7Xs0Rku0cgSeMAL32h1gymb79yNBu0iGLXvBwlcrlsiygzs0gfRI7phwuLBkhGFD6igNJyvbb2kCRxLBiV8V2yGUB__ZEmqb9YykK5qiCu-5ReUXzhmGZgYlfEs8S_HucKOJL8qALMC6NI2K7xY6U1F3_pIA_Co25eIpXDZQy2sMMPE0xYJRTQftSWwKnSu-Tu36WJPizQnH4xamee-b4pFuABT9yCn_HkdzJPGNIK378GolTyQ7fFVGcfhYFen93a2_uhFa8HMEezfIeFn4Ws4AgP1GbY0ZeUmQ1MiN5faxW3ZHR97R1UxdhpQmEUtw4_TpwrjaqQYq0g1D1NZ0abwTTgD3sZizkrjdTU5Mc9zPbPHSe-gz5Zr9omFCUjKUr1DLdoTmyHAP2LV9Mw-OSdW0WkLkRdb0RdTTaOexmHIp2w66YNaDOmXaHjcBE480OOELx0uD-e0bdkvxNe8b_AazOdiw:27:2411\n    at https://amazee-ai.ddev.site:33001/sites/default/files/js/js_mO82Kt7VyJ7TTGpJdeaLZ2mhUyiCdlvL-aYU8c4vi7c.js?scope=footer&delta=3&language=en&theme=gin&include=eJyNUkt2pDAMvJA7Xs0Rku0cgSeMAL32h1gymb79yNBu0iGLXvBwlcrlsiygzs0gfRI7phwuLBkhGFD6igNJyvbb2kCRxLBiV8V2yGUB__ZEmqb9YykK5qiCu-5ReUXzhmGZgYlfEs8S_HucKOJL8qALMC6NI2K7xY6U1F3_pIA_Co25eIpXDZQy2sMMPE0xYJRTQftSWwKnSu-Tu36WJPizQnH4xamee-b4pFuABT9yCn_HkdzJPGNIK378GolTyQ7fFVGcfhYFen93a2_uhFa8HMEezfIeFn4Ws4AgP1GbY0ZeUmQ1MiN5faxW3ZHR97R1UxdhpQmEUtw4_TpwrjaqQYq0g1D1NZ0abwTTgD3sZizkrjdTU5Mc9zPbPHSe-gz5Zr9omFCUjKUr1DLdoTmyHAP2LV9Mw-OSdW0WkLkRdb0RdTTaOexmHIp2w66YNaDOmXaHjcBE480OOELx0uD-e0bdkvxNe8b_AazOdiw:27:19718"[[Prototype]]: Error
        at https://amazee-ai.ddev.site:33001/sites/default/files/js/js_mO82Kt7VyJ7TTGpJdeaLZ2mhUyiCdlvL-aYU8c4vi7c.js?scope=footer&delta=3&language=en&theme=gin&include=eJyNUkt2pDAMvJA7Xs0Rku0cgSeMAL32h1gymb79yNBu0iGLXvBwlcrlsiygzs0gfRI7phwuLBkhGFD6igNJyvbb2kCRxLBiV8V2yGUB__ZEmqb9YykK5qiCu-5ReUXzhmGZgYlfEs8S_HucKOJL8qALMC6NI2K7xY6U1F3_pIA_Co25eIpXDZQy2sMMPE0xYJRTQftSWwKnSu-Tu36WJPizQnH4xamee-b4pFuABT9yCn_HkdzJPGNIK378GolTyQ7fFVGcfhYFen93a2_uhFa8HMEezfIeFn4Ws4AgP1GbY0ZeUmQ1MiN5faxW3ZHR97R1UxdhpQmEUtw4_TpwrjaqQYq0g1D1NZ0abwTTgD3sZizkrjdTU5Mc9zPbPHSe-gz5Zr9omFCUjKUr1DLdoTmyHAP2LV9Mw-OSdW0WkLkRdb0RdTTaOexmHIp2w66YNaDOmXaHjcBE480OOELx0uD-e0bdkvxNe8b_AazOdiw:27:2411
        at https://amazee-ai.ddev.site:33001/sites/default/files/js/js_mO82Kt7VyJ7TTGpJdeaLZ2mhUyiCdlvL-aYU8c4vi7c.js?scope=footer&delta=3&language=en&theme=gin&include=eJyNUkt2pDAMvJA7Xs0Rku0cgSeMAL32h1gymb79yNBu0iGLXvBwlcrlsiygzs0gfRI7phwuLBkhGFD6igNJyvbb2kCRxLBiV8V2yGUB__ZEmqb9YykK5qiCu-5ReUXzhmGZgYlfEs8S_HucKOJL8qALMC6NI2K7xY6U1F3_pIA_Co25eIpXDZQy2sMMPE0xYJRTQftSWwKnSu-Tu36WJPizQnH4xamee-b4pFuABT9yCn_HkdzJPGNIK378GolTyQ7fFVGcfhYFen93a2_uhFa8HMEezfIeFn4Ws4AgP1GbY0ZeUmQ1MiN5faxW3ZHR97R1UxdhpQmEUtw4_TpwrjaqQYq0g1D1NZ0abwTTgD3sZizkrjdTU5Mc9zPbPHSe-gz5Zr9omFCUjKUr1DLdoTmyHAP2LV9Mw-OSdW0WkLkRdb0RdTTaOexmHIp2w66YNaDOmXaHjcBE480OOELx0uD-e0bdkvxNe8b_AazOdiw:27:19718
    Drupal.Ajax.error @ js_mO82Kt7VyJ7TTGpJdeaLZ2mhUyiCdlvL-aYU8c4vi7c.js?scope=footer&delta=3&language=en&theme=gin&include=eJyNUkt2pDAMvJA7Xs0Rku0cgSeMAL32h1gymb79yNBu0iGLXvBwlcrlsiygzs0gfRI7phwuLBkhGFD6igNJyvbb2kCRxLBiV8V2yGUB__ZEmqb9YykK5qiCu-5ReUXzhmGZgYlfEs8S_HucKOJL8qALMC6NI2K7xY6U1F3_pIA_Co25eIpXDZQy2sMMPE0xYJRTQftSWwKnSu-Tu36WJPizQnH4xamee-b4pFuABT9yCn_HkdzJPGNIK378GolTyQ7fFVGcfhYFen93a2_uhFa8HMEezfIeFn4Ws4AgP1GbY0ZeUmQ1MiN5faxW3ZHR97R1UxdhpQmEUtw4_TpwrjaqQYq0g1D1NZ0abwTTgD3sZizkrjdTU5Mc9zPbPHSe-gz5Zr9omFCUjKUr1DLdoTmyHAP2LV9Mw-OSdW0WkLkRdb0RdTTaOexmHIp2w66YNaDOmXaHjcBE480OOELx0uD-e0bdkvxNe8b_AazOdiw:27
    complete @ js_mO82Kt7VyJ7TTGpJdeaLZ2mhUyiCdlvL-aYU8c4vi7c.js?scope=footer&delta=3&language=en&theme=gin&include=eJyNUkt2pDAMvJA7Xs0Rku0cgSeMAL32h1gymb79yNBu0iGLXvBwlcrlsiygzs0gfRI7phwuLBkhGFD6igNJyvbb2kCRxLBiV8V2yGUB__ZEmqb9YykK5qiCu-5ReUXzhmGZgYlfEs8S_HucKOJL8qALMC6NI2K7xY6U1F3_pIA_Co25eIpXDZQy2sMMPE0xYJRTQftSWwKnSu-Tu36WJPizQnH4xamee-b4pFuABT9yCn_HkdzJPGNIK378GolTyQ7fFVGcfhYFen93a2_uhFa8HMEezfIeFn4Ws4AgP1GbY0ZeUmQ1MiN5faxW3ZHR97R1UxdhpQmEUtw4_TpwrjaqQYq0g1D1NZ0abwTTgD3sZizkrjdTU5Mc9zPbPHSe-gz5Zr9omFCUjKUr1DLdoTmyHAP2LV9Mw-OSdW0WkLkRdb0RdTTaOexmHIp2w66YNaDOmXaHjcBE480OOELx0uD-e0bdkvxNe8b_AazOdiw:27
    options.complete @ js_UcQW3OsKd-Z2I4et8JdRgvScMEC4IwouxWEyy_pgv4Q.js?scope=footer&delta=6&language=en&theme=gin&include=eJyNUkt2pDAMvJA7Xs0Rku0cgSeMAL32h1gymb79yNBu0iGLXvBwlcrlsiygzs0gfRI7phwuLBkhGFD6igNJyvbb2kCRxLBiV8V2yGUB__ZEmqb9YykK5qiCu-5ReUXzhmGZgYlfEs8S_HucKOJL8qALMC6NI2K7xY6U1F3_pIA_Co25eIpXDZQy2sMMPE0xYJRTQftSWwKnSu-Tu36WJPizQnH4xamee-b4pFuABT9yCn_HkdzJPGNIK378GolTyQ7fFVGcfhYFen93a2_uhFa8HMEezfIeFn4Ws4AgP1GbY0ZeUmQ1MiN5faxW3ZHR97R1UxdhpQmEUtw4_TpwrjaqQYq0g1D1NZ0abwTTgD3sZizkrjdTU5Mc9zPbPHSe-gz5Zr9omFCUjKUr1DLdoTmyHAP2LV9Mw-OSdW0WkLkRdb0RdTTaOexmHIp2w66YNaDOmXaHjcBE480OOELx0uD-e0bdkvxNe8b_AazOdiw:4
    c @ jquery.min.js?v=4.0.0-rc.1:2
    fireWith @ jquery.min.js?v=4.0.0-rc.1:2
    E @ jquery.min.js?v=4.0.0-rc.1:2
    (anonymous) @ jquery.min.js?v=4.0.0-rc.1:2
    XMLHttpRequest.send
    send @ jquery.min.js?v=4.0.0-rc.1:2
    ajax @ jquery.min.js?v=4.0.0-rc.1:2
    $.fn.ajaxSubmit @ js_UcQW3OsKd-Z2I4et8JdRgvScMEC4IwouxWEyy_pgv4Q.js?scope=footer&delta=6&language=en&theme=gin&include=eJyNUkt2pDAMvJA7Xs0Rku0cgSeMAL32h1gymb79yNBu0iGLXvBwlcrlsiygzs0gfRI7phwuLBkhGFD6igNJyvbb2kCRxLBiV8V2yGUB__ZEmqb9YykK5qiCu-5ReUXzhmGZgYlfEs8S_HucKOJL8qALMC6NI2K7xY6U1F3_pIA_Co25eIpXDZQy2sMMPE0xYJRTQftSWwKnSu-Tu36WJPizQnH4xamee-b4pFuABT9yCn_HkdzJPGNIK378GolTyQ7fFVGcfhYFen93a2_uhFa8HMEezfIeFn4Ws4AgP1GbY0ZeUmQ1MiN5faxW3ZHR97R1UxdhpQmEUtw4_TpwrjaqQYq0g1D1NZ0abwTTgD3sZizkrjdTU5Mc9zPbPHSe-gz5Zr9omFCUjKUr1DLdoTmyHAP2LV9Mw-OSdW0WkLkRdb0RdTTaOexmHIp2w66YNaDOmXaHjcBE480OOELx0uD-e0bdkvxNe8b_AazOdiw:4
    Drupal.Ajax.eventResponse @ js_mO82Kt7VyJ7TTGpJdeaLZ2mhUyiCdlvL-aYU8c4vi7c.js?scope=footer&delta=3&language=en&theme=gin&include=eJyNUkt2pDAMvJA7Xs0Rku0cgSeMAL32h1gymb79yNBu0iGLXvBwlcrlsiygzs0gfRI7phwuLBkhGFD6igNJyvbb2kCRxLBiV8V2yGUB__ZEmqb9YykK5qiCu-5ReUXzhmGZgYlfEs8S_HucKOJL8qALMC6NI2K7xY6U1F3_pIA_Co25eIpXDZQy2sMMPE0xYJRTQftSWwKnSu-Tu36WJPizQnH4xamee-b4pFuABT9yCn_HkdzJPGNIK378GolTyQ7fFVGcfhYFen93a2_uhFa8HMEezfIeFn4Ws4AgP1GbY0ZeUmQ1MiN5faxW3ZHR97R1UxdhpQmEUtw4_TpwrjaqQYq0g1D1NZ0abwTTgD3sZizkrjdTU5Mc9zPbPHSe-gz5Zr9omFCUjKUr1DLdoTmyHAP2LV9Mw-OSdW0WkLkRdb0RdTTaOexmHIp2w66YNaDOmXaHjcBE480OOELx0uD-e0bdkvxNe8b_AazOdiw:27
    (anonymous) @ js_mO82Kt7VyJ7TTGpJdeaLZ2mhUyiCdlvL-aYU8c4vi7c.js?scope=footer&delta=3&language=en&theme=gin&include=eJyNUkt2pDAMvJA7Xs0Rku0cgSeMAL32h1gymb79yNBu0iGLXvBwlcrlsiygzs0gfRI7phwuLBkhGFD6igNJyvbb2kCRxLBiV8V2yGUB__ZEmqb9YykK5qiCu-5ReUXzhmGZgYlfEs8S_HucKOJL8qALMC6NI2K7xY6U1F3_pIA_Co25eIpXDZQy2sMMPE0xYJRTQftSWwKnSu-Tu36WJPizQnH4xamee-b4pFuABT9yCn_HkdzJPGNIK378GolTyQ7fFVGcfhYFen93a2_uhFa8HMEezfIeFn4Ws4AgP1GbY0ZeUmQ1MiN5faxW3ZHR97R1UxdhpQmEUtw4_TpwrjaqQYq0g1D1NZ0abwTTgD3sZizkrjdTU5Mc9zPbPHSe-gz5Zr9omFCUjKUr1DLdoTmyHAP2LV9Mw-OSdW0WkLkRdb0RdTTaOexmHIp2w66YNaDOmXaHjcBE480OOELx0uD-e0bdkvxNe8b_AazOdiw:27
    dispatch @ jquery.min.js?v=4.0.0-rc.1:2
    v.handle @ jquery.min.js?v=4.0.0-rc.1:2
  • 🇺🇸United States rraney

    It could just be a CK Editor issue, according to Matthew at Amazee.

  • 🇺🇸United States rraney

    I'm focused on CK Editor right now. Here's the AI synopsis of the AJAX error.

    Explanation

    Understanding the problem
    This Drupal.AjaxError indicates that an AJAX request initiated by Drupal failed to complete successfully. Although the HTTP result code is 200 (which typically means the request was successful), the StatusText is parsererror. This suggests that the server responded, but the response could not be properly parsed as valid JSON by the client-side JavaScript. The ResponseText further clarifies the issue: a fatal PHP error occurred on the server side, specifically a "Call to a member function getName() on null" within the Drupal\ai_ckeditor\Plugin\AICKEditor\Translate->ajaxGenerate() method. This means that a variable or object that was expected to be a valid object was actually null when the getName() method was called.

    Suggested fix
    The error message points to a PHP error on the server. You need to debug the PHP code within the ajaxGenerate() method of the Translate.php file. The "Call to a member function getName() on null" suggests that a variable is null when it's expected to be an object with a getName() method.

    Identify the variable that is null: Examine the code in Translate.php at line 204 within the ajaxGenerate() method. Find where getName() is being called and determine which variable it's being called on.
    Trace why the variable is null: Work backward from the line of the error to understand why that variable is not being assigned a proper object value. This could be due to missing configuration, incorrect data being passed to the method, or a dependency injection issue.
    Fix the PHP code: Based on your findings, modify the PHP code to ensure the variable in question is a valid object before getName() is called. This might involve adding checks for null, ensuring dependencies are correctly injected, or adjusting how data is processed.
    Since the specific code causing the issue is server-side PHP, I cannot provide a direct code fix in this context. You will need to inspect the PHP file mentioned in the error (/var/www/html/web/modules/contrib/ai/modules/ai_ckeditor/src/Plugin/AiCKEditor/Translate.php) and debug the logic there.

    Summary
    A Drupal.AjaxError with a parsererror status text and a 200 HTTP result code, accompanied by a PHP error in the ResponseText, indicates that the AJAX request completed in terms of network communication but failed because the server-side PHP code encountered a fatal error before it could return a valid, parsable response. The fix requires debugging and correcting the PHP code on the server that generated the error.

    Here's the console message:

    Uncaught Drupal.AjaxError {message: '\nAn AJAX HTTP error occurred.\nHTTP Result Code: 20…ai_ckeditor/src/Plugin/AiCKEditor/Translate.php).', name: 'AjaxError', stack: 'Error\n    at https://amazee-ai.ddev.site:33001/cor…ddev.site:33001/core/misc/ajax.js?v=11.2.4:1930:3'}message: "\nAn AJAX HTTP error occurred.\nHTTP Result Code: 200\nDebugging information follows.\nPath: /api/ai-ckeditor/dialog?_wrapper_format=drupal_modal&ajax_form=1\nStatusText: parsererror\nResponseText: Error: Call to a member function getName() on null in Drupal\\ai_ckeditor\\Plugin\\AICKEditor\\Translate->ajaxGenerate() (line 204 of /var/www/html/web/modules/contrib/ai/modules/ai_ckeditor/src/Plugin/AiCKEditor/Translate.php)."name: "AjaxError"stack: "Error\n    at https://amazee-ai.ddev.site:33001/core/misc/ajax.js?v=11.2.4:198:32\n    at https://amazee-ai.ddev.site:33001/core/misc/ajax.js?v=11.2.4:1930:3"[[Prototype]]: Error
        at https://amazee-ai.ddev.site:33001/core/misc/ajax.js?v=11.2.4:198:32
        at ht

    Here's the stacktrace:

    Drupal.Ajax.error @ ajax.js?v=11.2.4:1221
    complete @ ajax.js?v=11.2.4:610
    options.complete @ jquery.form.js?v=4.3.0:301
    c @ jquery.min.js?v=4.0.0-rc.1:2
    fireWith @ jquery.min.js?v=4.0.0-rc.1:2
    E @ jquery.min.js?v=4.0.0-rc.1:2
    (anonymous) @ jquery.min.js?v=4.0.0-rc.1:2
    XMLHttpRequest.send
    send @ jquery.min.js?v=4.0.0-rc.1:2
    ajax @ jquery.min.js?v=4.0.0-rc.1:2
    $.fn.ajaxSubmit @ jquery.form.js?v=4.3.0:340
    Drupal.Ajax.eventResponse @ ajax.js?v=11.2.4:798
    (anonymous) @ ajax.js?v=11.2.4:648
    dispatch @ jquery.min.js?v=4.0.0-rc.1:2
    v.handle @ jquery.min.js?v=4.0.0-rc.1:2
  • 🇺🇸United States rraney

    I figured it out. My apologies.

    Here's the fix:

    In the text format configuration, I added AI Assistant. When I did this, I didn't know what "Language" meant under this heading, "Use languages or taxonomy terms for language selection." I had selected "Language" instead of "Taxonomy Term". It's so basic and simple, I apologize for creating a whole issue about this.

    The reason I was confused is because my Taxonomy is called "Language". In this case that word has two different meanings. It might be good to not call the Taxonomy "Language" just to be absolutely certain you aren't dealing with Drupal's "Language".

  • 🇺🇸United States rraney
  • Now that this issue is closed, please review the contribution record.

    As a contributor, attribute any organization helped you, or if you volunteered your own time.

    Maintainers, please credit people who helped resolve this issue.

Production build 0.71.5 2024