November Happy Hour will be moved to Thursday December 5th.

Dynamic Content breaks on import

Vote:
 

Hi folks,

I've come across an extremely frustrating problem when importing pages that include Dynamic Content (which implement a PropertyImageUrl).  The import checks that the path contained in the PropertyImageUrl is a valid path, and as such, the import works correctly if the page containing the Dynamic Content has been exported from the same site (because the image exists at the original location).  However, if I attempt to import the page to a different EpiServer site (i.e. from a staging to a live site), the import fails because - despite the fact that I've checked the option to export files that the page links to - the system can't find the image at the specified path.

The import error is as follows:

Import has been canceled
The following errors have occurred:
[Importing page 12736_25837] Exception: "/pages/28404/identity_gallery_1.jpg" is not a valid value for "Image (max width/height 600px)".[]
 
The worst bit is that the error halts the importation process.  It wouldn't be such a problem if the image simply failed to import, but what it means is that - in order to export/import pages across sites - we need to remove all the Dynamic Content (that implement PropertyImageUrl) before exporting.
 
Has anyone run into the problem?  Has anyone got any ideas about how to get around it?
 
Cheers,
 
Tim
#52848
Aug 17, 2011 4:40
Vote:
 

If anyone is interested, I simply added a Try/Catch statement to the Set method of the State property to return an empty PropertyImageUrl if a problem is encountered when parsing the image URL string to PropertyImageUrl.  Like so:

        Set(ByVal value As String)
            Dim values As String() = value.Split("|")
            If value.Length > 0 Then
                Try
                    strImageURL.ParseToSelf(ASCIIEncoding.ASCII.GetString(Convert.FromBase64String(values(0))))
                Catch ex As Exception
                    strImageURL = New PropertyImageUrl
                End Try
            End If
        End Set

This, at least, allows the page import process to continue, regardless of whether the image is found.  Still, it's a shame that the export process fails to include the image as part of the export (assuming you have the "Export files that the pages link to" checkbox checked).


#53616
Sep 16, 2011 4:27
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.