-
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
-
Funded by:
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;