I have the following case:
1. Taxonomy Views block is used for a vocabulary.
2. A custom module is implementing hook_ENTITY_TYPE_access for taxonomy terms.
In cases when when term page is not accessible TaxonomyViewsIntegratorTermPageController trys to render selected taxonomy views but instead NULL is returned and an exception is thrown:
The controller must return a response (null given). Did you forget to add a return statement somewhere in your controller? in Symfony\Component\HttpKernel\HttpKernel->handleRaw() (line 169 of /var/www/vendor/symfony/http-kernel/HttpKernel.php).
Correct result: 403 page.
Proposed solution:
There should be added a requirement _entity_access to the overridden route in RouteSubscriber.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | fix_taxonomy_term_access-2956392-5.patch | 798 bytes | vladimir.krupin |
Comments
Comment #2
andreyjan commentedComment #3
andreyjan commentedAttaching a patch.
Comment #4
andreyjan commentedComment #5
vladimir.krupin commentedThere is patch for the latest version
Comment #6
kevinquillen commentedIs there a test we could write for this?
Comment #8
kevinquillen commented