- πͺπͺEstonia tormi Tallinn
This needs to be resolved here as well probably:
array_values() expects parameter 1 to be array, null given og_create_perms.module:15
. - Status changed to Needs review
almost 2 years ago 7:12am 16 February 2023
og_get_context_by_url() no longer exists in og7.x-2x-dev og_context.module Our site is throwing fatal errors:
Fatal error: Call to undefined function og_get_context_by_url() in ... /sites/all/modules/contrib/og_create_perms/og_create_perms.module on line 9 (and again in line 12)
I add this function to og_context.module:
function og_get_context_by_url() {
$return = array();
return $return;
}
Bleh. I change function og_create_perms_node_access($node, $op, $account) to:
function og_create_perms_node_access($node, $op, $account) {
$result = NODE_ACCESS_IGNORE;
$gids = og_get_context_by_url();
$type = is_string($node) ? $node : $node->type;
if ($op == 'create' && in_array($type, og_create_perms_list_bundles())) {
foreach ($gids as $gid) {
// loop through any of the provided gids, and only allow access if we can post to all of them
$access = true;
if (!og_user_access($gid, 'create ' . $type . ' content', $account)) {
$access = false;
}
if ($access) $result = NODE_ACCESS_ALLOW;
}
}
return $result;
}
Patch is attached for function og_create_perms_node_access($node, $op, $account). A patch for og_context.module is obviously not worthy.
Should I also create this issue in og_context.module? Please advise. Thanks!
Needs review
1.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
This needs to be resolved here as well probably: array_values() expects parameter 1 to be array, null given og_create_perms.module:15
.