1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / 4.1 upgrade - Taxon querying problem

4.1 upgrade - Taxon querying problem

8 posts, 0 answered
  1. michiz
    michiz avatar
    3 posts
    Registered:
    02 Sep 2010
    22 Apr 2011
    Link to this post
    Hello, I've got following problem. In Sitefinity 4.0 I used this code to select single taxon.

    var taxonomyManager = TaxonomyManager.GetManager();
    var taxon = taxonomyManager
        .GetTaxa<FlatTaxon>()
        .Where(tx => tx.Taxonomy.Name == taxonomyName)
        .Where(tx => tx.UrlName == taxonUrlName)
        .SingleOrDefault();

    When specified existing taxonomy name and taxon url name this code returned single taxon. Unfortunetely after upgrade to 4.1 it always returns null. I made some research and figured out that folowing code does work.

    var taxonomyManager = TaxonomyManager.GetManager();
    var taxonsList = taxonomyManager
        .GetTaxa<FlatTaxon>()
        .Where(tx => tx.Taxonomy.Name == taxonomyName)
        .ToList();
     
    foreach (var t in taxonsList)
    {
        if (t.UrlName == taxonUrlName)
            // do something
    }

    Please explain if there is something wrong with my code or is it problem caused by Sitefinity upgrade.
  2. jocelyn payneau
    jocelyn payneau avatar
    51 posts
    Registered:
    07 Dec 2009
    22 Apr 2011
    Link to this post
    Hope, I will have not this issue because i use a lot of this type of queries for a website.

    Upgrade to 4.1 is already complicated with many bugs, i don't need this one.

    Jocelyn
  3. Vlad
    Vlad avatar
    498 posts
    Registered:
    19 Jun 2017
    28 Apr 2011
    Link to this post
    Hello michiz,

    This is very strange. Is it possible that you have been mistaken somehow? We tested with exactly the same code as you and it works fine. Can you try again? If it is still reproducible, can you send us the project so we could investigate it locally?

    Regards,
    Vlad
    the Telerik team

  4. michiz
    michiz avatar
    3 posts
    Registered:
    02 Sep 2010
    28 Apr 2011
    Link to this post
    Unfortunately I still use workaround solution. There is one thing, which I noticed. When selecting taxons filtered by Name I get correct results.

    taxonomyManager
     .GetTaxa<FlatTaxon>()
     .Where(tx => tx.Name == "something")
     .ToList();

    On the other hand when I filter taxons by Title or UrlName, NewsManager returns empty result. The Name attribute type is string. The Title and UrlName attributes type is Telerik.Sitefinity.Model.Lstring. Could it be the reason of this problem?
  5. Vlad
    Vlad avatar
    498 posts
    Registered:
    19 Jun 2017
    02 May 2011
    Link to this post
    Hi michiz,

    We managed to reproduce the problem - it occurs in multilingual mode, however seems it is not a common LINQ issue in multilingual, because it works fine for some other queries which have Lstring properties. We will investigate the problem further and will let you know about the result.

    All the best,
    Vlad
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. michiz
    michiz avatar
    3 posts
    Registered:
    02 Sep 2010
    02 May 2011
    Link to this post
    Thank you for response. I look forward for problem resolution.

    Regards
    michiz
  7. Vlad
    Vlad avatar
    498 posts
    Registered:
    19 Jun 2017
    03 May 2011
    Link to this post
    Hi michiz,

    Here is some update.

    In the meantime, you can use the following alternative and better workaround:

    ar taxonomyManager = TaxonomyManager.GetManager();
    var taxon = taxonomyManager
        .GetTaxa<FlatTaxon>()
        .Where(tx => tx.Taxonomy.Name == taxonomyName)
        .Where(tx => tx.UrlName[""] == taxonUrlName)
        .SingleOrDefault();

    Specifying tx.UrlName[""] in the expression means that your query will by filtered by invariant value of the UrlName property.


    Kind regards,
    Vlad
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  8. Vlad
    Vlad avatar
    498 posts
    Registered:
    19 Jun 2017
    16 May 2011
    Link to this post
    Hello michiz,

    This issue is addressed in the latest release (Sitefinity 4.1 SP1).

    Best wishes,
    Vlad
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
8 posts, 0 answered