GitHub Issue 1474: block reserved fields to be used as import alias - #7942
Conversation
labkey-susanh
left a comment
There was a problem hiding this comment.
Should also add a test for this.
|
It would be a bigger change, but should we be throwing an error during import when an alias overlaps with a reserved name? |
| results.put("maxObjectObjectId", new SqlSelector(schema, "SELECT MAX(ObjectId) FROM exp.Object").getObject(Long.class)); | ||
| results.put("maxMaterialRowId", new SqlSelector(schema, "SELECT MAX(RowId) FROM exp.Material").getObject(Long.class)); | ||
|
|
||
| results.put("domainFieldsWithContainerAlias", new SqlSelector(schema, "SELECT COUNT(*) FROM exp.propertydescriptor WHERE LOWER(importaliases) = 'container' OR importaliases ILIKE '%, container' OR importaliases ILIKE 'container, %' OR importaliases ILIKE '%, container, %'").getObject(Long.class)); |
There was a problem hiding this comment.
Are we confident enough that these will be separated by , ? DomainUtil is tolerant of a variety of separators, including, spaces ,semicolons, and commas with no spaces.
There was a problem hiding this comment.
Based on ColumnRenderPropertiesImpl.convertToString, ", " is the only delimiter when saving to DB. The parser is more lenient and accepts semicolon, space, tab, etc. It's an unlikely scenario that Container will be used in a multi alias setting that bypasses the default save. The risk of under reporting here is probably acceptable.
Rationale
Related Pull Requests
Changes