- Issue created by @jrochate
- πΊπΈUnited States bkosborne New Jersey, USA
I wonder if you have an invalid service definition in your site somewhere. I can't reproduce this in 10.3.x or 10.4.x on a clean install (Drupal standard profile). Do you have any custom modules installed? Or is everything well supported contrib modules?
- π·π΄Romania claudiu.cristea Arad π·π΄
claudiu.cristea β made their first commit to this issueβs fork.
- π·π΄Romania claudiu.cristea Arad π·π΄
On a clean install, with PHP 8.2.27 and 10.4.4, I cannot reproduce the issue. Please add more details about your installation.
It's very weird that those path of the code is taken with Drupal 10.4
- πΊπΈUnited States jerrac
I just ran into this error message as well.
Uncaught PHP Exception TypeError: "Drupal\\cas\\DependencyInjection\\DeprecatedEventConstants::Drupal\\cas\\DependencyInjection\\{closure}(): Return value must be of type string, Symfony\\Component\\DependencyInjection\\Reference returned" at /var/www/web/modules/contrib/cas/src/DependencyInjection/DeprecatedEventConstants.php line 58
I think there is something in the ECA core module causing it. With ECA core enabled, the error occurs, without, it does not occur.
Drupal 10.4, CAS 3.0.0 beta 3. ECA 2.1.6 and 2.1.x-dev.
Is the Drupal\cas\DependencyInjection\DeprecatedEventConstants process method trying to get a list of deprecated events? As far as I can tell the ECA module has no deprecated events, so why would it somehow mess with CAS?
Does the closure on line 58 really need to return a string? Removing the ': string' makes the error go away. Though I haven't tested for what side effects that might have.
- π·π΄Romania claudiu.cristea Arad π·π΄
Ok, looks like a bug. I'm into it
- Merge request !52Don't support event disptacher from Drupal < 10.3 β (Merged) created by claudiu.cristea
- π΅πΉPortugal jrochate
It looks good to me.
I have patched, enabled the module on the same installation that the error occurred before, and cache can be cleaned without any warning nor error.
Thanks.
- π·π΄Romania claudiu.cristea Arad π·π΄
@jrochate, thank you for testing. However, now the tests are failing and I need to investigate this. Also, it would be good to get some input also from @jerrac
- π·π΄Romania claudiu.cristea Arad π·π΄
@jrochate @jerrac, could you test the latest version? I've made some changes compared to the first attempt.
- πΊπΈUnited States jerrac
@claudiu.cristea As far as I can tell that works. I switched to the CAS 3.x-dev branch and manually adjusted the
$eventNames
lines to match$eventNames = array_map(fn(array $call): string => (string) $call[1][0], $definition->getMethodCalls());
No WSODs or errors after making the change. If I revert the change, it errors.
So as long as the code is doing whatever else it is supposed to, then I think we're good. :)
- π·π΄Romania claudiu.cristea Arad π·π΄
Thank you. If youβve tested and itβs working it would help to mark the issue as RTBC so that we can merge the changes and release a new version
- π΅πΉPortugal jrochate
I'm testing against 3-beta3 and so far so good. no errors. marking RTBC
-
claudiu.cristea β
committed 8ee1a86c on 3.x
Issue #3513857 by claudiu.cristea, jrochate, jerrac: TypeError: Drupal\...
-
claudiu.cristea β
committed 8ee1a86c on 3.x
Automatically closed - issue fixed for 2 weeks with no activity.