If a user without access permissions tries to acces a URL like 'node/7/group' the following error occurs:
Undefined index: map in og_context_handler_node() on line 426 from og_context.module

Patch follows.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Blackice2999’s picture

Status: Active » Needs review
FileSize
1.33 KB

Hi,

fixed missing existence check for map on menu item. (map only exist if a user has access to an item)

thanks
Dennis

amitaibu’s picture

Status: Needs review » Needs work

Thanks.

+++ b/og_context/og_context.moduleundefined
@@ -422,13 +422,17 @@ function og_context_handler_node($node = NULL) {
+  // only proceed if map is exists (user has access)
+  if(isset($item['map']['1'])) {

I actually prefer to return early, e.g.:

if (empty($item...)) {
  return;
}
Blackice2999’s picture

Status: Needs work » Needs review
FileSize
818 bytes

Hi Amitaibu,

this make sense. Here the new patch.

amitaibu’s picture

Status: Needs review » Fixed

Committed, thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.