Skip to content

Commit 5c8b032

Browse files
DYN-9707: Fix ForceBlockRun not applied when opening legacy XML workspaces (#17167)
Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
1 parent d3e37e3 commit 5c8b032

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/DynamoCore/Models/DynamoModel.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2256,7 +2256,7 @@ internal void OpenFileFromPathCore(string filePath, bool forceManualExecutionMod
22562256
// When Json opening failed, either this file is corrupted or file might be XML
22572257
if (ex is JsonReaderException && DynamoUtilities.PathHelper.isValidXML(filePathToOpen, out xmlDoc, out ex))
22582258
{
2259-
openedSuccessfully = OpenXmlFileFromPath(xmlDoc, filePathToOpen, forceManualExecutionMode);
2259+
openedSuccessfully = OpenXmlFileFromPath(xmlDoc, filePathToOpen, forceManualExecutionMode, forceBlockRun: forceBlockRun);
22602260
return;
22612261
}
22622262
else
@@ -2465,8 +2465,9 @@ private void InsertJsonFileFromPath(string fileContents, string filePath, bool f
24652465
/// <param name="forceManualExecutionMode">Set this to true to discard
24662466
/// execution mode specified in the file and set manual mode</param>
24672467
/// <param name="isTemplate">When true, marks the opened workspace as a template (for example when opened via <see cref="OpenTemplateFromPath"/>).</param>
2468+
/// <param name="forceBlockRun">Set this to true to block the graph from running after opening.</param>
24682469
/// <returns>True if workspace was opened successfully</returns>
2469-
private bool OpenXmlFileFromPath(XmlDocument xmlDoc, string filePath, bool forceManualExecutionMode, bool isTemplate = false)
2470+
private bool OpenXmlFileFromPath(XmlDocument xmlDoc, string filePath, bool forceManualExecutionMode, bool isTemplate = false, bool forceBlockRun = false)
24702471
{
24712472
try
24722473
{
@@ -2491,6 +2492,8 @@ private bool OpenXmlFileFromPath(XmlDocument xmlDoc, string filePath, bool force
24912492
if (OpenXmlFile(workspaceInfo, xmlDoc, out ws))
24922493
{
24932494
ws.IsTemplate = isTemplate;
2495+
if (ws is HomeWorkspaceModel homeWs && homeWs.RunSettings != null)
2496+
homeWs.RunSettings.ForceBlockRun = forceBlockRun;
24942497
OpenWorkspace(ws);
24952498

24962499
// Set up workspace cameras here

0 commit comments

Comments
 (0)