Hi
Its bug 64398 I think
It happens when you have made your own PropertyUrl type of propertery, since the constructur for the base () dont add the PermanentLinkMapper
You need to make the property look like this:
[PageDefinitionTypePlugIn]
public class PropertyIteraMediaSelector : PropertyDocumentUrl
{
public PropertyIteraMediaSelector():base(new PermanentLinkMapper() )
{
}
Thank you Anders,
Reading that bug-description it sounds like the same problem, it's just that I haven't created a custom property but instead I'm using the normal EPiServer "URL to image" property and it fails. I've managed to reproduce it by doing the following:
- Install an EPiserver 6 R1 site with Public Templates
- Change provider for Global and PageFiles to VirtualPathNativeProvider
- Create a simple page type with a "URL to image" property and try to create a page of that page type and you should see the error message
Maybe the same thing happens on a R2 site that hasn't been upgraded from R1 to but I haven't had the time to test that.
I'll contact EPiServer support to see if they have a hotfix for this problem or what we can do to get around the problem.
/Martin
I've had the same problem some time ago. I've narrowed it down to using Native or other custom Virtual path provider. Seems it comes from the new base class for url properties called PropertyFileUrl, from which PropertyImageUrl and PropertyDocumentUrl inherit. It has one method called ValidateUri which throws an exception when the VirtualPathProvider you use doesn't implement IFileResolver interface. For example - VirtualPathNativeProvider. Here is what is happening:
- The user saves & publishes the page.
- A call to Set accessor for the PropertyUrl.String property is made. Inside it, a call to PropertyFileUrl.ValidateUri method is made
- ValidateUri throws an exception which says that the url is not absolute on the following line:
GenericHostingEnvironment.VirtualPathProvider.FileExists(uri.LocalPath))
- This exception however is masked behind the text "[imagepath] is not a valid value for [imagepropertyname]". This text is shown as error in the Edit interface.
- If the selected VirtualPathProvider implements IFileResolver, call to ValidateUri will not be made if the file is resolved.
One of the options here is to create a custom property which inherits from PropertyImageUrl or PropertyDocumentUrl and override the ValidateUriMethod:
protected override void ValidateUri(Uri uri)
{
// do nothing
}
The other option is to override VirtualPathNativeProvider and implement the IFileResolver interface.
And one last thing - if you choose an absolute image url (for example from an external website: http://www.asdfasdf.com/blabla.jpg) it will work as expected.
Hi!
Seems to be like a bug so I've added the following bug to our bug tracker so that we can investigate it:
Bug #65552: PropertyFileUrl does not allow a file with a relative url to be saved for some vpp:s since valdation if the file exists fails.
/Linus
I now have received a hotfix for this problem so if anyone else is experiencing this problem I recommend that you contact EPiServer and ask for the hotfix.
Thanks for your replies!
/Martin
The bug "65552: PropertyFileUrl does not allow a file with a relative url to be saved for some vpp:s since valdation if the file exists fails" is closed because of a duplicated bug report. The bug that remain is "#64398: VirtualPathNativeProvider does not work for url property".
I just ran into this problem. To correct it do the following and run an iisreset when finished:
Step 1: Unistall the existing EPiServer installation as follows:
Step 2: Install EPiServer as follows:
Step 3: Copy assemblies to bin folder as follows:
These instructions was found here
Hello,
I've come across a problem in two different sites that I've upgraded to EPiServer CMS 6 R2 just recently. All of a sudden when I try to publish a page that contains properties of type "URL to image" I get the following error message:
"/Global/xxx/image.png" is not a valid value for "Image"
Has anyone else seen this problem and managed to get around it?
Best regards
Martin