- Issue created by @baikho
- 🇮🇹Italy bigbabert Milano, Italy
- 🇬🇧United Kingdom MrDaleSmith
I've reported that last comment as spam as this is an issue with this module, not a request for alternate modules with similar functionality.
- Merge request !516Resolve #3513409 "Compatibility regression with" → (Merged) created by MrDaleSmith
- 🇬🇧United Kingdom MrDaleSmith
What we are seeing here is the difficult in using this module with any other translations because of the issue noted in https://www.drupal.org/project/ai/issues/3497214 📌 [AI Translate] Module uses Form that isn't a form Active - the existing code builds its own custom form so it can add in one column to the translation page, and depending on which particular controller is used that can remove a lot of important data.
What I've done in https://git.drupalcode.org/project/ai/-/merge_requests/516 is attempt to resolve this situation by altering whatever existing page we get to add in our extra column. If anything goes wrong, it falls back to just showing what was there before ai_translate was turned on, so at the very least it won't cause major issues.
The specific issue here was unrelated to ai_tmgmt - the problem existed with its dependency tmgmt_content so would have occurred without ai_tmgmt being installed. I'm not sure of the use case for having both ai_tmgmt and ai_translate enabled at the same time (since both send content to the AI to be translated) but if you need to, this MR should stop it causing issues.
- 🇬🇧United Kingdom scott_euser
I didn't review the code, but I tested this out with TMGMT and I can use both AI Translate and TMGMT functionality on the translate tab successfully.
Re #7 - that's a different functionality. TMGMT is for more advanced/complex translation workflows with shopping cart/review process. AI Translate should be compatible with TMGMT.
- 🇬🇧United Kingdom lukus
I've applied and tested the patch, but experience another error.
Using the 1.1.x-dev version of drupal/ai.
I'm using PHP 8.x and I get a type mismatch in
Drupal\ai_translate\Controller\ContentTranslationControllerOverride
as it seems one of the overridden class' properties no longer matches the property type of the class it's extending:protected TimeInterface $time;
vs
protected ?TimeInterface $time;
- 🇬🇧United Kingdom MrDaleSmith
That seems to be related to fixing https://git.drupalcode.org/issue/ai-3513409/-/jobs/4714593 so I'm not sure what is going on here: I may need a maintainer to look at confirm what the issue is.
- 🇬🇧United Kingdom scott_euser
It seems if you use Drupal 10 then its ?TimeInterface which is the problem. I pushed a fix that should solve and work in both D10 and D11. Please confirm.
- First commit to issue fork.
- 🇮🇳India prabha1997
Updated the $time property type in ContentTranslationControllerOverride to match the parent class (ContentTranslationController). The parent class defines it as TimeInterface, so it cannot be overridden as ?TimeInterface due to strict type compatibility in PHP. This change resolves the type mismatch error and maintains proper inheritance.
- 🇩🇪Germany marcus_johansson
Code looks good, could someone test functionality of this?
- 🇮🇳India prabha1997
Hi marcus_johansson,
We've removed the AiTranslateForm.php file, and I'm able to translate content without any issues.
I've attached a reference video for your review. - 🇩🇪Germany marcus_johansson
Thank you all for all the work here, this is now getting merged and hopefully will solve 🐛 : AI translateCannot see translations in translate tab if I use AI TGMT ot auto translate modules Active and 🐛 BUG on translate tab: Warning: Undefined array key "#entity" in Drupal\ai_translate\Form\AiTranslateForm->buildForm() (line 85 of modules/contrib/ai/modules/ai_translate/src/Form/AiTranslateForm.php). Active as well.
-
marcus_johansson →
committed 15a3f8f7 on 1.1.x authored by
mrdalesmith →
Resolve #3513409 "Compatibility regression with"
-
marcus_johansson →
committed 15a3f8f7 on 1.1.x authored by
mrdalesmith →
- Assigned to prabha1997
- Status changed to Fixed
4 days ago 11:04am 28 May 2025 Automatically closed - issue fixed for 2 weeks with no activity.