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.

Comments

andreyjan created an issue. See original summary.

andreyjan’s picture

Issue summary: View changes
andreyjan’s picture

StatusFileSize
new690 bytes

Attaching a patch.

andreyjan’s picture

Status: Active » Needs review
vladimir.krupin’s picture

StatusFileSize
new798 bytes

There is patch for the latest version

kevinquillen’s picture

Is there a test we could write for this?

kevinquillen’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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