Wednesday, 10 March 2021

Sorry, there was an error : unauthorized_client Sitecore

Issue

Sometimes, after fresh instance setup maybe getting error on the login screen


sitecore-login-issue


Fix

1. go to C:\inetpub\wwwroot\<identityServer Instance Name>\Config\production\Sitecore.IdentityServer.Host.xml

2. update AllowedCorsOriginsGroupN values from http to https

3. AppPool recycle



Now check, hope this will work.

Tuesday, 9 March 2021

Sitecore Forms are not displaying Issue

Problem

While working with Sitecore forms  9.x version, We usually face issue that sometime Forms not display.
To resolve this issue we generally do index rebuild. Even after this form still not displaying.


Root cause

        Generally this issue occurs because of indexAllFields set as False. 


Fix

Please click here to download patch config and add at your path ~/App_Config/Include/zzz


Note: This fix will work for any of azure/solr/lucene search providers.

Hope this works.

Monday, 8 March 2021

Sitecore dictionary item not getting phrase value intermittent issue

While working with Sitecore dictionary items, there are scenarios where not getting phrase value for dictionary items. And this issue intermittent(occasional type) not always facing this issue.

After spending time to find root cause of this issue - found that it's because of Dictionary Caching Issue.

And to resolve issue, there are several ways - can choose as per your fit.



1. Solve this issue by doing Global Change - Reset Dictionary Cache at application level

Please put below line of code in your application startup file

Sitecore.Globalization.Translate.ResetCache(true)


2. Solve this issue by Manual Steps - Reset Dictionary Cache

  • Shut down your app pool
  • Remove dictionary.dat from webroot/temp/ folder
  • Start your app pool again

3. Solve this issue by inserting custom pipeline - On Publish event reset dictionary cache.

update below config in Sitecore.config directly or add as new patch config inside (~/App_config/Include)

<event name="publish:end">

<handler type="Sitecore.Publishing.HtmlCacheClearer, Sitecore.Kernel" method="ClearCache">

<sites hint="list">

<site>website</site>

</sites>

</handler>

<handler type="CustomNamespacePath, Customdll" method="CustomMethodName"/>

</event>


<event name="publish:end:remote">

<handler type="Sitecore.Publishing.HtmlCacheClearer, Sitecore.Kernel" method="ClearCache">

<sites hint="list">

<site>website</site>

</sites>

</handler>

<handler type="CustomNamespacePath, Customdll" method="CustomMethodName"/>

</event>


After above config change, write logic to reset dictionary cache in your custom class  which will mention in above config file.




Hope this will help, please share your thoughts - incase of any better approach/feedback.