Commit ea3432a5 authored by alexpott's avatar alexpott

Issue #2561201 by larowlan, cilefen, Sutharsan: Fatal error when creating a...

Issue #2561201 by larowlan, cilefen, Sutharsan: Fatal error when creating a shortcut in a new shortcut set
parent 0f9fd871
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
namespace Drupal\shortcut\Entity; namespace Drupal\shortcut\Entity;
use Drupal\Core\Config\Entity\ConfigEntityBase; use Drupal\Core\Config\Entity\ConfigEntityBundleBase;
use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\EntityStorageInterface;
use Drupal\shortcut\ShortcutSetInterface; use Drupal\shortcut\ShortcutSetInterface;
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
* } * }
* ) * )
*/ */
class ShortcutSet extends ConfigEntityBase implements ShortcutSetInterface { class ShortcutSet extends ConfigEntityBundleBase implements ShortcutSetInterface {
/** /**
* The machine name for the configuration entity. * The machine name for the configuration entity.
......
...@@ -105,6 +105,21 @@ public function testShortcutLinkAdd() { ...@@ -105,6 +105,21 @@ public function testShortcutLinkAdd() {
]; ];
$this->drupalPostForm('admin/config/user-interface/shortcut/manage/' . $set->id() . '/add-link', $form_data, t('Save')); $this->drupalPostForm('admin/config/user-interface/shortcut/manage/' . $set->id() . '/add-link', $form_data, t('Save'));
$this->assertLink($title, 0, 'Shortcut link found on the page.'); $this->assertLink($title, 0, 'Shortcut link found on the page.');
// Create a new shortcut set and add a link to it.
$this->drupalLogin($this->adminUser);
$edit = array(
'label' => $this->randomMachineName(),
'id' => strtolower($this->randomMachineName()),
);
$this->drupalPostForm('admin/config/user-interface/shortcut/add-set', $edit, t('Save'));
$title = $this->randomMachineName();
$form_data = [
'title[0][value]' => $title,
'link[0][uri]' => '/admin',
];
$this->drupalPostForm('admin/config/user-interface/shortcut/manage/' . $edit['id'] . '/add-link', $form_data, t('Save'));
$this->assertResponse(200);
} }
/** /**
......
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