Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions src/org/labkey/targetedms/TargetedMSDataHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import org.labkey.api.pipeline.PipeRoot;
import org.labkey.api.pipeline.PipelineJobException;
import org.labkey.api.pipeline.PipelineService;
import org.labkey.api.query.BatchValidationException;
import org.labkey.api.security.User;
import org.labkey.api.targetedms.RunRepresentativeDataState;
import org.labkey.api.targetedms.TargetedMSService;
Expand Down Expand Up @@ -285,6 +286,26 @@ public void runMoved(ExpData newData, Container container, Container targetConta
newData.save(user);
}

// Fix ExpRun's FilePathRoot if it is still set to the file root of the source folder
ExpRun experimentRun = ExperimentService.get().getExpRun(newRunLSID);
if (experimentRun == null)
{
throw new ExperimentException("Unable to find exprun for lsid " + newRunLSID + ". Cannot set the filePathRoot.");
}
Path newFileRootPath = targetRoot.getRootFileLike().toNioPathForRead();
if (!newFileRootPath.equals(experimentRun.getFilePathRootPath()))
{
experimentRun.setFilePathRootPath(newFileRootPath);
try
{
experimentRun.save(user);
}
catch (BatchValidationException e)
{
throw new ExperimentException(e);
}
}

// Update the run
TargetedMSManager.moveRun(run, targetContainer, newRunLSID, newData.getRowId(), user);

Expand Down