Provided example is not working

Created on 11 April 2023, over 1 year ago
Updated 28 April 2023, over 1 year ago

Problem/Motivation

The example provided is not working.

Steps to reproduce

Create custom module and Subscriber that implements EventSubscriberInterface.
In onTermPageBuild function if the taxonomy term is of a specific vocabulary then I want to return the page returned before the Subscriber was created.
Adding the return statement as in the example results in the following error:
Symfony\Component\HttpKernel\Exception\ControllerDoesNotReturnResponseException: The controller must return a "Symfony\Component\HttpFoundation\Response" object but it returned null. Did you forget to add a return statement somewhere in your controller? in () (line 98 of core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php).

🐛 Bug report
Status

Fixed

Version

1.4

Component

Documentation

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024