Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User profile validation pattern error-message not rendered from messages_en.properties #29098

Open
1 of 2 tasks
DaBonse opened this issue Apr 26, 2024 · 1 comment
Open
1 of 2 tasks

Comments

@DaBonse
Copy link

DaBonse commented Apr 26, 2024

Before reporting an issue

  • I have read and understood the above terms for submitting issues, and I understand that my issue may be closed without action if I do not follow them.

Area

admin/ui

Describe the bug

I use translation placeholder to configure messages for the user profile attributes. This worked as expected.

The translations located in the propertie file of the admin theme.

But the error-message for the pattern validator will not be rendered. Other placeholder translations like annotations work fine in the same properties file, e.g. profile.attribute.myAttribute.placeholder and profile.attribute.myAttribute.description.

I tested it with "Add User" in the Admin UI keycloak.v2 theme.

Part of json config of the user profile:

{ "name": "myAttribute", "displayName": "${profile.attribute.myAttribute}", "validations": { "pattern": { "pattern": "^(admin|abc[0-9]{9,9})$", "error-message": "${profile.attribute.myAttribute.validator.errorMessage}" } }, "annotations": { "inputTypePlaceholder": "${profile.attribute.myAttribute.placeholder}", "inputHelperTextBefore": "${profile.attribute.myAttribute.description}" }, "required": { "roles": [ "admin", "user" ] }

Content in: admin/messages/messages_en.properties

profile.attribute.myAttribute.validator.errorMessage=My error message

Version

nightly Docker build

Regression

  • The issue is a regression

Expected behavior

Validator message should be rendered like other placeholders.

Actual behavior

see description on top

How to Reproduce?

  • create a new realm
  • configure user attribute like my example
  • expand keycloak.v2 admin theme only with the admin/messages/messages_en.properties file
  • activate the custom theme
  • create a new user over Admin UI in the realm and put a invalid value to the attribute form field

Anything else?

No response

@keycloak-github-bot
Copy link

Due to the amount of issues reported by the community we are not able to prioritise resolving this issue at the moment.

If you are affected by this issue, upvote it by adding a 👍 to the description. We would also welcome a contribution to fix the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants