Try our conversational search powered by Generative AI!

Unable to publish page containing "URL to image" properties after upgrade to R2?

Vote:
 

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

#51156
May 25, 2011 18:02
Vote:
 

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() )
    {

    }

    

#51158
Edited, May 25, 2011 19:40
Vote:
 

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

#51160
May 25, 2011 19:52
Vote:
 

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.

 

 

#51186
Edited, May 26, 2011 17:42
Vote:
 

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

#51193
May 27, 2011 9:41
Vote:
 

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

#51289
May 31, 2011 22:16
Vote:
 

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".

 

#51530
Jun 13, 2011 16:39
Vote:
 

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:

  1. Backup your sites/database.
  2. Uninstall EPiServerFramework (6.2.267.1) from the Control Panel.
  3. Uninstall EPiServer CMS 6.1.379.0 from the Control Panel.
  4. Uninstall EPiServer Shared 1.1.409.0 from the Control Panel.

Step 2: Install EPiServer as follows:

  1. Install EPiServer Shared by running EPiServerShared.msi.
  2. Install EPiServer Framework by running EPiServerFramework.msi.
  3. Install EPiServer CMS by running EPiServerCMS.msi.

Step 3: Copy assemblies to bin folder as follows:

  1. Copy all assemblies from Program Files (x86)\EPiServer\CMS\6.1.379.0\bin to the site's bin folder.
  2. Copy all assemblies from Program Files (x86)\EPiServer\Framework\6.2.267.1\bin to the site's bin folder

 

These instructions was found here

 

#61915
Oct 05, 2012 14:39
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.