Issue #2561201 by larowlan, cilefen, Sutharsan: Fatal error when creating a shortcut in a new shortcut set
parent
0f9fd871e4
commit
ea3432a553
|
@ -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 @@ use Drupal\shortcut\ShortcutSetInterface;
|
||||||
* }
|
* }
|
||||||
* )
|
* )
|
||||||
*/
|
*/
|
||||||
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 @@ class ShortcutLinksTest extends ShortcutTestBase {
|
||||||
];
|
];
|
||||||
$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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue