Conversation
…tead of custom createLookupTableInfo()
…y resolved value
| ret.setLocked(true); | ||
| return ret; | ||
|
|
||
| return getTable(tableName, getLookupContainerFilter()); |
There was a problem hiding this comment.
Claude code is telling me that I need to protect against the case where st == null here for the "all samples" lookup, in which case the tableName is being set to "Materials" at line 248. So I plan to revert the previous code and instead conditionally return this new getTable(...) when st != null, unless you can see what we would never get into that st == null case here (which I don't think we can).
There was a problem hiding this comment.
note: the comment is a little odd now that I reverted things, but I put back in the part about using the createMaterialTable() for the "Materials" case.
| if (st != null) | ||
| return getTable(tableName, getLookupContainerFilter()); | ||
|
|
||
| ExpMaterialTable ret = ExperimentService.get().createMaterialTable(SamplesSchema.this, getLookupContainerFilter(), st); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
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