Problem/Motivation

I've got an error after d10.3.0 update.
Fatal error: Uncaught TypeError: Drupal\eca\EcaState::__construct(): Argument #4 ($time) must be of type Drupal\Component\Datetime\TimeInterface, Drupal\Core\Cache\DatabaseBackend given,

services.yml changed in d10.3.0

from (10.2.7)

  state:
    class: Drupal\Core\State\State
    arguments: ['@keyvalue']

to (10.3.0)

state:
    class: Drupal\Core\State\State
    arguments: ['@keyvalue', '@cache.bootstrap', '@lock']
    tags:
      - { name: needs_destruction }

Proposed resolution

We need to change the eca.services.yml

  eca.state:
    class: Drupal\eca\EcaState
    parent: state
-    arguments: ['@cache.bootstrap', '@lock', '@datetime.time']
+    arguments: ['@datetime.time']
CommentFileSizeAuthor
#3 eca-3456136-2.patch729 byteskecsot

Issue fork eca-3456136

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

kecsot created an issue. See original summary.

kecsot’s picture

Issue summary: View changes
kecsot’s picture

StatusFileSize
new729 bytes
kecsot’s picture

I see it's fixed in v2.0.0.
I've updated.

The problem v1.1.6 is compatible with 10.3 drupal.
Then my patch is not a solution.
We need to deny core 10.3.0 from v1.1.x with composer.

jurgenhaas’s picture

Version: 1.1.6 » 1.1.x-dev

We need a solution that works for both, 10.2 and 10.3 - I thought we had addressed that, but maybe forgot for the 1.1 branch. I'll have a look.

jurgenhaas’s picture

For reference, this is the issue where we were supposed to have fixed that for 1.1 already: #3437321: Add support for cache collector for state in core

Not sure why that didn't really work out as intended.

jurgenhaas’s picture

Status: Active » Needs review

Please have a look into the MR!432 whether that fixes the issue for you. Ideally, if you could test this for both Drupal core 10.2 and 10.3?

This is trying to declare ECA's state service independently instead ob using the core state service as a parent.

jurgenhaas’s picture

Priority: Normal » Critical

Hiding the patch.

kecsot’s picture

Great idea.

I've tested the services.yml and works well with 10.2.7 and 10.3

Thank you!

  • jurgenhaas committed 962bfaac on 1.1.x
    Issue #3456136 by jurgenhaas, kecsot: 10.3.0 core state services changed
    
jurgenhaas’s picture

Status: Needs review » Fixed

Thanks for quick testing. Tests are passing too.

Just about pushing 1.1.7

Status: Fixed » Closed (fixed)

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

sazevedo@ua.pt’s picture

Hello,

I've done the upgrade to 10.3.1 drupal core and ECA 2.0 and the error is persisting.
I've applied the patch but it doesn't work.

can you help me?
Thank you

danielspeicher’s picture

@ sazevedo@ua.pt

I have version 10.3.1 and ECA 2.0 and the error is gone. For 10.3.1 (and for 1.1.7) you do not need to apply the patch anymore.

sazevedo@ua.pt’s picture

Thank you Daniel, at the end of the day we manage to do the upgrade without any error.

danielspeicher’s picture

That's great.

bjturlapati’s picture

This solution worked for me.