Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
a2ab6eac
Commit
a2ab6eac
authored
Mar 26, 2013
by
Angie Byron
Browse files
Issue
#1894840
by dcrocks, larowlan: Fixed regression - main menu not shown on front page.
parent
e2941705
Changes
2
Hide whitespace changes
Inline
Side-by-side
core/modules/system/lib/Drupal/system/Plugin/block/block/SystemMenuBlock.php
View file @
a2ab6eac
...
...
@@ -29,7 +29,7 @@ class SystemMenuBlock extends BlockBase {
public
function
blockAccess
()
{
// @todo The 'Tools' menu should be available to anonymous users.
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'
)));
}
/**
...
...
core/profiles/standard/lib/Drupal/standard/Tests/StandardTest.php
View file @
a2ab6eac
...
...
@@ -32,6 +32,22 @@ function testStandard() {
$this
->
assertLink
(
t
(
'Contact'
));
$this
->
clickLink
(
t
(
'Contact'
));
$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'
);
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment