Problem/Motivation
The Views field 'Link to edit' creates the following link: /user/1/edit?destination%5Bdestination%5D=/admin/people
This should be /user/1/edit?destination=/admin/people
Proposed resolution
Fix the destination parameter in 'Link to edit user' to include only one destination parameter.
Remaining tasks
- Write a patch
- Review
User interface changes
None
API changes
None
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | 2401265-15-do-not-test.patch | 5.45 KB | idebr |
| #10 | 2401265-10.patch | 3.4 KB | idebr |
| #10 | interdiff-10-7.txt | 1.03 KB | idebr |
| #10 | 2401265-10.fail_.patch | 2.68 KB | idebr |
| #7 | 2401265-7.patch | 3.29 KB | idebr |
Comments
Comment #1
dawehnerThis is currently broken due to #2404603: Add proper support for Url objects in FieldPluginBase::renderAsLink(), so we can remove EntityInterface::getSystemPath() but I think this issue os worth to keep to for example add dedicated test coverage.
Comment #2
idebr commented#2404603: Add proper support for Url objects in FieldPluginBase::renderAsLink(), so we can remove EntityInterface::getSystemPath() has been committed and the 'Link to edit user' now renders a link. However, the destination parameter has another destination parameter. This kills the website.
Comment #3
idebr commentedAttached patch removes the destination parameter from the destination parameter. I updated the issue summary to reflect the new issue.
Comment #4
idebr commentedComment #5
dawehnerWould you mind trying writing a test?
Comment #6
idebr commentedSure, I'll write a test :)
Comment #7
idebr commentedTests added. I wonder what is the best way to test the destination parameter on the 'Edit' link in a test? Right now its hardcoded to the current path.
Comment #10
idebr commentedAlright, this should fix the failing test to fail only on the Edit link failure.
Comment #12
dawehnerThis doesn't block this bug to get in. Can we please add a quick beta evaluation?
In case you want to you could try to write a kernel test instead, as it would make it way nicer to run the test, due to its better performance.
Comment #13
idebr commentedOh, that sounds good. I haven't written one before but i'll have a look tomorrow.
Comment #14
dawehnerFieldCounterTest might give you an idea how to do it.
Comment #15
idebr commentedI tried extending
UserUnitTestBasebut I couldn't get the user edit link to render in the test. Other fields such as the user name were rendering fine. Do I need to override any access checks for the edit link to show up?Comment #16
lendudeThis handler was removed in #2322949: Implement generic entity link view field handlers and now the \Drupal\views\Plugin\views\field\EntityOperations is used.