Skip to content

GitHub Issue #688: Sample's Created By and Modified By fields do not resolve correctly when added to assay results grid if sample lookup is set to a specific sample type #7564

Merged
cnathe merged 6 commits intodevelopfrom
fb_sampleLookup688
Apr 10, 2026

Conversation

@cnathe
Copy link
Copy Markdown
Contributor

@cnathe cnathe commented Apr 8, 2026

Rationale

#688 Sample's Created By and Modified By fields do not resolve correctly when added to assay results grid if sample lookup is set to a specific sample type

This PR fixes GitHub issue #688 where CreatedBy and ModifiedBy fields fail to resolve when navigating through a sample lookup field (in an assay results grid) that targets a specific sample type. The fix replaces a
custom createLookupTableInfo() implementation — which manually called createMaterialTable() + populate() + overlayMetadata() — with a simpler delegation to getTable(tableName, cf), which goes through the schema's full
table construction pipeline and correctly sets up all FK columns including CreatedBy/ModifiedBy.

Changes

  • use schema getTable() for materialIdForeignKey instead of custom createLookupTableInfo()
  • add test case to AssayTest

@cnathe cnathe self-assigned this Apr 8, 2026
if (st != null)
return getTable(tableName, getLookupContainerFilter());

ExpMaterialTable ret = ExperimentService.get().createMaterialTable(SamplesSchema.this, getLookupContainerFilter(), st);
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.

I didn't explore why the lookups were set up correctly for the all samples case, but I assume with your edits that this still works?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Correct. with my edit, the All Samples lookup still works as expected. I believe it is because in ExpSchema.getMaterialIdForeignKey() the all samples case uses getTable() for the ExpSchema instead of calling the code here in SamplesSchema.materialIdForeignKey

@cnathe cnathe merged commit 9a63dde into develop Apr 10, 2026
11 of 13 checks passed
@cnathe cnathe deleted the fb_sampleLookup688 branch April 10, 2026 17:59
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.

2 participants