Skip to content

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

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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