[4529][2.0 RC4/Subs.php] member awaiting approval notice

Started by Sverre, November 04, 2010, 08:11:47 AM

Previous topic - Next topic

Sverre

After upgrading my test forum from RC3 to RC4, the "There is one member awaiting approval." line in the header is displayed despite the fact that the approval queue is empty. It only seems to happen with the "Require admin approval when member deletes account" option checked.

No mods installed.

As far as I can tell, it is caused by the changes introduced in the following line (Revision 9916?):

Code (Subs.php) Select
$context['unapproved_members'] = (!empty($modSettings['registration_method']) && $modSettings['registration_method'] == 2) || !empty($modSettings['approveAccountDeletion']) ? $modSettings['unapprovedMembers'] : 0;

Kolya


pitta


Jfdowim5

Quote from: Sverre on November 04, 2010, 08:11:47 AM
It only seems to happen with the "Require admin approval when member deletes account" option checked.
Ditto.

NanoSector

My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Brettflan

#5
Same here on my test backup forum, with account deletion requiring admin approval set. I wasn't going to report it until I'd fully investigated it and come up with a good solution, but since this topic is already here... some screenshots:



When I navigate somewhere else in the admin Manage Members section, the "Awaiting Approval" menu item disappears:

If I set the registration method to "admin approval", that menu item always shows up. So, the code that determines whether to show that menu item should also be updated to show it if account deletion requires admin approval.

Is there some place where you can actually see a list of people who have requested account deletion? I haven't come across it anywhere, but I might well have just missed it.


I came to the same conclusion as Sverre on the cause of it showing up being that particular change in Subs.php, from this in RC3:
$context['unapproved_members'] = !empty($modSettings['registration_method']) && $modSettings['registration_method'] == 2 ? $modSettings['unapprovedMembers'] : 0;
to this in RC4:
$context['unapproved_members'] = (!empty($modSettings['registration_method']) && $modSettings['registration_method'] == 2) || !empty($modSettings['approveAccountDeletion']) ? $modSettings['unapprovedMembers'] : 0;


EDIT: I made a small mod package to revert that line of code for myself, so I figured I might as well share. It's attached to this post.

EDIT 2: also, I've reopened the report Sverre linked to and added a link back to this topic.

EDIT 3: attached package removed; better package with a more proper fix posted further down the thread.

pitta


Kolya

Note that downgrading the relevant code is only a temporary fix, pitta.
Thank you for re-opening the issue in the bug tracker, Brett.


dsanchez

this is the message I have in the Welcome area, however, when I clic on the link there are no members waiting for activations :o

xenovanis

"Insanity: doing the same thing over and over again and expecting different results."


booch_21

Oddly enough, I started to see this in RC3, before upgrading.  The error would occur when I either "Reject" or "Reject and Send Mail".  All other options would clear that flag and no message was displayed.




Aleksi "Lex" Kilpinen

I believe I have come across this one as well, but at the time I thought I just had some DB hickup - and forgot all about it.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

[SiNaN]

As I said to Brettflan in private as well, I'm unable to reproduce this with a fresh RC4 install. If anyone is willing to provide me with temporary admin and database access via pm, I would be happy to investigate it further.
Former SMF Core Developer | My Mods | SimplePortal

Aleksi "Lex" Kilpinen

Just checked, and this doesn't seem to happen on my install anymore either. Don't know what has changed.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Brettflan

#16
Yeah, I tested it out further yesterday and new account deletion requests show up fine there, and can be handled without a hitch. The problem seems to be with old account deletion requests. The listed number of "awaiting approval" went from 73 -> 74 with the new account deletion request, though only the one new request showed up on the Awaiting Approval page, and the number went back down to 73 when I handled the new account deletion request.
As I told SiNaN, I'll investigate it further today (in a couple of hours or so) to find the cause and report back.

Jfdowim5

シナン, you're welcome to fiddle about with mine if it's any help.  Quiet forum so I'm not sure how much use it would be.

Brettflan, that would seem to make sense.  I was wondering why your number was so much higher than mine.  I know that there's only been one account deleted by a member since I started the forum and mine does say that one approval is needed.

Brettflan

#18
OK, I think I've found the problem (or at least, a problem). The 'unapprovedMembers' value is stored in the settings table, and only ever incremented or decremented normally. Even if you run through "Recount all forum totals and statistics", it only bothers to recalculate that value if the forum is set to require admin approval for account activation, not if the forum is set to require admin approval for account deletion. So, in our cases, that value is never recalculated.

I'm currently testing it with another runthrough of "Recount all forum totals and statistics" without modification (which I did run without success earlier, but I just want be sure), and then again with a modification to the apparent problem line 285 in Subs.php. If successful, I'll post back with the code change and a mod package for it. It could take a while though, since this is a large forum it's recalculating statistics on.

EDIT: I'll go ahead and post the problem line, it's currently this:
if (!empty($modSettings['registration_method']) && $modSettings['registration_method'] == 2)
Based on the other change made for RC4, it should be this:
if ((!empty($modSettings['registration_method']) && $modSettings['registration_method'] == 2) || !empty($modSettings['approveAccountDeletion']))

Brettflan

#19
I was right. The above line needs to be updated. As for how the "unapprovedMembers" value got so far off track for us in the first place, I don't know.

For anyone who installed my package from earlier in the topic, you should uninstall it and use the new one attached to this topic.

EDIT: fix package received a further update, see page 2 for the final version of it attached to another post.

Advertisement: