Skip to content

GitHub Issue 951: Multi-line values converted to text choices lose multi-line editability#7540

Merged
XingY merged 14 commits intodevelopfrom
fb_mvtcBatch3
Apr 13, 2026
Merged

GitHub Issue 951: Multi-line values converted to text choices lose multi-line editability#7540
XingY merged 14 commits intodevelopfrom
fb_mvtcBatch3

Conversation

@XingY
Copy link
Copy Markdown
Contributor

@XingY XingY commented Apr 1, 2026

Rationale

GitHub Issue 951: Multi-line values converted to text choices lose multi-line editability

Related Pull Requests

Changes

  • Disallow converting from multiline field to TC or MVTC field types
  • api tests for check converting from multiline field to TC or MVTC field types

@XingY XingY changed the title GitHub Issue 928, 951, 970 & 987 GitHub Issue 928, 951, 966, 970 & 987 Apr 1, 2026
@XingY XingY requested a review from cnathe April 2, 2026 01:06
Comment thread experiment/package.json Outdated
},
"dependencies": {
"@labkey/components": "7.26.4"
"@labkey/components": "7.26.5-fb-mvtcBatch3.1"
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.

any reason not to also bump the @labkey/components version for the other package.json cases in platform? I think it is nice to keep all 4 of them in sync.

var dialect = domainTable.getSchema().getSqlDialect();
SQLFragment deletedArray = new SQLFragment("CAST(? AS TEXT[])").add(deletedValues.toArray(new String[0]));
SQLFragment columnFrag = new SQLFragment().appendIdentifier(column.getAlias());
SQLFragment columnFrag = new SQLFragment().appendIdentifier(column.getName());
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.

@XingY @labkey-matthewb I was hitting an exception when trying to update the list of values for a MVTC sample type field with a field named t$c. Please review, and decide if we need to add dedicated test coverage for this. Maybe it would be caught by fuzzing?

ERROR Table                    2026-04-06T13:29:34,250 ttps-jsse-nio-443-exec-3 : SQL Exception with SQLState: 42703
org.postgresql.util.PSQLException: ERROR: column "t_c" does not exist
  Hint: Perhaps you meant to reference the column "dollartesting.t$c".
  Position: 923
	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2875)
org.springframework.jdbc.BadSqlGrammarException: ExecutingSelector; bad SQL grammar []
	at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:134)
	at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:102)
	at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:111)
	at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:111)
	at org.labkey.api.data.ExceptionFramework$1.translate(ExceptionFramework.java:43)
	at org.labkey.api.data.SqlExecutingSelector$ExecutingResultSetFactory.handleSqlException(SqlExecutingSelector.java:570)
	at org.labkey.api.data.SqlExecutingSelector$ExecutingResultSetFactory.handleResultSet(SqlExecutingSelector.java:469)
	at org.labkey.api.data.SqlExecutingSelector.exists(SqlExecutingSelector.java:290)
	at org.labkey.api.data.SqlExecutingSelector.exists(SqlExecutingSelector.java:283)
	at org.labkey.api.exp.property.DomainUtil.updateDomainDescriptor(DomainUtil.java:994)
	at org.labkey.experiment.api.SampleTypeServiceImpl.updateSampleType(SampleTypeServiceImpl.java:1192)
	at org.labkey.api.exp.api.SampleTypeDomainKind.updateDomain(SampleTypeDomainKind.java:391)
	at org.labkey.api.exp.api.SampleTypeDomainKind.updateDomain(SampleTypeDomainKind.java:83)

Copy link
Copy Markdown
Contributor Author

@XingY XingY Apr 7, 2026

Choose a reason for hiding this comment

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

@labkey-jeckels Good catch. I've pushed another change to use DatabaseIdentifier, will defer to @labkey-matthewb for future review. I've also modified AssayImportRunAction.ispec.ts to use fuzz field name, and the test already covers modifying option values.

@XingY XingY changed the title GitHub Issue 928, 951, 966, 970 & 987 GitHub Issue 951: Multi-line values converted to text choices lose multi-line editability Apr 9, 2026
@labkey-jeckels
Copy link
Copy Markdown
Contributor

Verified that I'm now blocked from converting to text choice when a value contains newlines. Message is:

Text choice value for field 'multi' must not contain newline characters: 'two lines'

Consider a message that aligns with multi-line field type naming:

Text choice value for field 'multi' must not be multi-line: 'two lines'

Also note that the error is accurate, though a bit confusing for the user as the newlines are being stripped. There's a line break between the two and lines in this example.

@XingY XingY merged commit e2bca85 into develop Apr 13, 2026
12 checks passed
@XingY XingY deleted the fb_mvtcBatch3 branch April 13, 2026 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants