U4-7130 - IUrlSegmentProvider : method GetUrlSegment(IContentBase content, CultureInfo culture) never gets called

Created by Dave Woestenborghs 23 Sep 2015, 06:15:42 Updated by Stephan 23 Sep 2015, 07:52:33

I'm trying to build a 1 on 1 translated website using Vorto. One of the requirements is that we can set the url per language. I am trying to use a UrlSegmentProvider to create the URL per language.

I was expecting that this method on the Url Segment Provider would be called for each assigned culture of the item. This is not the case. Actually this method is never called.

It is used in the method GetUrlSegment(this IContentBase content, CultureInfo culture) in Umbraco.Core.Strings.ContentBaseExtensions. But that method isn't used in the core.

So what is the use of this method if it is never called ?

Dave

Comments

Stephan 23 Sep 2015, 06:29:13

To make it short: provision for future use when 1-to-1 urls are properly supported by Core - at the moment, as you have figured out, the method is not called - Core fully relies on the non-culture-specific method.

For one reason: the segments are cached, and then assembled into a full url, which is then cached. And we cache one segment and one url per content. That cache is not culture-aware. Using the culture-specific method is not a complex change to implement - caching culture-specific segments and urls is.

Currently work-in-progress as part of the "new cache" which is planned for v8.

Making sense?


Dave Woestenborghs 23 Sep 2015, 06:49:31

Yes makes sense. I think I can work around for now using a IUrlProvider and a ContentFinder (or VirtualNodeHanlder)

Dave


Priority: Normal

Type: Bug

State: Closed

Assignee: Stephan

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions: 7.0.1, 7.0.2, 7.0.3, 7.0.4, 7.1.1, 7.2.0, 7.1.2, 7.1.3, 7.1.4, 7.1.5, 7.1.6, 7.1.7, 7.1.8, 7.1.9, 7.2.1, 7.2.2, 7.2.3, 7.2.4, 7.2.5, 7.2.6, 7.2.7, 7.2.8

Due in version:

Sprint:

Story Points:

Cycle: