Skip to content

Commit

Permalink
Allow path resolve using the old path format, fix for issue #1077
Browse files Browse the repository at this point in the history
  • Loading branch information
otykier committed Feb 24, 2023
1 parent f5ae178 commit 8ec3674
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions TOMWrapper/TOMWrapper/TabularObjectHelper.cs
Expand Up @@ -269,6 +269,19 @@ public static TabularObject ResolveObject(Model model, string path)
}
}
}
else
{
// Fallback to the old path format: "Model.Dates.Date":
var table = model.Tables.FindByName(parts[1]);
if (parts.Length == 2 || table == null) return table;
if (table.Columns.FindByName(parts[2]) is Column c) return c;
if (table.Measures.FindByName(parts[2]) is Measure m) return m;
if (table.Hierarchies.FindByName(parts[2]) is Hierarchy h)
{
if (parts.Length == 3) return h;
return h.Levels.FindByName(parts[3]);
}
}
return null;

case "relationship": return model.Relationships.FindByName(parts[1]);
Expand Down

0 comments on commit 8ec3674

Please sign in to comment.