When language-specific path prefixes are used on 8.0.6 and later (code seems unchanged including 8.2.x-dev) the destination parameter does not include them and they are removed.
| Comment | File | Size | Author |
|---|---|---|---|
| #30 | 2707879-30.patch | 4.55 KB | sam152 |
| #30 | 2707879-TEST-ONLY-30.patch | 1.19 KB | sam152 |
| #20 | contextual_links_do_not-2707879-20.patch | 1.02 KB | noemi |
| #25 | interdiff-8.5_20_25.txt | 1.02 KB | hctom |
| #25 | contextual_links_do_not-8.5-2707879-25.patch | 1.42 KB | hctom |
Comments
Comment #2
grahlThe attached path includes the pathPrefix, I did not separately test this with a site without language prefixes, assuming that encodePath is fine with null values.
Related issue: https://www.drupal.org/node/2639822
Comment #3
dawehnerCould we use the
Drupal.urlmethod directly for it?Comment #4
droplet commented#3++
Drupal.url(drupalSettings.path.currentPath)Comment #5
droplet commentedComment #6
mondrakeAdding related.
Comment #7
reekris commentedI'm experiencing the same issues in my current project. Here is a patch that uses Drupal.url which seems to work fine.
Comment #8
reekris commentedComment #9
dawehnerIt would be nice to add some javascript test coverage to prove that things are working.
Comment #10
jherencia commentedDrupal.url does not encode the path, would it be better to do this?
Comment #11
wim leers#10 is right.
Comment #12
gngn commentedI also think #10 is the best way to solve this - it solved my editors' problems.
Patch attached and setting to need-review.
Comment #13
gngn commentedAslo added tests and set to drupal 8.3.x-dev (that's what I'm running) - issue was 8.0.x-dev
Comment #14
droplet commentedComment #16
casey commentedReroll for 8.4
Comment #17
casey commentedComment #18
ludo.rPatch #12 works for me with Drupal 8.3.x
Comment #20
noemi commentedComment #21
yogeshmpawarTriggering Bots.
Comment #23
wim leersLooks okay, but this is causing tests to fail and it's modifying only
core/misc/drupal.js, it should also modifycore/misc/drupal.es6.js.Comment #25
hctomHere are some new patches that also target the ES6 script files. I provide two different patch versions for 8.5.x and 8.6.x, because in 8.6.x the ES6 file is slightly different to 8.5.x.
Comment #27
hctomComment #29
hctomI guess there are some tests that need to be updated for this change ;)
Comment #30
sam152 commentedI hit this today with path prefixes. #25.1 fixes this problem for me and still applies to 8.7.x. Digging into the two failing test cases, I think both of them demonstrate this bug:
$this->assertTrue(strstr($href, '/admin/structure/block/manage/custom/settings-tray?destination=user/2') !== FALSE);$this->assertContains("/admin/structure/block/manage/$block_id/settings-tray?destination=user/2", $link->getAttribute('href'));Both fails are because after this patch, the new destination param is
subdirectory/user/2which I believe is correct, given Drupal CI runs under a subdirectory.Uploading a new test case so we have explicit coverage and fixing the existing tests.
Comment #32
fenstratThis looks good. Manually tested and it does what it says on the box. New test is great.
Comment #33
larowlanadding review credits
Comment #35
larowlanCommitted 12c3109 and pushed to 8.7.x. Thanks!
c/p as 83e35e57aa and pushed to 8.6.x
Comment #38
avpaderno