MyBB Hacks

Full Version: Error behaviour
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
The current XThreads error behavior with custom fields is a little annoying for users. I have a lot of custom fields, but on submit, XThreads only gives an error of the first invalid field. It should list all invalid fields, just like MyBB does.

edit: looking at the code, this actually seems to be a bug

PHP Code:
	$errors = xthreads_input_validate($data, $threadfield_cache, $update_tid);
	foreach($errors as &$error)
		call_user_func_array(array($ph, 'set_error'), $error);


but any error the validation encounters, triggers a break, so there will be never more than one error.

Can't seem to reproduce at the moment, although I haven't done extensive testing.
I can't see how from the code either.  The break statement breaks from the inner-loop, not the outer loop which goes over the thread fields.  The break ensures that you don't get more than one error for each thread field, but you certainly can have more than one error amongst all thread fields.

Do you have a test case to reproduce the bug?
I'll send you a pm.
I haven't tried the login you supplied, but thanks for it anyway.
I managed to find the issue - I'll push a fix through soon.
Thanks ZiNgA BuRgA!
Reference URL's