'TemplateNode cannot be cast to java.lang.String' error when using certain words in structures
Written By
István Gergely-Tárnoki
How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!
While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.
Legacy Article
You are viewing an article from our legacy "FastTrack"
publication program, made available for informational purposes. Articles
in this program were published without a requirement for independent
editing or verification and are provided"as is" without
guarantee.
Before using any information from this article, independently verify its
suitability for your situation and project.
Issue
- We have a structure that has a field called 'type' and being referenced in the advanced settings
- When we try to preview it, we get the above-mentioned exception in our logs
Resolution
-
The current behavior is expected, since there are certain keywords that are reserved:
- "name"
- "data"
- "options"
- "type"
- "attributes"
- "optionsMap"
- LPS-157183 has been opened to show a warning message when someone tries to save a structure using the mentioned keywords
- If you already have structures and using those keywords as field names, please note that it's not possible to resolve the issue of the already made structures and templates without jeopardizing the integrity of your templates.
- Currently, the correction needs to be done manually or through a script customized for your environment
Did this article resolve your issue ?