• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Fixed User name input (option throws exception for bad default value)

Affected version
PR10

AndyB

Well-known member
#1
I'm trying the new User name input function.

1502601603491.png

The problem is when I try to save a blank field in the Option, I get this error:

1502601695839.png

I could change the Data type to string, but then I would need to in the PHP convert the username to a userId. Perhaps allow a non-numeric value for this type of data?
 

Mike

XenForo developer
Staff member
#4
That said, we should probably try to give a better error here. However, the problem is mostly the data type you selected and the lack of a default value.

I'll move this back solely in terms of giving a better error/preventing this exception.
 

AndyB

Well-known member
#5
However, the problem is mostly the data type you selected and the lack of a default value.
Is there any way to have it so the field can be left blank without getting this error message?

1502647075202.png

Seams the only way currently is to have the Data type as a "String", but that returns the username, I would like to have it return the userId.