updated core to 8.6.3
This commit is contained in:
@@ -99,7 +99,7 @@
|
||||
|
||||
// Set the destination parameter on each of the contextual links.
|
||||
const destination = `destination=${Drupal.encodePath(
|
||||
drupalSettings.path.currentPath,
|
||||
Drupal.url(drupalSettings.path.currentPath),
|
||||
)}`;
|
||||
$contextual.find('.contextual-links a').each(function() {
|
||||
const url = this.getAttribute('href');
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
|
||||
$contextual.html(html).addClass('contextual').prepend(Drupal.theme('contextualTrigger'));
|
||||
|
||||
var destination = 'destination=' + Drupal.encodePath(drupalSettings.path.currentPath);
|
||||
var destination = 'destination=' + Drupal.encodePath(Drupal.url(drupalSettings.path.currentPath));
|
||||
$contextual.find('.contextual-links a').each(function () {
|
||||
var url = this.getAttribute('href');
|
||||
var glue = url.indexOf('?') === -1 ? '?' : '&';
|
||||
|
||||
@@ -96,9 +96,9 @@
|
||||
* The keypress event.
|
||||
*/
|
||||
onKeypress(event) {
|
||||
// The first tab key press is tracked so that an annoucement about tabbing
|
||||
// constraints can be raised if edit mode is enabled when the page is
|
||||
// loaded.
|
||||
// The first tab key press is tracked so that an announcement about
|
||||
// tabbing constraints can be raised if edit mode is enabled when the page
|
||||
// is loaded.
|
||||
if (
|
||||
!this.announcedOnce &&
|
||||
event.keyCode === 9 &&
|
||||
|
||||
@@ -92,4 +92,19 @@ class ContextualLinksTest extends WebDriverTestBase {
|
||||
$this->assertSession()->pageTextContains('Everything is contextual!');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the contextual links destination.
|
||||
*/
|
||||
public function testContextualLinksDestination() {
|
||||
$this->grantPermissions(Role::load(Role::AUTHENTICATED_ID), [
|
||||
'access contextual links',
|
||||
'administer blocks',
|
||||
]);
|
||||
$this->drupalGet('user');
|
||||
$this->assertSession()->waitForElement('css', '.contextual button');
|
||||
$expected_destination_value = (string) $this->loggedInUser->toUrl()->toString();
|
||||
$contextual_link_url_parsed = parse_url($this->getSession()->getPage()->findLink('Configure block')->getAttribute('href'));
|
||||
$this->assertEquals("destination=$expected_destination_value", $contextual_link_url_parsed['query']);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user