-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not load menu item just before determining context handler to prev…
…ent premature access denial due to empty og context.
- Loading branch information
Joachim Willems
committed
Jan 28, 2015
1 parent
ad19dcb
commit 66d3b72
Showing
1 changed file
with
1 addition
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -366,10 +366,6 @@ function og_context_determine_context($group_type, $item = NULL, $check_access = | |
return; | ||
} | ||
|
||
if (empty($item)) { | ||
$item = menu_get_item(); | ||
} | ||
|
||
$providers = og_context_negotiation_info(); | ||
foreach ($enabled_providers as $name => $ignore) { | ||
if (empty($providers[$name])) { | ||
|
@@ -379,7 +375,7 @@ function og_context_determine_context($group_type, $item = NULL, $check_access = | |
$invoke = FALSE; | ||
if (!empty($provider['menu path'])) { | ||
foreach ($provider['menu path'] as $path) { | ||
if (strpos($item['path'], $path) === 0) { | ||
if (strpos(current_path(), $path) === 0) { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
amitaibu
Member
|
||
$invoke = TRUE; | ||
// Path matches, so we can break. | ||
break; | ||
|
This causes a bug in node context negotiation. I put a line just above this with the following debug code:
causing the following to be printed:
Yeh, this will fail.