Loading...

All project content is available for reading, but you need to be a member of the project for Subversion checkout of source code, or to create/modify any information.
Login if you are a member. Apply here to request membership (open to all).

Ticket #235 (new defect)

Opened 7 years ago

Last modified 7 years ago

File does not exists when editing document

Reported by: stefan@… Owned by: anders.hattestad@…
Priority: blocker Component: IteraMultiProperty
Keywords: Cc:

Description

When creating PropertyLinkCollection inside Itera multiproperty and selecting a document you can not edit the file after you have save the page.

If you have selected a document and trying to edit the file you cannot add &epslanguage=en. the file will not be found

/epiui/CMS/editor/dialogs/HyperlinkProperties.aspx?url=%2FDocuments%2Fteaser.png%3Fepslanguage%3Den

'/Documents/teaser.png?epslanguage=en' is not a valid virtual path.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: '/Documents/teaser.png?epslanguage=en' is not a valid virtual path.

Source Error:

Line 13: private bool IsAppResourcePath(string virtualPath)
Line 14: {
Line 15: String checkPath = VirtualPathUtility.ToAppRelative(virtualPath);
Line 16:
Line 17: bool bCheckPath = checkPath.StartsWith("~/ProprertyResourceProvider/",

Source File: S:\Jobb\VS\BestPractice\www\IteraMulti\PropertyResourceProvider\AssemblyResourceProvider.cs Line: 15

Change History

comment:1 Changed 7 years ago by stefan@…

fixed to problem myself by adding

if (prop is PropertyMulitBase)

{

prop.Value = useTxt;

}
otb: fix
else if (prop is PropertyLinkCollection)
{

string s = new Regex("&(?!(#|amp;))").Replace(useTxt, "&");
s = s.Replace("&#", "&#");
prop.ParseToSelf(s);

foreach (LinkItem linkItem in ((PropertyLinkCollection)prop).Links)
{

var urlBuilder = new UrlBuilder(linkItem.Href);
if (!string.IsNullOrEmpty(urlBuilder.Path) &&

HostingEnvironment.VirtualPathProvider.FileExists(urlBuilder.Path) &&
HostingEnvironment.VirtualPathProvider.GetFile(urlBuilder.Path) is UnifiedFile)

{

If the link is a unified file we remove the query params
urlBuilder.QueryCollection.Clear();
linkItem.Href = urlBuilder.ToString();

}

}

}
else if (prop is PropertyString && useTxt.Length > 255)
{

prop.ParseToSelf(useTxt.Substring(0, 255));

}
else
{

prop.ParseToSelf(useTxt);

}

instead of just

if (prop is PropertyMulitBase)

prop.Value = useTxt;

else

prop.ParseToSelf(useTxt);

on PropertyMultiBase.cs:361

Note: See HelpUser/Tickets for help on using tickets.