Uploaded image for project: 'OpenOLAT'
  1. OpenOLAT
  2. OO-3070

Archive course log: comma in titles confuses output

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 12.1.2
    • Fix Version/s: 12.1.3
    • Component/s: None
    • Labels:
      None

      Description

      If the title of a course or a course node contains a comma, the table column layout is not in a proper format. A solution is to add string delimiters. This is the patch which also escapes quotes inside strings:

      diff --git a/src/main/java/org/olat/core/util/StringHelper.java b/src/main/java/org/olat/core/util/StringHelper.java
      --- a/src/main/java/org/olat/core/util/StringHelper.java
      +++ b/src/main/java/org/olat/core/util/StringHelper.java
      @@ -573,11 +573,14 @@
               String csvStr = null;
               for (Iterator<String> iter = entries.iterator(); iter.hasNext();) {
                   String group = iter.next();
      +            group = group.replaceAll("\"", "\"\"");
      +            if (group.contains(","))
      +                group = "\""+group+"\"";    
                   if (isFirst) {
                       csvStr = group;
                       isFirst = false;
                   } else {
      -                csvStr += ", " + group;
      +                csvStr += "," + group;
                   }
               }
               return csvStr;
      

        Attachments

          Activity

            People

            Assignee:
            srosse Stéphane Rossé
            Reporter:
            stephan Stephan Clemenz
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 5 minutes
                1h 5m