[MGNLTAGS-81] Parameter "tags" unusable when using Marketing Tags when POSTing the form Created: 17/Aug/20  Updated: 16/Aug/22

Status: Open
Project: Marketing Tags Manager
Component/s: None
Affects Version/s: 1.4.3
Fix Version/s: None

Type: Bug Priority: Neutral
Reporter: Monica Damborenea Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: maintenance, to-verify
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: HTML File Terminal Saved Output     Zip Archive example.zip    
Issue Links:
Relates
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:
Epic Link: AuthorX Support
Team: AuthorX

 Description   

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.

  1. 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
  2. Import the templates.pages.test.xml under one of your existing modules under modules/your-module/templates/pages
  3. Add the test.ftl file provided in the Resources app under /your-module/templates/pages
  4. I had to disable the csrfTokenSecurity filter to avoid an error
  5. Add a new page using the "test" template
  6. Click the submit button
  7. 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.

 


Generated at Mon Feb 12 10:14:16 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.