MyBB Community Forums

Full Version: Hook "member_register_start" called twice, is this a bug or something?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I noticed during registration, hook "member_register_start" (member.php) is called twice.

First time when click "I agree" on agreement page, then the 2nd time when you submit the registration form.

Is there a reason for doing so or bug? I don't think a hook should be called more than once.
Is that so?

I think first one is:
'member_register_start'

and the second one is:
'member_do_register_start'
That's what I thought too, but it actually is:

On submitting agreement form:
'member_register_start'

On submitting registration form:
'member_do_register_start'
'member_register_start' (again)
That doesn't happen by default. member_register_start is only called once.

./member.php:447:		$plugins->run_hooks("member_register_start");

Have you tried a file verification run?
I found it right after upgrading to 1.6.12, so they are latest version and I didn't modify anything.

The hook only appears one place in "member.php", but "member.php" is posted twice during registration, the same code piece which begin with "member_register_start" get hit again. I found this because I added a function to member_register_start and it was implemented again when submitting registration form which is not expected.
I can see only one member_register_start hook in 1.6.12 which gets called only once. Verify your files in ACP -> Tools & Maintenance and check if other plugins modify registration.