- Issue created by @ericgsmith
- Issue was unassigned.
- Status changed to Needs review
over 1 year ago 2:25am 14 June 2023 - π³πΏNew Zealand ericgsmith
After conversation with a colleague I've removed an earlier implementation containing exit in favour of returning the results.
- π³πΏNew Zealand xurizaemon Εtepoti, Aotearoa π
Thanks Eric. It feels like sending a RedirectResponse really ought to trigger termination of the current request, to me.
I don't see that, but wanted to check in case we'd missed something there.
- π³πΏNew Zealand ericgsmith
Hi Chris,
Sorry I missed this message when I was on leave.
but I feel like it should be unnecessary to introduce and then terminate the kernel request as I feel like that would be sensible default behaviour for core when sending a RedirectResponse already
You are correct - if core was doing the send we wouldn't need to do this - the issue is that the plugin is sending the response so that plugin needs to ensure it is terminated. If this was redirecting somewhere that core expected (e.g middleware, a controller or event subscriber) it wouldn't be needed.
The main different here is that its not good to be sending your own responses - core should be doing that. But at the same time its relying on information this isn't available until the query to solr has run and the response is being built.
Another option would be to add a kernel event listener to the event dispatcher - this is what core does in the drupal goto plugin https://git.drupalcode.org/project/drupal/-/blob/11.x/core/lib/Drupal/Co...
This would let the request complete and be handle by Drupal - less code / logic for the module - but it not what the (admittedly dated) CR says about redirect outside the context of a controller - https://www.drupal.org/node/2023537 β
-
azinck β
committed 5e041e06 on 1.0.x authored by
ericgsmith β
Issue #3366611 by ericgsmith: TypeError as an array is not returned...
-
azinck β
committed 5e041e06 on 1.0.x authored by
ericgsmith β
- Status changed to Fixed
about 1 year ago 2:08pm 8 September 2023 Automatically closed - issue fixed for 2 weeks with no activity.