Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions api/src/org/labkey/api/audit/AbstractAuditTypeProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.labkey.api.data.DbSchema;
import org.labkey.api.data.DbSchemaType;
import org.labkey.api.data.DbScope;
import org.labkey.api.data.MultiChoice;
import org.labkey.api.data.MutableColumnInfo;
import org.labkey.api.data.Table;
import org.labkey.api.data.TableInfo;
Expand Down Expand Up @@ -377,6 +378,12 @@ else if (value instanceof Date date)
String formatted = DateUtil.toISO(date);
stringMap.put(entry.getKey(), formatted);
}
else if (value instanceof java.sql.Array arr)
{
// GitHub Issue 1073: Updating a List MVTC field shows array in audit for values with quotes
var arrayVal = MultiChoice.Converter.getInstance().convert(MultiChoice.Array.class, arr);
stringMap.put(entry.getKey(), PageFlowUtil.joinValuesToStringForExport(arrayVal));
}
else
stringMap.put(entry.getKey(), value == null ? null : value.toString());
}
Expand Down
4 changes: 2 additions & 2 deletions list/src/org/labkey/list/model/ListManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -1219,7 +1219,7 @@ String formatAuditItem(ListDefinitionImpl list, User user, Map<String, Object> p

if (null != ti)
{
Map<String, String> recordChangedMap = new CaseInsensitiveHashMap<>();
Map<String, Object> recordChangedMap = new CaseInsensitiveHashMap<>();
Set<String> reserved = list.getDomain().getDomainKind().getReservedPropertyNames(list.getDomain(), user);

// Match props to columns
Expand All @@ -1241,7 +1241,7 @@ String formatAuditItem(ListDefinitionImpl list, User user, Map<String, Object> p
continue;

ColumnInfo col = ti.getColumn(FieldKey.fromParts(baseKey));
String value = Objects.toString(entry.getValue(), "");
Object value = entry.getValue();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a functional change. Before, if there wasn't a value, we would possibly show a change to the empty string in the audit log. From UI testing, this seems to be doing the right things, though, and I believe it's because the empty string was being treated as effectively null.

String key = null;

if (null != col)
Expand Down
Loading