Commit a2ab6eac authored by webchick's avatar webchick
Browse files

Issue #1894840 by dcrocks, larowlan: Fixed regression - main menu not shown on front page.

parent e2941705
...@@ -29,7 +29,7 @@ class SystemMenuBlock extends BlockBase { ...@@ -29,7 +29,7 @@ class SystemMenuBlock extends BlockBase {
public function blockAccess() { public function blockAccess() {
// @todo The 'Tools' menu should be available to anonymous users. // @todo The 'Tools' menu should be available to anonymous users.
list($plugin, $derivative) = explode(':', $this->getPluginId()); list($plugin, $derivative) = explode(':', $this->getPluginId());
return ($GLOBALS['user']->uid || in_array($derivative, array('menu-tools', 'menu-footer'))); return ($GLOBALS['user']->uid || in_array($derivative, array('menu-main', 'menu-tools', 'menu-footer')));
} }
/** /**
......
...@@ -32,6 +32,22 @@ function testStandard() { ...@@ -32,6 +32,22 @@ function testStandard() {
$this->assertLink(t('Contact')); $this->assertLink(t('Contact'));
$this->clickLink(t('Contact')); $this->clickLink(t('Contact'));
$this->assertResponse(200); $this->assertResponse(200);
// Test anonymous user can access 'Main navigation' block.
$admin = $this->drupalCreateUser(array('administer blocks'));
$this->drupalLogin($admin);
// Configure the block.
$this->drupalGet('admin/structure/block/add/system_menu_block:menu-main/bartik');
$this->drupalPost(NULL, array(
'region' => 'sidebar_first',
'machine_name' => 'main_navigation',
), t('Save block'));
// Verify admin user can see the block.
$this->drupalGet('');
$this->assertText('Main navigation');
// Verify anonymous user can see the block.
$this->drupalLogout();
$this->assertText('Main navigation');
} }
} }
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