I got an error message in OG forum that can be traced back to the OG user Roles.

Posts: (http://drupal.org/project/issues/og_user_roles?categories=All)

For me it was Organic groups user Roles 6.x-4.1 That Created this problem. Deactivated the module and simply everything was fine again. But I Would like two use this module so I wil try two find the error appears. Since my site is in production so I wil make me a Sandbox leaves.

Someone who can help me with this problem?

Comments

sun’s picture

Status: Active » Closed (won't fix)

Sorry, but we need actual error messages here, along with detailed information about your Drupal site/system to replicate this bug.

Please re-open this issue if this error occurs again.

jen.c.harlan’s picture

Hi, I am having the same issue I think. My Drupal expert (the guy that is teaching me to use this wonderful system) said that he traced the bug back to this module as well, but doesn't have time to fix it right now). I am currently running on a testing server which is why the urls are so long, but I will copy what I am seeing on the screen.

I am getting 2 simultaneous errors upon creation of forum topics and using the shoutbox inside group forums.

The errors are:

warning: array_keys() [function.array-keys]: The first argument should be an array in /home/daysparrow/public_html/musicweb/sites/rootaction.net.~daysparrow.axis/modules/og_forum/og_forum.module on line 440.
warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/daysparrow/public_html/musicweb/sites/rootaction.net.~daysparrow.axis/modules/og_forum/og_forum.module on line 440.

Warning: Wrong parameter count for debug_backtrace() in /home/daysparrow/public_html/musicweb/sites/all/modules/drupal_tweaks/drupal_tweaks.inc on line 204

(The drupal tweaks error repeats twice)

I am still learning drupal and the contributing modules, so I have absolutely no idea why this is being traced back to this module, but I have been told by 2 separate individuals, that this module is causing my issue.

- Jen

sun’s picture

Status: Closed (won't fix) » Active

Re-opening for now

jen.c.harlan’s picture

Oh, I forgot to mention, we have gotten this error both in 6.x-4.1 and 6.x-4.x-dev.

Cainan’s picture

Further info on the above error.

its reproducible vai the following:

as a member of a group (user #1 is fine),
go to your Groups forum, and click 'create forum topic'
URL in this case is: http://?q=node/add/forum&gids[]=16

jen.c.harlan’s picture

Is there any progress on this? I can't really get any farther on my test site as long as I have this error.

charlie-s’s picture

Also receiving this error:

Warning: Wrong parameter count for debug_backtrace() in /usr/share/drupal6/sites/all/modules/drupal_tweaks/drupal_tweaks.inc on line 204

Disabling drupal tweaks until I can get it corrected. Using 4.1. May have something to do with improper characters in pathauto URL's... I can't say for sure.

Ole Martin’s picture

Just to mention it, I do not use this module right now. Too much trouble - too little time to wait for a solution

sun’s picture

Status: Active » Closed (won't fix)

None of the error messages mentioned in #2 are related to this module. If you look more closely at the reported filepaths, then you realize that og_user_roles is not contained anywhere.

jen.c.harlan’s picture

I know that the error messages do not mention og_user_roles, but the problem goes away if I disable or uninstall og_user_roles...

It then comes back if I reinstall or re-enable og_user_roles.

How then is og_user_roles not the problem?

sun’s picture

/**
 * Implementation of hook_db_rewrite_sql().
 */
function og_forum_db_rewrite_sql($query, $primary_table = 'n', $primary_field = 'nid', $args = array()) {
  global $user;

  if ($primary_field == 'tid') { 
    if (arg(0) == 'node' && arg(1) == 'add' && arg(2) == 'forum') {
	  if (isset($_GET['gids']) && is_array($_GET['gids']) && isset($_GET['gids'][0]) && is_numeric($_GET['gids'][0])) {
	    if (in_array($_GET['gids'][0], array_keys($user->og_groups))) {   <------- OFFENDING LINE
	      return;
	    }
	  }
      $return['join'] = "LEFT JOIN {og_term} ogt ON t.tid = ogt.tid";
      $return['where'] = "ogt.nid IS NULL";
      if ($og_forum_container = variable_get('forum_default_container', FALSE)) {
        $return['where'] .= " AND t.tid != $og_forum_container";
      }
      $return['distinct'] = TRUE;
      return $return;
    }
  }
}

See #694690: OG forum warning: array_keys() [function.array-keys]: The first argument should be an array