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']
Comments
Comment #2
kecsotComment #3
kecsotComment #4
kecsotI 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.
Comment #5
jurgenhaasWe 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.
Comment #6
jurgenhaasFor 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.
Comment #8
jurgenhaasPlease 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.
Comment #9
jurgenhaasHiding the patch.
Comment #10
kecsotGreat idea.
I've tested the services.yml and works well with 10.2.7 and 10.3
Thank you!
Comment #12
jurgenhaasThanks for quick testing. Tests are passing too.
Just about pushing 1.1.7
Comment #14
sazevedo@ua.pt commentedHello,
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
Comment #15
danielspeicher commented@ 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.
Comment #16
sazevedo@ua.pt commentedThank you Daniel, at the end of the day we manage to do the upgrade without any error.
Comment #17
danielspeicher commentedThat's great.
Comment #18
bjturlapati commentedThis solution worked for me.