MyBB Community Forums

Full Version: Can't do inline errors in "member_do_register_start" hook
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
https://github.com/mybb/mybb/blob/featur...r.php#L193
Is there any reason why this is here? In the plugin I'm making I add to the $errors array so that it will get detected in the error check near the end of the function, but since it's being reset after the hook is called it doesn't go through.
Hi,

Thank you for your report. We have pushed this issue to our Github repository for further analysis where you can track our commits and progress with fixing this bug. Discussions regarding this bug may also take place there too.

Follow this link to visit the issue on Github: https://github.com/mybb/mybb/issues/1147

Thanks for contributing to MyBB!

Regards,
The MyBB Group
You are not supposed to hook to member_do_register_start to show inline_errors.

Hook at the data-handler instead:
$plugins->add_hook('datahandler_user_validate', 'foo');

function foo(&$dh)
{
	$invalid_user = true;

	if($invalid_user)
	{
		$dh->set_error('foo_invalid_user');
		// $lang->userdata_foo_invalid_user = 'Your registration seems to be invalid.';
	}
}