Commit b34bcec0 authored by alexpott's avatar alexpott
Browse files

Issue #2030645 by lokeoke, Mile23, tim.plunkett, miraj9093, slv_ | plopesc:...

Issue #2030645 by lokeoke, Mile23, tim.plunkett, miraj9093, slv_ | plopesc: Fixed Expand Menu with methods.
parent 585e025e
......@@ -128,7 +128,7 @@ public function form(array $form, FormStateInterface $form_state) {
'#type' => 'textfield',
'#title' => t('Administrative summary'),
'#maxlength' => 512,
'#default_value' => $menu->description,
'#default_value' => $menu->getDescription(),
);
$form['langcode'] = array(
......
......@@ -39,7 +39,7 @@ public function buildRow(EntityInterface $entity) {
'data' => $this->getLabel($entity),
'class' => array('menu-label'),
);
$row['description'] = Xss::filterAdmin($entity->description);
$row['description'] = Xss::filterAdmin($entity->getDescription());
return $row + parent::buildRow($entity);
}
......
......@@ -60,7 +60,7 @@ public function testMenuBlock() {
// Verify that after modifying the menu, there is a cache miss.
$this->pass('Test modification of menu.', 'Debug');
$menu->label = 'Awesome llama';
$menu->set('label', 'Awesome llama');
$menu->save();
$this->verifyPageCache($path, 'MISS');
......
......@@ -41,7 +41,7 @@ public function testMenu() {
$navigation_menu = Menu::load('navigation');
$this->assertEqual($navigation_menu->id(), 'navigation');
$this->assertEqual($navigation_menu->label(), 'Navigation');
$this->assertEqual($navigation_menu->description , 'The navigation menu is provided by Drupal and is the main interactive menu for any site. It is usually the only menu that contains personalized links for authenticated users, and is often not even visible to anonymous users.');
$this->assertEqual($navigation_menu->getDescription() , 'The navigation menu is provided by Drupal and is the main interactive menu for any site. It is usually the only menu that contains personalized links for authenticated users, and is often not even visible to anonymous users.');
// Test that we can re-import using the ConfigEntityBase destination.
Database::getConnection('default', 'migrate')
......
......@@ -34,21 +34,21 @@ class Menu extends ConfigEntityBase implements MenuInterface {
*
* @var string
*/
public $id;
protected $id;
/**
* The human-readable name of the menu entity.
*
* @var string
*/
public $label;
protected $label;
/**
* The menu description.
*
* @var string
*/
public $description;
protected $description;
/**
* The locked status of this menu.
......@@ -57,6 +57,13 @@ class Menu extends ConfigEntityBase implements MenuInterface {
*/
protected $locked = FALSE;
/**
* {@inheritdoc}
*/
public function getDescription() {
return $this->description;
}
/**
* {@inheritdoc}
*/
......
......@@ -14,6 +14,14 @@
*/
interface MenuInterface extends ConfigEntityInterface {
/**
* Returns the description of the menu.
*
* @return string
* Description of the menu.
*/
public function getDescription();
/**
* Determines if this menu is locked.
*
......
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