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 IDAdd 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
Issue fork views_data_export-3485587
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
Comment #4
davidwhthomas commentedAttached MR with patches:
8.x-2.x-devbranch and also8.x-1.x-devbranch (backport).MR pipeline error regarding composer dependencies is unrelated to this update.
Comment #5
steven jones commentedComment #8
divyat commentedHi,
After adding above patch this issue is working fine.
Thanks
Comment #9
davidwhthomas commentedComment #10
steven jones commentedComment #12
steven jones commentedThanks everyone, committed!