Uploaded image for project: 'Marketing Tags Manager'
  1. Marketing Tags Manager
  2. MGNLTAGS-81

Parameter "tags" unusable when using Marketing Tags when POSTing the form

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Neutral 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.

      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.

       

        Acceptance criteria

              Unassigned Unassigned
              mdamborenea Monica Damborenea
              AuthorX
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:

                  Bug DoR
                  Task DoD