Problem/Motivation

If the data export view is configured to redirect to a display that uses route parameters, the export will return an "unexpected error" page with a similar error to this in the logs:

Symfony\Component\Routing\Exception\MissingMandatoryParametersException: Some mandatory parameters are missing ("user") to generate a URL for route "view.example.user_data_page". in Drupal\Core\Routing\UrlGenerator->doGenerate() (line 187 of .../web/core/lib/Drupal/Core/Routing/UrlGenerator.php).

Steps to reproduce

Add a view that uses a contextual filter, for example a "User data" view under the user profile page

Path: /user/%user/data
Menu: Tab: User data
Contextual filter: (uid) User: User ID

Add a data export attached to that page

Path: /user/%user/data/export
Attach to: User data
Redirect to this display: User data

When visiting the export display, the error will be returned, because the route parameters in the attached display cannot be determined.

Proposed resolution

Update the redirect URL logic to include the route parameters for the redirect destination display.

Remaining tasks

Add a patch to views_data_export/src/Plugin/views/display/DataExport.php

I have a patch and will add an MR shortly.

User interface changes

No changes

API changes

No changes

Data model changes

No changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

davidwhthomas created an issue. See original summary.

davidwhthomas’s picture

Assigned: davidwhthomas » Unassigned
Status: Active » Needs review

Attached MR with patches:

  1. Against the 8.x-2.x-dev branch and also
  2. Against the 8.x-1.x-dev branch (backport).

MR pipeline error regarding composer dependencies is unrelated to this update.

steven jones’s picture

Version: 8.x-2.x-dev » 8.x-1.x-dev

christian.wiedemann made their first commit to this issue’s fork.

divyat’s picture

Hi,
After adding above patch this issue is working fine.
Thanks

davidwhthomas’s picture

Status: Needs review » Reviewed & tested by the community
steven jones’s picture

Related issues: +#3552653: Release 8.x-1.7

steven jones’s picture

Status: Reviewed & tested by the community » Fixed

Thanks everyone, committed!

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.