Henrik Fransas
May 29, 2015
  5719
(3 votes)

A breaking change in EPiServer 8 that are not on the list

EPiServer has defined all the breaking changes for EPiServer 8 on this page:

http://world.episerver.com/documentation/Items/Upgrading/EPiServer-CMS/8/Breaking-changes/

There are one change that effected me and that was not on the list and it is for the function GetVirtualPath of UrlResolver.

In EPiServer 7.5 GetVirtualPath returns a string directly but in EPiServer 8 it returns System.Web.Routing.VirtualPathData

Actually GetVirualPath were marked as obsolete in 7.5 so you could think that it would be removed in EPiServer 8 but it is not and another big differens is that if you have a contentreference that has the url "section/subsection/pagename" GetVirtualPath([ContentRef]).VirtualPath will return "section/subsection/pagename". In 7.5 GetVirtualPath for the same content returned "/section/subsection/pagename".

The way to solve this is to do as EPiServer told as in 7.5 and that is to change from GetVirtualPath() to GetUrl() and all will work (and it returns a "/" url for the content)

Just thought I should share this with you, since it caused me some headache and took some time to find (the thing with "section" instead of "/section" url)

May 29, 2015

Comments

Please login to comment.
Latest blogs
Creating an Optimizely CMS Addon - Adding an Editor Interface Gadget

In   Part One   of this series, I covered getting started with creating your own AddOn for Optimizely CMS 12. This covered what I consider to be an...

Mark Stott | Aug 30, 2024

Configure your own Search & Navigation timeouts

The main blog Configure your own Search & Navigation timeouts was posted for years but you need copy the code to your application. We now bring tho...

Manh Nguyen | Aug 30, 2024

Joining the Optimizely MVP Program

Andy Blyth has been honoured as an Optimizely MVP, recognising his contributions to the Optimizely community. Learn how this achievement will enhan...

Andy Blyth | Aug 29, 2024 | Syndicated blog

Welcome 2024 Summer OMVPs

Hello, Optimizely community! We are thrilled to announce and welcome the newest members to the Optimizely Most Valuable Professionals (OMVP) progra...

Patrick Lam | Aug 29, 2024