Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jakob Lithner 61 posts 264 karma points
    Aug 27, 2018 @ 07:06
    Jakob Lithner
    0

    Collation confusion - Database collation is not used?

    My host provider set the default collation on my SQL database to SQLLatin1GeneralCP1CIAS. This gives wrong sorting for Swedish texts so I asked them to switch. I tried sorting in a random local database where I had database collation Latin1GeneralCIAI. As it gave correct sorting I requested the host provider to apply that collation.

    As you probably guess it made no difference. I guess these collations are more or less identical. The reason I got correct sorting when trying locally was that the table column had swedish sorting!

    I felt a bit ashamed to bother the support team again, so I now tried to switch the collation of the table columns. No problem to change and sorting in Sql Server Management Studio was now correct!

    BUT, when opening the Umbraco page where I retrieved and sorted the data it turned out that the sorting was still wrong ...!

    How can that be? Does Umbraco data retrieval do some other trick to apply different sorting?

    I repeat:

    1. The database has wrong collation.
    2. The table columns cmsDocument.text and umbracoNode.text now has correct sorting.
    3. When sorting directly in SQL it gives correct sorting.
    4. When applying OrderBy in Umbraco on node Name field it is still wrong
  • Jakob Lithner 61 posts 264 karma points
    Aug 29, 2018 @ 12:58
    Jakob Lithner
    100

    This really surprised me, but it seems that Umbraco sorting is sometimes decided by the culture chosen in the backend!!

    I assumed the Language setting named "Edit Culture" would switch the displayed language in the backend and not affect the frontend at all.

    Can it be that collections taken from the internal cache are sorted according to the Language setting?

Please Sign in or register to post replies

Write your reply to:

Draft