Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Error behaviour
Patrick_ Offline
Junior Member
**
Posts: 27
Joined: Oct 2011
Post: #1
Error behaviour
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.

(This post was last modified: 10-21-2011 05:44 PM by Patrick_.)
10-21-2011 05:37 PM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #2
RE: Error behaviour
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?

My Blog
10-21-2011 08:04 PM
Find all posts by this user Quote this message in a reply
Patrick_ Offline
Junior Member
**
Posts: 27
Joined: Oct 2011
Post: #3
RE: Error behaviour
I'll send you a pm.
10-21-2011 09:50 PM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #4
RE: Error behaviour
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.

My Blog
10-22-2011 09:54 AM
Find all posts by this user Quote this message in a reply
Patrick_ Offline
Junior Member
**
Posts: 27
Joined: Oct 2011
Post: #5
RE: Error behaviour
Thanks ZiNgA BuRgA!
10-22-2011 05:32 PM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: