Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
function og_vocab_is_group_admin_context() {
if (strpos($_GET['q'], 'group/') === 0 && ($item = menu_get_item()) && !empty($item['map'][2])) {
return array('group_type' => $item['map'][1], 'gid' => $item['map'][2]);
}
So $item['map'][2] might be an object, not a number, and when it is, bam, fatal error when it alters the vocab query cause the db_placehodler is a object instead of a number.
Comment | File | Size | Author |
---|---|---|---|
#7 | 2399883-og_vocab-menuitem-7.patch | 720 bytes | anvmn |
#4 | 2399883-og_vocab-menuitem-4.patch | 768 bytes | hefox |
#2 | 2399883-og_vocab-menuitem-2.patch | 568 bytes | hefox |
Comments
Comment #1
hefox CreditAttribution: hefox commentedA sample the menu item.
Comment #2
hefox CreditAttribution: hefox commentedComment #3
amitaibuThanks. Maybe we should check
arg(2)
is a numeric value?Comment #4
hefox CreditAttribution: hefox commentedSounds like a good idea, added validation for both args.
Comment #5
amitaibuThanks, but I think it's a little hard to read. Maybe you can break it to a few lines/ IFs and maybe add a comment?
Comment #6
JKingsnorth CreditAttribution: JKingsnorth commentedMarking as needs work from amitaibu's comment.
Comment #7
anvmn CreditAttribution: anvmn commentedHere's a patch that checks if $item['map'][2] is an object, and if so, sets $gid to it's id value...
Comment #8
amitaibuSetting correct status