MyBB Community Forums

Full Version: [Solved] Custom Profile Field Errors
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

  1. I am using a newly installed myBB 1.8.22 forum
Hello. I am encountering a problem with trying to edit my profile. I am slowly adding in custom profile fields through the ACP. When I try to edit my user profile, both my admin account and a regular account, I keep encountering errors that prevent me from submitting information. It seems to only affect the custom fields.

Here is an example:

Quote:Please correct the following errors before continuing:
  • You did not enter a valid value for the "Height" field. Please enter a valid value before continuing.


I receive this error for different fields, depending on what I am trying to update. I have looked through my settings for them, and I do not see anything that is giving me an issue.
Could the problem be the Regular Expression field? Why "cheight"?
Not that I think that's the problem, but I wanted to make sure there wasn't an overlapping problem with the field names I had chosen.
(2020-04-04, 02:38 AM)CandleJack Wrote: [ -> ]Not that I think that's the problem, but I wanted to make sure there wasn't an overlapping problem with the field names I had chosen.

Maybe you can compare fields with default (TexBox) on ACP MyBB.

Your setting maybe need max lengh and regular expression, you can compare the setting fields (Location) with your personal Custon Field.

[Image: compare-fields.png]
I am still experiencing the same errors and issues.
(2020-04-04, 03:25 AM)CandleJack Wrote: [ -> ]I am still experiencing the same errors and issues.

Just to be clear: is this after having followed DiegoPino's advice to change "Regular Expression" from "cheight" to empty, and to change "Maximum Length" from 0 to 255? And if so, have you made sure to make corresponding changes to all custom fields that you've added?
I did not change the expressions. Is the "regular expressions" the equivalent to the field IDs like what I've been finding in older posts for the previous version of myBB? If I don't set the expressions, how am I going to figure out the field ID so I can set them in the custom profile I've created?

I have changed all the character lengths to the max. That did not change the problem.

I guess my misinterpretation of what the "Regular Expression" thing is what caused the problem. I took them all out, left them blank, and I am now able to update the profile areas.
[I see you've edited your post to indicate that you've solved the problem - nice! - but since I had composed this post already and was just about to submit it, I'll do that anyway. It might help confirm/update your understanding.]

(2020-04-04, 04:09 AM)CandleJack Wrote: [ -> ]I did not change the expressions.

OK, you need to do that, because the one you've got now means that any user input for that field needs to exactly match "cheight" - and, obviously, that's not what you want.

(2020-04-04, 04:09 AM)CandleJack Wrote: [ -> ]Is the "regular expressions" the equivalent to the field IDs like what I've been finding in older posts for the previous version of myBB?

Regular expressions are special patterns according to which values are matched. You can, for example, with a regular expression create a pattern that matches values that are only digits (which would be more appropriate for your custom "height" field, but maybe not even exactly what you want). If you did want to match like that, then you would enter something like this in the Regular Expression field:

\d+

With that regular expression, any value that the user entered that was not a string of one or more digits would be rejected with the error message you're currently seeing. Right now, though, any value that the user enters that is not exactly equal to "cheight" is being rejected with the error message you're seeing. Again, this is not what you want.

Wikipedia has a page on regular expressions in case you are interested in learning more (though I have not yet read it myself):

https://en.wikipedia.org/wiki/Regular_expression

(2020-04-04, 04:09 AM)CandleJack Wrote: [ -> ]If I don't set the expressions, how am I going to figure out the field ID so I can set them in the custom profile I've created?

I'm not sure what you mean. If you choose "Yes" to the "Display on profile?" setting question (which you have done), then the fields show up when viewing a given user's profile under "Additional Info About [username]". Do you want something more than / different to that to occur? If so: what exactly are you trying to achieve with your custom profile fields?

(2020-04-04, 04:09 AM)CandleJack Wrote: [ -> ]I have changed all the character lengths to the max. That did not change the problem.

Right, because the (current) problem is that you have set a value for the Regular Expression field that is highly, highly unlikely to ever match anything a user might enter.
I marked your post as the best solution because you have provided clarification for what my problems were. However I don't want to invalidate DiegoPino, because he was also very helpful! Thank you for the much needed insight!