Skip to content

Commit 0678ed4

Browse files
NeloopMartin Kruliš
authored andcommitted
Input variables which does not have output box, have to have proper directory set in DirectoriesResolver
1 parent cc01053 commit 0678ed4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

app/helpers/ExerciseConfig/Compilation/DirectoriesResolver.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,16 @@ private function processNode(Node $node, string $directoryName, array &$director
4646
}
4747
$directoriesNodes[$directoryName][] = $node;
4848

49+
foreach ($node->getBox()->getInputPorts() as $inputPort) {
50+
$variableValue = $inputPort->getVariableValue();
51+
if ($variableValue && $variableValue->isFile() &&
52+
$variableValue->getDirectory() === null) {
53+
// set directory only if it was not set by processing previous node
54+
// (this effectively means that the variable has no output box)
55+
$inputPort->getVariableValue()->setDirectory($directoryName);
56+
}
57+
}
58+
4959
// set directory on variable, this is used during creation of copy tasks
5060
foreach ($node->getBox()->getOutputPorts() as $outputPort) {
5161
$variableValue = $outputPort->getVariableValue();

0 commit comments

Comments
 (0)