Showing posts with label sitecore upgrade. Show all posts
Showing posts with label sitecore upgrade. Show all posts

Monday, July 7, 2025

๐Ÿš€ Sitecore 10.4 SXA Upgrade: Language Embedding Issue & Temporary Workaround

Hi everyone! ๐Ÿ‘‹

We recently upgraded our Sitecore platform from version 10.1 to 10.4, along with the SXA module. While the overall upgrade process was largely seamless — thanks to Sitecore’s detailed documentation — we did run into a few unexpected challenges that I believe are worth highlighting. This post is especially for those planning a similar upgrade journey.

If you’re just starting out, I recommend reviewing my earlier blogs where I outline key upgrade steps and best practices. For now, let’s focus on one specific post-upgrade issue we encountered: language embedding in URLs not functioning as expected.

๐Ÿงฉ The Issue: Language Embedding Not Working Properly

Our SXA-based websites rely on language embedding to ensure that URLs include the language code, such as:

https://hostname/en-CA/medical

However, post-upgrade we observed two key problems:

  • The language prefix was not applied at the hostname root.
  • While language switching on the website technically worked, the URL did not reflect the language change, leading to user confusion.

Initially, we suspected a bug in our custom implementation. But after deep investigation and coordination with Sitecore Support, it was confirmed to be a product-level issue. (Reference: Case #CS0585903, awaiting official confirmation.)

The root cause was traced to the SwitchableLinkProvider, which wasn’t honoring the Language Embedding checkbox in the SXA settings. Sitecore acknowledged the issue and has scheduled a fix under reference SXA-8360.

๐Ÿ›  Temporary Fix: Custom Link Provider Implementation

While waiting for the official hotfix, we needed an immediate workaround due to our reliance on this feature across multiple sites.

Here’s the temporary solution we implemented:

  • We configured a custom link provider to replace the default SwitchableLinkProvider.
  • A simple patch config was added.
  • In the SXA Site Grouping settings, we explicitly set the Link Provider name to use our custom provider.

This resolved the language embedding issue across all URLs.

Patch Example:

<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
   <sitecore>
      <linkManager defaultProvider="switchableLinkProvider" >
         <providers>
            <add name="CustomLinkProvider" type="Sitecore.XA.Foundation.Multisite.LinkManagers.LocalizableLinkProvider, Sitecore.XA.Foundation.Multisite" lowercaseUrls="true" languageEmbedding="always" addAspxExtension="false" />
         </providers>
      </linkManager>
   </sitecore>
</configuration>

⚠️ Note: This is a temporary workaround. We’re still awaiting the official Sitecore patch and will share updates once it’s available.

๐Ÿ’ฌ Final Thoughts

Upgrading to newer Sitecore versions — especially when SXA is involved — can surface subtle yet impactful issues. The important takeaway:

  • Stay proactive,
  • Don’t hesitate to involve Sitecore Support, and
  • Be open to temporary creative workarounds when business continuity is on the line.

๐Ÿ’ก “There are many solutions to a problem. The challenge is identifying the right one at the right time.”

Happy coding! ๐Ÿ”ง
 Have you encountered similar issues during your upgrade? I’d love to hear your experiences and solutions in the comments.

I hope you enjoy this Sitecore blog. Stay tuned for more Sitecore related articles.

Till that happy Sitecoring :)

Please leave your comments or share this article if it’s useful for you.


Wednesday, June 11, 2025

Solving Search Result Issues After Upgrading to Sitecore 10.4

Hey everyone! ๐Ÿ‘‹

As you might have seen in some of our previous blogs, we’ve shared quite a bit about upgrading Sitecore versions. Well, we recently made the jump from Sitecore 10.1 to 10.4, and just like any major upgrade, we encountered a few bumps along the way. But don’t worry—we’re here to share one of the issues we ran into and how we managed to solve it. So, let’s dive in!

The Problem: Search Results Vanishing After the Upgrade

After upgrading Sitecore, everything seemed to go smoothly at first. But then, some of our websites (we have over 170 websites hosted in Sitecore) suddenly stopped showing search results. Some sites were working just fine, but others? Not so much. ๐Ÿค”

As you can imagine, this was pretty concerning. We started investigating the issue to figure out if it was related to the upgrade itself or some recent configuration changes. So, we dug into the logs and checked the configurations.

Digging Deeper: What We Found

After some digging, we discovered something interesting: our search page was using a custom index, and the results were relying on a field called sxacontext. But guess what? This field was missing in the custom indexes after the upgrade.

So, what’s going on here?

Well, it turns out that the fields were no longer present in the default index configuration. Instead, they were added to the individual SXA indexes like sxa_master_index and sxa_web_index. Since our search page depended on the sxacontext field within our custom site-specific indexes, the missing field was the culprit. ๐Ÿšจ

What Happened in Sitecore 10.3 and Beyond?

Here’s where things got a bit tricky: In SXA version 10.3, a few SXA computed fields were removed from the defaultSolrIndexConfiguration. This change wasn’t really a problem for the default SXA indexes, but for custom indexes like ours, it caused issues—especially when relying on fields like sxacontext.

The Fix: Restoring the Missing Fields

We figured out that the best way to resolve the issue was to re-add the missing fields back into the default Solr index configuration. After a bit of trial and error, we managed to update the configuration so that the custom index could properly use those fields again.

Here’s what our updated defaultSolrIndexConfiguration looks like now:

Updated Default Solr Index Configuration:

<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:role="http://www.sitecore.net/xmlconfig/role/" xmlns:search="http://www.sitecore.net/xmlconfig/search/">
  <sitecore search:require="solr">
    <contentSearch>
      <indexConfigurations>
        <defaultSolrIndexConfiguration type="Sitecore.ContentSearch.SolrProvider.SolrIndexConfiguration, Sitecore.ContentSearch.SolrProvider" >
          <documentOptions type="Sitecore.ContentSearch.SolrProvider.SolrDocumentBuilderOptions, Sitecore.ContentSearch.SolrProvider">
           
            <fields hint="raw:AddComputedIndexField">
               
                <field fieldName="site" returnType="stringCollection">Sitecore.XA.Foundation.Search.ComputedFields.Site, Sitecore.XA.Foundation.Search</field>
                <field fieldName="sxacontent" returnType="textCollection" type="Sitecore.XA.Foundation.Search.ComputedFields.AggregatedContent, Sitecore.XA.Foundation.Search">
                    <mediaIndexing ref="contentSearch/indexConfigurations/defaultSolrIndexConfiguration/mediaIndexing"/>
                </field>
                <field fieldName="haslayout" returnType="bool">Sitecore.XA.Foundation.Search.ComputedFields.HasLayout, Sitecore.XA.Foundation.Search</field>
                <field fieldName="searchable">Sitecore.XA.Foundation.Search.ComputedFields.Searchable, Sitecore.XA.Foundation.Search</field>
                <field fieldName="parentname" returnType="string">Sitecore.XA.Foundation.Search.ComputedFields.ParentName, Sitecore.XA.Foundation.Search</field>
                <field fieldName="level" returnType="int">Sitecore.XA.Foundation.Search.ComputedFields.Level, Sitecore.XA.Foundation.Search</field>
                <field fieldName="parenttemplate" returnType="string">Sitecore.XA.Foundation.Search.ComputedFields.ParentTemplate, Sitecore.XA.Foundation.Search</field>
                <field fieldName="inheritance" returnType="stringCollection" type="Sitecore.XA.Foundation.Search.ComputedFields.Inheritance, Sitecore.XA.Foundation.Search"/>
            </fields>
          </documentOptions>
        </defaultSolrIndexConfiguration>
      </indexConfigurations>
    </contentSearch>
  </sitecore>
</configuration>

The Result: Success!

After making these updates, search results started showing up again. ๐ŸŽ‰

So, if anyone else runs into this issue—where search results are missing, or if certain fields are not showing up because they were moved to specific indexes (like we saw with sxacontext)—this configuration change should get things back on track.

Conclusion: Key Takeaways

Upgrading Sitecore can sometimes be a bit tricky, but with the right troubleshooting steps, most issues are solvable! Here’s what we learned from this experience:

  1. Always double-check your index configurations after an upgrade, especially if you use custom indexes.

  2. Look out for missing fields—they could be causing issues in unexpected places.

  3. Update your configuration files to reintroduce any fields that might have been removed or moved to other indexes (like the SXA computed fields).

If you’re facing a similar issue after an upgrade, don’t panic. Follow the steps we took, and you should be able to get your search results back up and running.

Have you encountered any issues after upgrading to Sitecore 10.4? Drop a comment below or reach out if you need help! We’d love to hear about your experience. ๐Ÿ˜Š

I hope you enjoy this Sitecore blog. Stay tuned for more Sitecore related articles.

Till that happy Sitecoring :)

Please leave your comments or share this article if it’s useful for you.

Saturday, May 31, 2025

Sitecore 10.4 SXA Product Issue: Handling Japanese Characters in og:title Meta Tags

Hello All,

Upgrading a Sitecore environment can introduce powerful new features—along with the occasional unexpected quirk. After recently upgrading our Sitecore instance from 10.1 to 10.4, we encountered a curious issue with Japanese language support in Open Graph meta tags, specifically in the og:title and og:description fields.

In this post, I’ll share what we observed, how we investigated it, and what we learned from Sitecore Support. This is especially relevant for teams working with multilingual Sitecore implementations using SXA.


๐Ÿž The Issue: Encoded Characters in og:title for Japanese Content

Our website is primarily in Japanese. Post-upgrade, we found that Japanese text displayed properly on the page and in the <title> tag, but the same text looked strangely encoded in the page source when rendered inside og:title and og:description meta tags.

๐Ÿ” Example:

  • Expected (in CMS and browser preview):
    og:title: ใƒฌใƒ‘ใƒผใ‚ต

  • Actual (in page source):
    og:title: &#12524;&#12497;&#12540;&#12469;

This appeared to be a character encoding issue. The Japanese text was rendered as HTML entities (numeric character references), making it unreadable in the raw HTML.


๐Ÿ’ก What’s Actually Happening?

  • Webpage Display: Japanese characters show correctly in the visible UI and browser tab.

  • HTML Source View: Open Graph meta tags are HTML-encoded (e.g., &#12524; for “ใƒฌ”).

  • Impact Scope: Only affects Open Graph meta tags; other fields are rendered as expected.


๐Ÿ”Ž Investigation and Sitecore Support Findings

After escalating the issue to Sitecore Support and sharing reproducible examples:

  • Reproducibility: Sitecore confirmed the issue occurs when non-Latin characters are used in Open Graph fields—particularly on pages set to English language.

  • Bug ID: The issue has been registered as a known bug under SXA-8361.

  • Severity: It’s considered cosmetic—while the source code looks odd, browsers and social media platforms render the characters correctly.

  • Next Steps: Sitecore asked us to evaluate the urgency of a fix, since the bug doesn’t impact how content is displayed or shared.


๐Ÿค” Why Does This Happen?

Sitecore (like many CMS platforms) sometimes HTML-encodes non-ASCII characters in meta tag content to ensure compatibility with all HTML parsers. While this approach works functionally, it creates visually confusing source code for anyone inspecting it.

Fortunately, most platforms and scrapers (Facebook, Twitter, LinkedIn, etc.) automatically decode these entities when rendering shared content.


⚠️ Should You Be Concerned?

Short Answer: Not in most cases.

✅ You’re likely fine if:

  • Browsers display content as expected.

  • Social media previews correctly render Japanese characters.

  • Search engines can interpret both raw Unicode and HTML-encoded entities, so there’s no SEO penalty.

❗ You should test more thoroughly if:

  • Your systems rely on custom integrations, analytics scripts, or scrapers that directly parse meta tags from the source and expect raw Unicode.


๐Ÿ› ️ What Can You Do?

Here are a few steps to manage the situation:

  • Track the Bug: Follow the progress of SXA-8361 via Sitecore Support.

  • Test Social Sharing: Use tools like Facebook Sharing Debugger or Twitter Card Validator to preview how content appears when shared.

  • Communicate Internally: Inform developers, QA, and content teams that this is a known product issue with no immediate functional impact.

  • Customization (Advanced Option): If raw Unicode output is absolutely essential for business needs, consider customizing SXA’s meta tag rendering pipeline—but weigh the long-term maintenance cost.


๐Ÿงพ Conclusion

Upgrading to Sitecore 10.4 helped us unlock new capabilities, but also revealed some localized content quirks. Seeing Japanese characters encoded in Open Graph tags may feel concerning, but it’s largely a cosmetic issue.

Sitecore has acknowledged and logged the bug. For now, most users and platforms will experience your Japanese content correctly—even if the page source looks messy.

If you’ve encountered similar localization issues post-upgrade or have advice to share, please drop a comment below or connect with us. Sharing knowledge helps strengthen the whole Sitecore community.

Note: I will share the solution as soon as I receive an update from the Sitecore Product Team.

I hope you enjoy this Sitecore blog. Stay tuned for more Sitecore related articles.

Till that happy Sitecoring :)

Please leave your comments or share this article if it’s useful for you.