From 0b539388af31d5735176cb32abf360b548376ba6 Mon Sep 17 00:00:00 2001 From: Josh Eckels Date: Mon, 25 Mar 2024 12:53:44 -0700 Subject: [PATCH] Issue 49964: Experiment database: parent id is not populating (#138) --- .../org/labkey/oconnorexperiments/query/ExperimentsTable.java | 2 +- .../test/src/org/labkey/test/tests/OConnorExperimentTest.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/OConnorExperiments/src/org/labkey/oconnorexperiments/query/ExperimentsTable.java b/OConnorExperiments/src/org/labkey/oconnorexperiments/query/ExperimentsTable.java index 8b9a609d..9c16c91a 100644 --- a/OConnorExperiments/src/org/labkey/oconnorexperiments/query/ExperimentsTable.java +++ b/OConnorExperiments/src/org/labkey/oconnorexperiments/query/ExperimentsTable.java @@ -197,7 +197,7 @@ public void addColumns() //UserSchema targetSchema = getUserSchema().getContainer().isWorkbook() ? new OConnorExperimentsUserSchema(getUserSchema().getUser(), getUserSchema().getContainer().getParent()) : getUserSchema(); MultiValuedForeignKey parentExperimentsFk = new MultiValuedForeignKey( QueryForeignKey - .from(getUserSchema(), getContainerFilter()) + .from(getUserSchema(), getContainer().isWorkbook() ? ContainerFilter.Type.CurrentAndFirstChildren.create(getContainer().getParent(), getUserSchema().getUser()) : getContainerFilter()) .schema(OConnorExperimentsUserSchema.NAME, getContainer().isWorkbook() ? getContainer().getParent() : getContainer()) .to(OConnorExperimentsUserSchema.Table.ParentExperiments.name(), "Container", null), "ParentExperiment"); diff --git a/OConnorExperiments/test/src/org/labkey/test/tests/OConnorExperimentTest.java b/OConnorExperiments/test/src/org/labkey/test/tests/OConnorExperimentTest.java index 6dc2a268..f4f2b472 100644 --- a/OConnorExperiments/test/src/org/labkey/test/tests/OConnorExperimentTest.java +++ b/OConnorExperiments/test/src/org/labkey/test/tests/OConnorExperimentTest.java @@ -114,6 +114,10 @@ public void testSteps() updateViaExperimentWebpart(0, null, "type3", "1,2"); verifyExperimentWebpart(0, "updated description 3", "type3", 1, 2); + // Make sure the values round-trip if they're not explicitly set + updateViaExperimentWebpart(0, null, null, null); + verifyExperimentWebpart(0, "updated description 3", "type3", 1, 2); + testBulkUpdate(); // delete via the webpart