Closed
Description
We're passing the current Request
object along to controllers generating the shortcode substitution content:
WebfactoryShortcodeBundle/src/Handler/EmbeddedShortcodeHandler.php
Lines 70 to 84 in 80f789b
- This is not equivalent to what Symfony does when type-hinting for the
Request
class as a controller method argument, since Symfony injects the Request based on the type-hint. The code shown above works based on the parameter name. - Passing arguments to ESI subrequests works only for scalar values. If the Request contains non-scalar values, most probably due to Param Converters being used, this might fail or at least not provide the expected results.
I think we should remove this general request-passing behaviour. To support "context-aware shortcodes" (where the rendering controller knows about the request where the shortcode is used), we could either recommend using the inline
rendering strategy only. (TODO: Check if the Request can be injected automatically into such controllers.)
Or we need to come up with a way where you can express via configuration (extra DIC tags?) which parameter values to pass on for which shortcode.
Metadata
Metadata
Assignees
Labels
No labels