Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "datetime.time". in Drupal\Component\DependencyInjection\Container->get() (line 157 of /opt/app-root/src/app/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php).

Apparently TmgmtFormBase depends on the datetime.time service, which is an addition in 8.3.x. Is the module requiring 8.3.x-dev to work, or is there a compatibility layer that I'm missing?

CommentFileSizeAuthor
#8 tmgmt-2846252-core-version.patch2.29 KBcburschka

Comments

cburschka created an issue. See original summary.

cburschka’s picture

Title: WSOD on Jobs page with Drupal 8.2.5 » Dependency on a non-existent datetime.time service
berdir’s picture

Damn, that's a regression caused by #2834807: Make TranslatorPluginBase inherit Drupal's Core PluginBase. That's what you get when doing quick fixes before a release..

berdir’s picture

Reverted that, you should be able to switch to the latest dev in a few minutes.

cburschka’s picture

Hmm... the error still occurs on the 8.x-1.x branch. I'm not sure how this change could've caused it, since it's on /admin/tmgmt/jobs, which directly goes to ContinuousJobForm which inherits TmgmtFormBase::create, and that's where the datetime.time service is requested. The plugins don't seem to be touched at that point...

cburschka’s picture

The actual commit that broke it seems to be 691bbcc1 in #2840331: Missing parent call in TmgmtFormBase::__constuctor. Your parent::__construct call targets the 8.3.x version of ContentEntityForm:

  /**
   * Constructs a ContentEntityForm object.
   *
   * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
   *   The entity manager.
   * @param \Drupal\Core\Entity\EntityTypeBundleInfoInterface $entity_type_bundle_info
   *   The entity type bundle service.
   * @param \Drupal\Component\Datetime\TimeInterface $time
   *   The time service.
   */
  public function __construct(EntityManagerInterface $entity_manager, EntityTypeBundleInfoInterface $entity_type_bundle_info = NULL, TimeInterface $time = NULL) {
    $this->entityManager = $entity_manager;

    $this->entityTypeBundleInfo = $entity_type_bundle_info ?: \Drupal::service('entity_type.bundle.info');
    $this->time = $time ?: \Drupal::service('datetime.time');
  }

The 8.2.5 version only takes the EMI:

  /**
   * Constructs a ContentEntityForm object.
   *
   * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
   *   The entity manager.
   */
  public function __construct(EntityManagerInterface $entity_manager) {
    $this->entityManager = $entity_manager;
  }
cburschka’s picture

(I can confirm that after reverting 691bbcc1, the /admin/tmgmt/jobs page works correctly.)

cburschka’s picture

Status: Active » Needs review
StatusFileSize
new2.29 KB

This removes the two extra arguments to bring the code in line with 8.2.5. :)

berdir’s picture

I'm stupid. I reverted the right commit now :)

berdir’s picture

Status: Needs review » Fixed

Thanks for testing.

Since i already reverted the other issue, this doesn't apply anymore. Feel free to provide a better patch for the other issue, closing this.

I also released 8.x-1.1 to fix this.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.