Commit 04c9a71d authored by webchick's avatar webchick
Browse files

Issue #2186115 by chakrapani, longwave, jhodgdon, benjy, chrischinchilla,...

Issue #2186115 by chakrapani, longwave, jhodgdon, benjy, chrischinchilla, swentel: Shortcuts are added with no link title (hence unusable).
parent 0a423910
......@@ -68,18 +68,33 @@ public function testShortcutLinkAdd() {
* Tests that the "add to shortcut" link changes to "remove shortcut".
* Tests that the "add to shortcut" and "remove from shortcut" links work.
public function testShortcutQuickLink() {
\Drupal::config('system.theme')->set('admin', 'seven')->save();
$this->container->get('config.factory')->get('node.settings')->set('use_admin_theme', '1')->save();
$shortcuts = $this->set->getShortcuts();
$shortcut = reset($shortcuts);
// Test the "Add to shortcuts" link.
$this->clickLink('Add to Default shortcuts');
$this->assertText('Added a shortcut for Cron.');
$this->assertLink('Cron', 0, 'Shortcut link found on page');
$this->assertLink('Cron', 0, 'Shortcut link found on different page');
// Test the "Remove from shortcuts" link.
$this->clickLink('Remove from Default shortcuts');
$this->drupalPostForm(NULL, array(), 'Delete');
$this->assertText('The shortcut Cron has been deleted.');
$this->assertNoLink('Cron', 'Shortcut link removed from page');
$this->assertRaw(t('Remove from %title shortcuts', array('%title' => $this->set->label())), '"Add to shortcuts" link properly switched to "Remove from shortcuts".');
$this->assertNoLink('Cron', 'Shortcut link removed from different page');
......@@ -407,8 +407,8 @@ function shortcut_preprocess_page(&$variables) {
$query = array(
'link' => $link,
'name' => drupal_get_title(),
'link' => $link,
'name' => $variables['title'],
$query += drupal_get_destination();
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment