Problem/Motivation
When navigating to a non-existent url on the site (e.g. mysite.com/bla_bla), it throws the following error instead of showing "Page not found":
TypeError: Argument 1 passed to Drupal\entity_print\EventSubscriber\PrintEngineExceptionSubscriber::handleException() must be an instance of Symfony\Component\HttpKernel\Event\ExceptionEvent, instance of Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent given in Drupal\entity_print\EventSubscriber\PrintEngineExceptionSubscriber->handleException() (line 53 of modules/contrib/entity_print/src/EventSubscriber/PrintEngineExceptionSubscriber.php).
This error happened after upgrading to 2.7. Downgrading to 2.6 resolves the error.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | 3309925-pass.patch | 2.24 KB | larowlan |
| #6 | 3309925-fail.patch | 700 bytes | larowlan |
Comments
Comment #2
larowlanHmm we might need a new branch for d10 support then
Comment #3
larowlanIn D9 the event is passed a RequestExceptionEvent.
In D10 this becomes an ExceptionEvent.
We need to find a way I can typehint this without using union types so that the module is compatible with D9 and D10.
If I use RequestException event it is a deprecation in D9 and a fatal in D10. If I use ExceptionEvent its a type error in D9 as the passed argument is the narrower RequestExceptionEvent
I can use a union type, but that'd mean dropping PHP7 support, which given the audience of this module feels disruptive. However those folks can stay on older versions I guess.
Alternatively I can do a new major version with the breaking change, ie D10 only - but that makes it harder for people to update to D10.
Comment #5
larowlanComment #6
larowlanComment #8
larowlan