After a long journey, i manage to upgrade an Episerver site from version 6.0 to 9.0. Most parts of the site are working good now. There is one remaining problem that i need to resolve soon but can't figure out how to do it. My problem is there is a control named "Link List - Static" with Link Property control does not load the link. After ugrading, when i try to edit a Link Item in the list, a pop up appears, it says "The document that this link was linking to does no longer exist or has been removed".
But the funny thing is the link item is working perfectly on the view and the link is good as well. I decided to debug and when i decompile the dll Episerver.UI i realize there is a code block that check the link as below
With the link from version 6.0, at this point they are NOt permanent link so the code can't get the Guid and ofcourse the content link is not correct that makes the pageData return null and jump to the catch (ContentNotFoundException ex) block. I think i have to convert the current page links to permanent links correspondingly or something like that. Anyone know a way to fix this? Thanks in advance!
Hi guys,
After a long journey, i manage to upgrade an Episerver site from version 6.0 to 9.0. Most parts of the site are working good now. There is one remaining problem that i need to resolve soon but can't figure out how to do it. My problem is there is a control named "Link List - Static" with Link Property control does not load the link. After ugrading, when i try to edit a Link Item in the list, a pop up appears, it says "The document that this link was linking to does no longer exist or has been removed".
But the funny thing is the link item is working perfectly on the view and the link is good as well. I decided to debug and when i decompile the dll Episerver.UI i realize there is a code block that check the link as below
Global.UrlRewriteProvider.ConvertToInternal(url3);
Guid guid = PermanentLinkUtility.GetGuid(url3.ToString());
ContentReference contentLink = ContentReference.EmptyReference;
if (guid != Guid.Empty)
{
contentLink = PermanentLinkUtility.FindContentReference(guid);
this.IsInternalUrl = !ContentReference.IsNullOrEmpty(contentLink);
}
this.IsInternalDocument = !this.IsInternalUrl && url1.StartsWith("/") || url1.StartsWith("~/");
this.IsNetworkDocument = url1.ToLower().StartsWith("file://") || url1.StartsWith("\\") || url1.IndexOf(":") == 1;
this.IsExternalDocument = this.Request.QueryString["type"] != null && string.Compare(this.Request.QueryString["type"], "doc") == 0;
this.IsMailLink = url1.ToLower().StartsWith("mailto:");
this.IsUnresolvedInternalLink = url1.ToLower().StartsWith("~/link/") && contentLink == (ContentReference) PageReference.EmptyReference;
if (this.IsInternalUrl)
{
if (!string.IsNullOrEmpty(url3.QueryCollection["epslanguage"]))
this.Language = url3.QueryCollection["epslanguage"];
PageData pageData = (PageData) null;
try
{
pageData = this.ContentRepository.Get(contentLink);
}
catch (ContentNotFoundException ex)
{
this.PageNotFound = true;
}
catch (AccessDeniedException ex)
{
this.PageAccessDenied = true;
}
if (pageData != null)
this.linkinternalurl.PageLink = pageData.PageLink;
}
With the link from version 6.0, at this point they are NOt permanent link so the code can't get the Guid and ofcourse the content link is not correct that makes the pageData return null and jump to the catch (ContentNotFoundException ex) block. I think i have to convert the current page links to permanent links correspondingly or something like that. Anyone know a way to fix this? Thanks in advance!