Skip to content

GetFriendlyUrl returns null when indexing Search and Navigation for commerce content #23

@gatisb

Description

@gatisb

add extensions method to be indexed, something like this:

ContentIndexer.Instance.Conventions.ForInstancesOf<Product>().ShouldIndex(_ => true);
clientConventions.ForInstancesOf<Product>().IncludeField(x => x.MyMethodThatCallsGetFriendlyUrl());

have site configuration as follows:
image

Commerce content(products and also categories)
product.ContentLink.GetFriendlyUrl() returns null
product.ContentLink.GetFriendlyUrl(product.Language?.TwoLetterISOLanguageName) returns null
for all products/all languages when indexed using Search and Navigation indexing job

In other scheduled jobs this product.ContentLink.GetFriendlyUrl(product.Language?.TwoLetterISOLanguageName) does return correct Url.

While CMS content:
articlePage.ContentLink.GetFriendlyUrl(articlePage.Language?.TwoLetterISOLanguageName) returns correct Url in ALL scheduled jobs

Also maybe it would be good to have:
product.GetFriendlyUrl() so that no language is needed to be passed in when you have content already

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions