Issue #2561201 by larowlan, cilefen, Sutharsan: Fatal error when creating a shortcut in a new shortcut set

8.0.x
Alex Pott 2015-09-05 10:28:45 +01:00
parent 0f9fd871e4
commit ea3432a553
2 changed files with 17 additions and 2 deletions

View File

@ -7,7 +7,7 @@
namespace Drupal\shortcut\Entity;
use Drupal\Core\Config\Entity\ConfigEntityBase;
use Drupal\Core\Config\Entity\ConfigEntityBundleBase;
use Drupal\Core\Entity\EntityStorageInterface;
use Drupal\shortcut\ShortcutSetInterface;
@ -47,7 +47,7 @@ use Drupal\shortcut\ShortcutSetInterface;
* }
* )
*/
class ShortcutSet extends ConfigEntityBase implements ShortcutSetInterface {
class ShortcutSet extends ConfigEntityBundleBase implements ShortcutSetInterface {
/**
* The machine name for the configuration entity.

View File

@ -105,6 +105,21 @@ class ShortcutLinksTest extends ShortcutTestBase {
];
$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.');
// 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);
}
/**