Bug tracker

This ticket has been moved to our new tracker. Open Ticket PHPBB3-8775 now.

Undefined index: NEWLY_REGISTERED when removing 'newly user' from default group (fix completed in vcs)

I was testing this with Raimon because some strange things happened, this is causing it:

When removing a "newly registered user" from his default group, let's say "Global Moderators" his default group is removed, but no other default group is being set.

You need debug enabled to see the error:
[phpBB Debug] PHP Notice: in file /includes/functions_user.php on line 2904: Undefined index: NEWLY_REGISTERED
This happens in both the ACP and UCP.

The message "Users removed from group and new defaults set successfully." does appear and the user is removed from that group, but he keeps his color & rank.

Comments / History

Changed ticket severity from "Uncategorised/normal" to "Severe"

Action performed by Derky (MOD Team Member) on Oct 4th 2009, 20:18

Posted by Raimon (Styles Team Leader) on Oct 4th 2009, 20:22

The issue is that the NEWLY_REGISTERED is missing from the "$group_order" on /includes/functions_user.php

To patch i have attached fix the issue.
bug52525.patch (767 Bytes)

Posted by Acyd Burn (Server Manager) on Oct 5th 2009, 13:06

The order you have in the patch is wrong. ;) NEWLY_REGISTERED should appear after REGISTERED (the order is laid out to describe the permissions/groups from highest to lowest)

Posted by Acyd Burn (Server Manager) on Oct 5th 2009, 13:06

Can you verify this works for you?

Code: Select all
   if ($config['coppa_enable'])
   {
      $group_order = array('ADMINISTRATORS', 'GLOBAL_MODERATORS', 'REGISTERED_COPPA', 'REGISTERED', 'NEWLY_REGISTERED', 'BOTS', 'GUESTS');
   }
   else
   {
      $group_order = array('ADMINISTRATORS', 'GLOBAL_MODERATORS', 'REGISTERED', 'NEWLY_REGISTERED', 'BOTS', 'GUESTS');
   }

Posted by Raimon (Styles Team Leader) on Oct 5th 2009, 13:12

Odd but that is how i did on my test board :/ i though newly first, since REGISTERED_COPPA was also used first and not REGISTERED.

Posted by Raimon (Styles Team Leader) on Oct 5th 2009, 13:28

Addition to that the default group for that user would now be "REGISTERED" what is wrong since his default group need to be "NEWLY_REGISTERED".

Posted by bantu (3.0 Release Manager) on Oct 5th 2009, 14:22

There is no need to change the default group as far as I know/remember.

Posted by Raimon (Styles Team Leader) on Oct 5th 2009, 15:07

When he was registered his default group was "NEWLY_REGISTERED" , when you remove him of his custom default group the default group is suddenly "REGISTERED".
So that is incorrect behavior.

Posted by Acyd Burn (Server Manager) on Oct 5th 2009, 16:04

No, this is the exact intended behaviour. If you remove a user from his default group his default group assigned will be one of his remaining of course. This is far from incorrect behaviour.

Ticket details

Related SVN changesets