Uploaded image for project: 'XNAT'
  1. XNAT
  2. XNAT-5876

Apostrophes in project titles and metadata fields are rendering poorly

    Details

    • Sprint:
      1.7.5.2 Point release
    • Rank:
      0|ii1nlv:
    • Sprint:
      1.7.5.2 Point release

      Description

      It seems that project title (name) and label (secondary id) are being escaped on the back-end when saved. At least apostrophes are being converted to their HTML entity strings, when when escaped on the front-end when rendering double-escapes the string resulting in very ugly text. Actually, I'm not sure what's happening because these fields are escaped on the project report page as well as in the JSON returned from /data/projects/projectId, but not escaped in the input fields on the edit page.

        Issue Links

          Activity

          Hide
          markflorida@wustl.edu Mark Florida added a comment - - edited

          This seems to happen only with REST calls - and with all fields, including description. However, if the value is rendered through Velocity, as on the edit page ($!item.getStringProperty("xnat:projectData/name")), the apostrophes are not escaped and rendered properly (as apostrophes).

          Any ideas - Rick Herrick Mike McKay ? I noticed some string library changed from 'commons-lang3' to 'commons-text' a while back - would that do it?

          Show
          markflorida@wustl.edu Mark Florida added a comment - - edited This seems to happen only with REST calls - and with all fields, including description. However, if the value is rendered through Velocity, as on the edit page ( $!item.getStringProperty("xnat:projectData/name") ), the apostrophes are not escaped and rendered properly (as apostrophes). Any ideas - Rick Herrick Mike McKay ? I noticed some string library changed from 'commons-lang3' to 'commons-text' a while back - would that do it?
          Hide
          mfmckay@wustl.edu Mike McKay added a comment - - edited

          I am in the middle of fixing this. I just wanted to note here that parts of the previous comment are incorrect. For example, it is not only in REST calls, and $!item.getStringProperty("xnat:projectData/name") is rendering incorrectly (because it's wrapped in an escapeAll) on the project report page (as shown in the screenshot).

          Show
          mfmckay@wustl.edu Mike McKay added a comment - - edited I am in the middle of fixing this. I just wanted to note here that parts of the previous comment are incorrect. For example, it is not only in REST calls, and $!item.getStringProperty("xnat:projectData/name") is rendering incorrectly (because it's wrapped in an escapeAll) on the project report page (as shown in the screenshot).
          Hide
          mfmckay@wustl.edu Mike McKay added a comment -

          The project XML and JSON are unchanged in 1.7.4 and 1.7.5. Mark thinks it should be a simple frontend fix to get it displaying like it did in 1.7.4.

          Show
          mfmckay@wustl.edu Mike McKay added a comment - The project XML and JSON are unchanged in 1.7.4 and 1.7.5. Mark thinks it should be a simple frontend fix to get it displaying like it did in 1.7.4.
          Hide
          markflorida@wustl.edu Mark Florida added a comment -

          Resolved for project-related pages. Other pages will likely need to be addressed as well.

          Show
          markflorida@wustl.edu Mark Florida added a comment - Resolved for project-related pages. Other pages will likely need to be addressed as well.

            People

            • Assignee:
              moore.c@wustl.edu Charlie Moore
              Reporter:
              markflorida@wustl.edu Mark Florida
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Agile