Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-7145

Livetable does not support column names with special characters and/or Unicode characters

    XMLWordPrintable

Details

    • Trivial

    Description

      If we specify in the #livetable macro some column names which contain special characters (such as '.' for example) or Unicode characters, the livetable will not load the rows (although the JSON is loaded) because of a JS error. The inline JS script generated in macros.vm (#livetablecallback macro) creates for each table row some objects named 'row', which contain the respective JSON data. That data is accessed via the "dot" notation (row.<propname>) and this causes the JS to crash if the property name is not a valid JS object property name. We should instead use the "array" notation (row["<propname>"]) to make sure we don't have such conflicts, as no one can guarantee that the received JSON has "safe" column names.

      I attached the fixed version of macros.vm

      Attachments

        1. macros.vm
          88 kB
          Stefan Leon Orzu

        Activity

          People

            sdumitriu Sergiu Dumitriu
            stefan.orzu Stefan Leon Orzu
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: