Issue 53313: Fields with non alpha/numeric chars not shown in Custom Props#2520
Issue 53313: Fields with non alpha/numeric chars not shown in Custom Props#2520labkey-jeckels merged 6 commits intodevelopfrom
Conversation
|
@cnathe I thought about using fuzzing for the field names but that would complicate the SQL expression. Let me know if you think it's worth getting more complex here. |
Co-authored-by: Cory Nathe <cnathe@labkey.com>
… into fb_53313_sampleCustomProperties
| final List<FieldDefinition> fields = List.of( | ||
| stringCol1.getFieldDefinition(), | ||
| stringCol2.getFieldDefinition(), | ||
| calcCol.getFieldDefinition().setValueExpression("\"" + stringCol1.getName() + "\" || 'Concat'") |
There was a problem hiding this comment.
Won't this fail if the field name includes "? I'll try to find a test helper to properly escape it.
There was a problem hiding this comment.
I excluded the double quote char from the randomFieldName for StringColPlain for that reason. If we want to include that char, then we just need to escape the double quote in the expression. Something like this (untested)...maybe we have a test helper for that:
| calcCol.getFieldDefinition().setValueExpression("\"" + stringCol1.getName() + "\" || 'Concat'") | |
| calcCol.getFieldDefinition().setValueExpression("\"" + stringCol1.getName().replaceAll("\"", "\"\"") + "\" || 'Concat'") |
There was a problem hiding this comment.
Oh, I missed the exclusion. Thanks for pointing it out.
I found EscapeUtil.getSqlQuotedValue(). I'll switch to that and remove the exclusion
Rationale
We're intending to show all of the admin-defined sample fields on its LKS details page but aren't looking them up in the map correctly.
Related Pull Requests
Changes