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

FTL Error: Failed at: #if !object[key]?? #537

Open
lokmeinmatz opened this issue Apr 11, 2024 · 2 comments
Open

FTL Error: Failed at: #if !object[key]?? #537

lokmeinmatz opened this issue Apr 11, 2024 · 2 comments

Comments

@lokmeinmatz
Copy link

Hi, first thanks for your great work at keycloakify! :)

After upgrading our keycloak from 21.1.1 to 24.0.1, we get the following error:

2024-04-11 14:48:11,045 ERROR [freemarker.runtime] (executor-thread-3) Error executing FreeMarker template part in the #attempt block: freemarker.core._TemplateModelException: An error has occurred when reading existing sub-variable "attemptedUsername"; see cause exception! The type of 

the containing value was: extended_hash+string (org.keycloak.forms.login.freemarker.model.AuthenticationContextBean wrapped into f.e.b.StringModel)
2024-04-11T14:48:11.048521133Z 
2024-04-11T14:48:11.048524425Z ----
2024-04-11T14:48:11.048526217Z FTL stack trace ("~" means nesting-related):
2024-04-11T14:48:11.048528092Z 	- Failed at: #if !object[key]??  [in template "register-user-profile.ftl" in function "ftl_object_to_js_code_declaring_an_object" at line 532, column 21]
2024-04-11T14:48:11.048541633Z 	- Reached through: ${ftl_object_to_js_code_declaring_an_...  [in template "register-user-profile.ftl" at line 6, column 17]
2024-04-11T14:48:11.048543425Z ----
2024-04-11T14:48:11.048544967Z 	at freemarker.ext.beans.BeanModel.get(BeanModel.java:185)

I attached the referenced ft file: register-user-profile.ftl.txt.

I also found some other issues from the past that referenced similar errors, maybe this can help solving?

Thanks and let me know if I can help with more infos!
Matthias

@garronej
Copy link
Collaborator

garronej commented Apr 11, 2024

Hello @lokmeinmatz,

Thank you for the kind words.

I am actively working on updating the templates for Keycloak 24 and will provide a migration guide.

If you cannot wait, you may undertake the update on your own. It's important to know that register-user-profile.ftl no longer exists in Keycloak 24. Instead, register.ftl should be used, which now incorporates the user profile feature previously in beta.

You might want to look at:

#533

Related: #517

@garronej
Copy link
Collaborator

Follow progress here: #538

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

No branches or pull requests

2 participants