-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathog_edit_update_entity_reference_not_node.patch
More file actions
22 lines (22 loc) · 1.18 KB
/
Copy pathog_edit_update_entity_reference_not_node.patch
File metadata and controls
22 lines (22 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
diff --git a/plugins/entityreference/selection/OgSelectionHandler.class.php b/plugins/entityreference/selection/OgSelectionHandler.class.php
index 249c84e..cf8990d 100644
--- a/plugins/entityreference/selection/OgSelectionHandler.class.php
+++ b/plugins/entityreference/selection/OgSelectionHandler.class.php
@@ -125,8 +125,15 @@ class OgSelectionHandler extends EntityReference_SelectionHandler_Generic {
}
elseif (!empty($node->nid) && (og_user_access($group_type, $gid, "update any $node_type content") || ($user->uid == $node->uid && og_user_access($group_type, $gid, "update own $node_type content")))) {
$node_groups = isset($node_groups) ? $node_groups : og_get_entity_groups('node', $node->nid);
- if (in_array($gid, $node_groups['node'])) {
- $ids[] = $gid;
+ if (isset($node_groups['node'])) {
+ if (in_array($gid, $node_groups['node'])) {
+ $ids[] = $gid;
+ }
+ }
+ elseif (isset($node_groups[$group_type])) {
+ if (in_array($gid, $node_groups[$group_type])) {
+ $ids[] = $gid;
+ }
}
}
}