[MAGNOLIA-5355] ELException when using TemplatingFunctions link-method Created: 02/Oct/13 Updated: 16/Oct/13 Resolved: 14/Oct/13 |
|
| Status: | Closed |
| Project: | Magnolia |
| Component/s: | templating |
| Affects Version/s: | 5.1 |
| Fix Version/s: | 5.1.1 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Sigurd Rolfes | Assignee: | Jozef Chocholacek |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Mgnl 5.1-rc1 ee |
||
| Issue Links: |
|
||||||||
| Template: |
|
||||||||
| Acceptance criteria: |
Empty
|
||||||||
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
||||||||
| Bug DoR: |
[ ]*
Steps to reproduce, expected, and actual results filled
[ ]*
Affected version filled
|
||||||||
| Date of First Response: | |||||||||
| Sprint: | 5.1.1 | ||||||||
| Description |
|
I've got a problem using the cmsfn functions (of class TemplatingFunctions). I get an ELException when trying to create a link in combination with nodeByPath-method: ${cmsfn.link(cmsfn.nodeByPath("/Startseite", "website"))} This leads to ELException, because nodeByPath returns a info.magnolia.audit.MgnlAuditLoggingContentDecoratorNodeWrapper object and EL tries to use the link-method with parameter ContentMap instead of that one with Node. Seems EL has a problem recognizing that the wrapper implements JCR Node. Using another link-method of TemplatingFunctions works fine: ${cmsfn.link("website", cmsfn.nodeByPath("/Startseite", "website").UUID)} – Note: I'm using Blossom and have cmsfn configured via spring configuration, but I don't think that makes a difference. ####################################################### Stacktrace: Caused by: javax.el.ELException: Cannot convert node /Startseite of type class info.magnolia.audit.MgnlAuditLoggingContentDecoratorNodeWrapper to class info.magnolia.jcr.util.ContentMap |
| Comments |
| Comment by Sigurd Rolfes [ 07/Oct/13 ] |
|
forgot to say: I'm using JSPs. My Spring configuration: <!-- Resolver for webflow jsp-Templates --> |
| Comment by Christopher Zimmermann [ 09/Oct/13 ] |
|
Daniel might have some input on how to fix. |
| Comment by Eric Hechinger [ 14/Oct/13 ] |
|
You are currently using TemplatingFunction as a JSP function. But a tag library can have only one function element that has any given name element with the same number of parameter. In TemplatingFunction we expose: So you will have either to declare and use JspTemplatingFunction |
| Comment by Jozef Chocholacek [ 14/Oct/13 ] |
|
Created a follow-up issue |
| Comment by Sigurd Rolfes [ 16/Oct/13 ] |
|
Eric, using JspTemplatingFunction leads to NoSuchComponentException, see stacktrace at the end. I've seen in the renderer module that for the standard JspRenderer also the TemplatingFunction are defined. If the TemplatingFunction class is not provided for using it with JSPs (Freemarker only) a hint in the javadoc would be fine. Sigurd ##################################################### Caused by: info.magnolia.objectfactory.NoSuchComponentException: No component configuration for type [info.magnolia.templating.jsp.cmsfn.JspTemplatingFunction] found. Please add a configuration to your module descriptor. |