Skip to content

Commit b5df9c3

Browse files
committed
Fix dataclass attachment on update
1 parent c0b4c59 commit b5df9c3

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

experiment/src/org/labkey/experiment/api/ExpDataClassDataTableImpl.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@
134134

135135
import java.io.IOException;
136136
import java.io.UncheckedIOException;
137+
import java.nio.file.Path;
137138
import java.sql.SQLException;
138139
import java.util.ArrayList;
139140
import java.util.Arrays;
@@ -1429,6 +1430,17 @@ protected Map<String, Object> updateRow(User user, Container container, Map<Stri
14291430

14301431
}
14311432

1433+
// DataClassDataUpdateService needs to skip Attachment column convert before _update
1434+
// TODO: move override when implementing consolidating dataclass update methods
1435+
@Override
1436+
protected Object convertColumnValue(ColumnInfo col, Object value, User user, Container c, @Nullable Path fileLinkDirPath) throws ValidationException
1437+
{
1438+
if (PropertyType.ATTACHMENT == col.getPropertyType())
1439+
return value;
1440+
1441+
return super.convertColumnValue(col, value, user, c, fileLinkDirPath);
1442+
}
1443+
14321444
@Override
14331445
protected Map<String, Object> _update(User user, Container c, Map<String, Object> row, Map<String, Object> oldRow, Object[] keys) throws SQLException, ValidationException
14341446
{

0 commit comments

Comments
 (0)