Skip to content

issue 1022. fix missing _route on live components batch requests #2767

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 2.x
Choose a base branch
from

Conversation

arrabiata-asanz
Copy link

@arrabiata-asanz arrabiata-asanz commented May 23, 2025

Q A
Bug fix? yes
New feature? no
Docs? no
Issues Fix #1022
License MIT

The _route param get overwritten for Live Component Batch Requests, persist this param to the sub requests

Symfony\UX\LiveComponent\Controller\BatchActionController

$request->duplicate(attributes: [
                '_controller' => [$serviceId, $name],
                '_component_action_args' => $action['args'] ?? [],
                '_mounted_component' => $_mounted_component,
                '_live_component' => $serviceId,
            ]

$response = $this->kernel->handle($subRequest, HttpKernelInterface::SUB_REQUEST, false);

Duplicate overwrites all attributes in the sub request, missing one important attribute _route, add it to the array in order to know where the request comes from.

@carsonbot carsonbot added Bug Bug Fix Status: Needs Review Needs to be reviewed labels May 23, 2025
@arrabiata-asanz
Copy link
Author

i think the failed tests don't apply to the changes in this PR. (Deprecation warning and Exception Messages Formatting)

@Kocal
Copy link
Member

Kocal commented May 23, 2025

Thanks for the PR! I'm totally not familiar with LiveComponent, but:

  1. can we add a test preventing any regression?
  2. I think we should also pass _route_params, no?

@Kocal
Copy link
Member

Kocal commented May 23, 2025

i think the failed tests don't apply to the changes in this PR. (Deprecation warning and Exception Messages Formatting)

Yes you can ignore the 8.4 dev job, but for fabbot, it would be nice to fix it (even if not related :) )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BatchActionController isn't passing default route attributes
3 participants