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.

Files: 
CommentFileSizeAuthor
#3 og_context-removed-notice-2.patch818 bytesBlackice2999
PASSED: [[SimpleTest]]: [MySQL] 780 pass(es). View
#1 og_context-removed-notice.patch1.33 KBBlackice2999
PASSED: [[SimpleTest]]: [MySQL] 780 pass(es). View

Comments

Blackice2999’s picture

Status: Active » Needs review
FileSize
1.33 KB
PASSED: [[SimpleTest]]: [MySQL] 780 pass(es). View

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
PASSED: [[SimpleTest]]: [MySQL] 780 pass(es). View

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.