og_get_context_by_url() no longer exists in og7.x-2x-dev og_context.module

Created on 8 March 2012, over 12 years ago
Updated 16 February 2023, almost 2 years ago

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!

πŸ› Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States esod

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024