Hi,
An odd thing just happened, and I'm not sure if it's something I did or a problem with the latest version of the module, which I installed a few hours ago.

Until a few hours ago, registration codes were working fine:
- The user goes to og/regcode, enters a registration code and clicks submit.
- The user then sees a confirmation screen "do you want to join this group"?
- The user clicks "join", and is now a member of the group.

Now, however, the confirmation screen is not displayed.
After the user submits the og/regcode form, they are automatically added as a member of the group (without confirmation). The user is then redirected back to the same "enter a registration code" form.

I tried disabling all my custom modules, thinking that perhaps the problem was due to a bug in my custom code. But that did not fix the problem.

Do you have any thoughts on what may be causing this? Might it be a problem with the latest version of the module? Or is there something else I may have inadvertently done with my system configuration to cause this?

Thanks,
Mindy

Comments

somebodysysop’s picture

Status: Active » Postponed (maintainer needs more info)

In which version of ogur did you notice a confirmation screen on regcode requests? Can you go back to that version to verify? What version of og?

I just looked at the code, and the behaviour you describe is the correct behaviour as far as I can tell.

After the user submits the og/regcode form, they are automatically added as a member of the group (without confirmation). The user is then redirected back to the same "enter a registration code" form.

This is the behaviour in every version of OGUR since the inclusion of registration codes. OGUR has never had a confirmation screen on an og join.

The issue could be with og_save_subscription in the og.module:

function og_user_roles_register_submit($form, &$form_state) {
  global $user;
  
  if ($user->uid) {
    $gid = og_user_roles_gid_from_regcode($form_state['values']['og_user_roles_regcode']);
	if ($gid > 0) {
	  $node = node_load($gid);
	  $title = $node->title;
      $return = og_save_subscription($gid, $user->uid, array('is_active' => 1)); // as per http://drupal.org/node/156224
      drupal_set_message(t('Subscription request to ' . l($title, 'node/'. $gid) . ' approved.'));	
      // Delete this registration code if 'delete_regcode' is set
      if (variable_get('og_user_roles_delete_regcode_' . $gid, 0) == 1) og_user_roles_delete_regcode($gid, $form_state['values']['og_user_roles_regcode']);
      // Places all new registration code group subscribers into default regcode role.
      if (variable_get('og_user_roles_assign_regcoderole_' . $gid, 0)) { // check to see if this variable exists
        if (variable_get('og_user_roles_assign_regcode_gid', 0) == 1 && variable_get('og_user_roles_assign_regcoderole_' . $gid, 0) == 1 ) {
          $rid = variable_get('og_user_roles_regcoderole_value_' . $gid, 0);
          og_user_roles_role_join($user->uid, $rid, $gid); // assign user to group role in that group
        }
      }
	}
  } else {
    drupal_access_denied();
  }

}

Good luck getting any assistance on this over there.

kobnim’s picture

Thanks. I think I figured out what probably happened. I think the problem is in my own customized code.

somebodysysop’s picture

Assigned: Unassigned » somebodysysop
Status: Postponed (maintainer needs more info) » Fixed

The confirmation screen was apparently your own modification. However, I liked the idea so much that I added code to OGUR to provide it's own confirmation screen on registration code processing. Committed to CVS .dev and should be packaged into .dev release in about 12 hours.

Thanks!

kobnim’s picture

Hey, that's great. Thank you!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

fiockthis’s picture

How do I activate the registration code confirmation screen?