-
Bug
-
Resolution: Unresolved
-
Neutral
-
None
-
1.4.3
If a website contains the marketing tags areas (e.g. headerScripts) and the page is accessed using a POST-request with a parameter named "tags", an error occurs in the marketing tags area.
Steps to reproduce
Check the ZIP archive to reproduce the issue. It contains a site definition, page definition and a Freemarker template. The page only contains the headerScripts area for marketing tags and a basic form with a submit button.
- Import the config.sites.test.xml in the Configuration's app multisite/config/sites. Make sure you modify the paths to point to the relevant templateScript in your project
- Import the templates.pages.test.xml under one of your existing modules under modules/your-module/templates/pages
- Add the test.ftl file provided in the Resources app under /your-module/templates/pages
- I had to disable the csrfTokenSecurity filter to avoid an error
- Add a new page using the "test" template
- Click the submit button
- An error appears in the logs (find the full error attached as "Terminal saved output")
17-Aug-2020 09:55:44.432 SEVERE [http-nio-8080-exec-7] freemarker.log._JULLoggerFactory$JULLogger.error Error executing FreeMarker template FreeMarker template error: No error description was specified for this error; low-level message: info.magnolia.rendering.engine.RenderException: Can't render area node /test with name headerScripts ---- FTL stack trace ("~" means nesting-related): - Failed at: @cms.area name="headerScripts" conten... [in template "travel-demo/templates/pages/test.ftl" at line 6, column 9] ---- ... 2020-08-17 09:55:44,439 ERROR ndering.engine.ModeDependentRenderExceptionHandler: Error while rendering [/test] with template [travel-demo:pages/test] for URI [/test/]: RenderException: freemarker.template.TemplateException: No error description was specified for this error; low-level message: info.magnolia.rendering.engine.RenderException: Can't render area node /test with name headerScripts ...
If the test script is modified, and the name="tags" is changed to another value for example "tags1", the error is gone.
<!DOCTYPE html> <html> <head> [@cms.page /] [@cms.area name="headerScripts" content=content/] </head> <body> <form action="${cmsfn.link(cmsfn.page(content))!}" method="post"> <input type="text" name="tags1" id="tags"> <button type="submit">Submit</button> </form> </body> </html>
Expected results
We should not get an error.
Actual results
An error is thrown
Workaround
Modifying the name to anything that is not "tags" makes it work.
Development notes
"tags" is a common parameter name our customers use. They should be either able to use it or be clearly warned that this is a reserved word.