Wrong arg array to build link with contextual filter

Created on 10 April 2024, 6 months ago
Updated 5 July 2024, 3 months ago

Problem/Motivation

When BEF tries to build a link with arg:

return Url::fromRoute(
        implode('.', [
          'view',
          $view->id(),
          $display['id'],
        ]),
        $args
      );

"args" array has the next structure:

$args = [
'arg_0' => '32434',
]

but the view has the contextual parameter with another name but not "arg_0", and we will get an error ymfony\Component\Routing\Exception\MissingMandatoryParametersException: Some mandatory parameters are missing ("{param_name_from_view_url}") to generate a URL for route "{view.name}"

Proposed resolution

I think we need to change the keys in the "args" array from "arg_0" to the parameter name.

πŸ› Bug report
Status

Closed: outdated

Version

6.0

Component

Code

Created by

πŸ‡ΊπŸ‡¦Ukraine r_cheh

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

Comments & Activities

Production build 0.71.5 2024