Fetch data from page in EPiServer CMS + URL to image + multi language pages are not working?

Vote:
 

We are having a problem with images (URL to image property) not working when we use the feature “Fetch data from page in EPiServer CMS” in combination with multi language pages.

What we do is create a page witch has page property “URL to image”. This property has unselected “Unique value per language”. Then we create another page that gets its data from the first page using the Link type: “Fetch data from page” under the tab “Shortcut/External Link” So far so god – the image(s) will show up on the new page. Then we create a new language version of the latter page and the image(s) disappear (Other fields/properties will show up nicely).

Are we doing something wrong or is this a bug?

Step by step to reproduce our problem:

  1. Create one page with at least one “URL to image” property (with unchecked “Unique value per language”). 
  2. Create another page (of the same page type) that will get data from the first page using “Fetch data from page in EPiServer CMS. Check that the image is fetched.
  3. Create a language version of the page from step 2. In our case the image disappears…

And an alternative way to get the same problem:

  1. Create one page with at least one “URL to image” property
  2. Create a language version of this page (lang 2). The image will show up nicely.
  3. Create a new page (of the same page type) using lang 2 that will fetch data from the first page using “Fetch data from page in EPiServer CMS”. In our case the image disappears.

 We are using EPiServer CMS 5.2

Any help/input are appreciated

#36229
Jan 20, 2010 9:48
Vote:
 

I have experienced the same thing. The problem is the getter on the Property method.

There is a solution:)

You can add you own logic on the getter, based on the default getter.

public class SyncPagesOnPublish : PlugInAttribute

{
    public static void Start()
    {
        PropertyDataCollection.GetHandler = EPiFixes.FetchDataFrom.OwnPropertyHandler;//override Property["xyz"]
    }
}

public class FetchDataFrom
{
    public static PropertyData OwnPropertyHandler(string name, PropertyDataCollection properties)
    {
        PropertyData prop = PropertyGetHandler.DefaultPropertyHandler(name, properties);

        if (prop != null && prop.IsNull && !prop.IsDynamicProperty)
        {
            //Lagt til så man ikke får engelsk ingress på franske sider
            if (!prop.IsLanguageSpecific)
            {
                PropertyData data = properties.Get("PageShortcutType");
                if (((data == null) || (data.Value == null)) ||
                    (((PageShortcutType)data.Value) != PageShortcutType.FetchData))
                    return prop;
                data = properties.Get("PageShortcutLink");

                if (data == null)
                    return prop;

                PageReference pageLink = (PageReference)data.Value;
                if (!PageReference.IsValue(pageLink))
                    return prop;

                if (properties.Get("PageLink") != null && (properties.Get("PageLink") is PropertyPageReference))
                {
                    if (pageLink.CompareToIgnoreWorkID((properties.Get("PageLink") as PropertyPageReference).PageLink))
                        return prop;
                }

                PageData page = DataFactory.Instance.GetPage(pageLink, LanguageSelector.MasterLanguage());

                if (page != null)
                {
                    data = page.Property.Get(name);
                    if (data != null)
                        return data;
                }

            }

        }

        return prop;

    }   

#36234
Edited, Jan 20, 2010 13:03
Vote:
 

Tusen Tack/Thanks a lot!

Jag testar detta :-)

 

#36241
Jan 21, 2010 8:57
Vote:
 

This problem has been reported as a bug in R2SP2. It's fixed in CMS6 RC1.

Bug: #30205 non language specific properties and shortcut/external link

You can check the bug report on our public bug list http://world.episerver.com/Support/Bug-List/

/Stefan

#30205 non language specific properties and shortcut/external link

#36254
Jan 21, 2010 16:23
Vote:
 

Thanks - good to know that it is fixed :-)

\\ Per

#36257
Jan 21, 2010 16:48
* 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.