Validating user profile field input & displaying hint text

Hi, XWiki community,

I am in the process of setting up a wiki for the staff at the library I work for. Before I started creating actual content, I am trying to get all the little things in order.

I have added several fields to XWikiUsers class using the class editor, and for most of the string-type fields, I added regular expressions against which to validate input, as well as hint text to clarify what the field is for. (I added a “Birthday” field, too, and I added hint text to reassure users that it only stores and displays the month and date, not the year/age.)

My issue arises when I try to test out the profile editing form (inline): hint text is nowhere to be found, and I can save and submit any values I want in all of the string fields. (For example, for the “Year Hired” field, I added the validation pattern /^$|^(?:19|20)\d\d$/ to limit input to either empty or years between 1900 and 2099, but I was able to save a profile with the string “Next year” in that field with no issue.)

I did find that the hint text appears when I use the class editor to edit the XWikiUser object containing my profile information directly, and while I was too cautious to try it, I expect that the validation would occur successfully in that context. It seems that the form editor does not pull/use such information from the object, which is the only way I expect any user to edit their profile. (We’re a library, so the staff skews older and less tech-savvy lol.)

For what it’s worth, I was able to modify the validation pattern and message for the Registration page by modifying the Velocity code directly, and that works perfectly. (It was also very easy to do.) I did extensive searching among hidden pages, etc., on my wiki for the code that generates the user profile form, but I suspect that it is hard-coded into the User Profile Application.

Is there any way to get these features working on the user profile form? I haven’t explored the possibility of creating an application or extension yet because I often get overwhelmed by coding that requires any more than a few lines, but if that’s the route I must follow, I’ll give it a shot…unless there’s already something out there that I can install.

Thanks in advance for the help!