Final touches to rel links data upgrader
This commit is contained in:
@@ -34,6 +34,8 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven
|
||||
{
|
||||
if (!string.IsNullOrEmpty(data.Text))
|
||||
{
|
||||
var cs = ApplicationContext.Current.Services.ContentService;
|
||||
|
||||
//fetch the current data (that's in xml format)
|
||||
var xml = new XmlDocument();
|
||||
xml.LoadXml(data.Text);
|
||||
@@ -59,6 +61,20 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven
|
||||
link.Add("edit", false);
|
||||
link.Add("isInternal", type.Equals("internal"));
|
||||
|
||||
try
|
||||
{
|
||||
if (type.Equals("internal"))
|
||||
{
|
||||
int nodeId;
|
||||
if (int.TryParse(lnk, out nodeId))
|
||||
link.Add("internalName", cs.GetById(nodeId).Name);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error<UpdateRelatedLinksData>("Exception was thrown when trying to update related links property data, fetching internal node id", ex);
|
||||
}
|
||||
|
||||
links.Add((ExpandoObject) link);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user