Fatal error on Content translation page from class ContentTranslationControllerOverride

Created on 5 June 2025, 26 days ago

Problem/Motivation

After upgrading to version RC, Getting this error on translation page:

Fatal error: Type of Drupal\ai_translate\Controller\ContentTranslationControllerOverride::$time must be ?Drupal\Component\Datetime\TimeInterface (as in class Drupal\content_translation\Controller\ContentTranslationController) in /Users/anmolgoel/Downloads/sites/aes_reimg/docroot/modules/contrib/ai/modules/ai_translate/src/Controller/ContentTranslationControllerOverride.php on line 20

Since parent class defines the $time parameter as nullable. We should keep it nullable here as well atleast for D10 version.

  public function __construct(ContentTranslationManagerInterface $manager, EntityFieldManagerInterface $entity_field_manager, protected ?TimeInterface $time = NULL) {
    $this->manager = $manager;
    $this->entityFieldManager = $entity_field_manager;
    if ($this->time === NULL) {
      @trigger_error('Calling ' . __METHOD__ . ' without the $time argument is deprecated in drupal:10.3.0 and it will be required in drupal:11.0.0. See https://www.drupal.org/node/3112298', E_USER_DEPRECATED);
      $this->time = \Drupal::service('datetime.time');
    }
  }

Steps to reproduce

Upgrade to latest RC version of the module
Visit any node translation page: /node//translations

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

1.1

Component

AI Translate

Created by

🇮🇳India anmolgoyal74

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024