There were heaps of development work undergoing since the last release 1.4 Update-3 about a year ago. Alen is in the process of merging of everything from develop to master and we should expect version 1.5 to be released soon which I was lucky enough to also contribute a small portion to it, which allows prefixing the SQL database names so multiple databases could be created for different instances.
Keep an eye on the SIM's GitHub for any updates. You can also find it in Sitecore Marketplace.
Wednesday, 29 March 2017
Thursday, 23 February 2017
Script to flush Sitecore xDB
Many people have been talking about how to flush current visit to xDB without playing around the session timeout. Here is just a script ready for use when I need it.
<%@ Page Language="C#" AutoEventWireup="true" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Flush xDB</title>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (Sitecore.Analytics.Tracker.Current != null)
{
Sitecore.Analytics.Tracker.Current.EndTracking();
Session.Abandon();
Response.Write("xDB flushed.");
}
}
</script>
</head>
<body></body>
</html>
Save as a ASPX page and put it somewhere on the site and browse to it to flush current visit into xDB.
Wednesday, 22 February 2017
Sitecore ShowConfig on CD servers
I have to say that this is not recommended, not recommended, not recommended... and you are doing this on your own risk.
So, what is it? We have followed all the recommendation on disabling stuff on CD servers but I am sure sometimes we want to see the famous showconfig results on CD servers so we can investigate the configurations only for CD servers. Because CD should not have Sitecore client and the admin pages, so we have removed them. Then how?
Sounds evil? Yes it is so risk is yours :)
When Sitecore does this in CM server, the showconfig.aspx checks if you are logged in. We cannot do that on CD so we just need to create the same page with code that does not do the security checking and put this, say, EvilShowConfig.aspx somewhere on CD server and remove it as soon as you have collected the configurations.
Save the following content into a text file named EvilShowConfig.aspx and put the file on CD at the location of your choice and browser to it.
<%@ Page Language="C#" AutoEventWireup="true" %>
<%@ Import NameSpace="Sitecore.Configuration" %>
<%@ Import NameSpace="System.Xml" %>
<html>
<head>
<title>Very Evil ShowConfig</title>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
XmlDocument configuration = Factory.GetConfiguration();
Response.Clear();
Response.ContentType = "text/xml";
Response.Write(configuration.OuterXml);
Response.End();
}
</script>
</head>
<body></body>
</html>
Tuesday, 14 February 2017
Sitecore.ExperienceExplorer.Business.Pipelines.HttpRequest.EnableExperienceModePipeline.Process exception
When building a Sitecore site sometimes you might suddenly see the following exception thrown as soon as you browse to the site:
[NullReferenceException: Object reference not set to an instance of an object.]
Sitecore.ExperienceExplorer.Business.Pipelines.HttpRequest.EnableExperienceModePipeline.Process(HttpRequestArgs args) +950
(Object , Object[] ) +73
Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +483
Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain) +21
Sitecore.Nexus.Web.HttpModule. (Object , EventArgs ) +531
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +141
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +91
I discovered this while playing around the Sitecore demo sites that are built on top of Habitat Demo. This issue should only happen on multisite scenario where the Sitecore setting Preview.DefaultSite is set to a site that does not exist.
In my case, I have removed the habitat site and by default the Habitat Demo sets the Preview.DefaultSite value to habitat. Since I do not have it anymore the exception is thrown.
To fix the issue, patch the value of the setting to one of your site's name (which one is up to you).
Hope this helps!
[NullReferenceException: Object reference not set to an instance of an object.]
Sitecore.ExperienceExplorer.Business.Pipelines.HttpRequest.EnableExperienceModePipeline.Process(HttpRequestArgs args) +950
(Object , Object[] ) +73
Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +483
Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain) +21
Sitecore.Nexus.Web.HttpModule. (Object , EventArgs ) +531
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +141
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +91
I discovered this while playing around the Sitecore demo sites that are built on top of Habitat Demo. This issue should only happen on multisite scenario where the Sitecore setting Preview.DefaultSite is set to a site that does not exist.
In my case, I have removed the habitat site and by default the Habitat Demo sets the Preview.DefaultSite value to habitat. Since I do not have it anymore the exception is thrown.
To fix the issue, patch the value of the setting to one of your site's name (which one is up to you).
Hope this helps!
Thursday, 9 February 2017
Salesforce Web2Lead Endpoint Change and TLS 1.0
One of my client has issue with utilizing the Salesforce Web2Lead service whether the code no longer creates lead in Salesforce. After looking into it further, there are actually couple of issues.
Firstly I guess most Salesforce solution provider should have already been notified by Salesforce that to provide better service, Salesforce is planning to change the service endpoints for Web-to-Case and Web-to-Lead, as mentioned in the following knowledge base article:
https://help.salesforce.com/articleView?eid=ss-tc&id=Updating-the-Web-to-Case-and-Web-to-Lead-Endpoint-URL&language=en_US&type=1
So all the code/configuration that refers to the old endpoints such as:
Firstly I guess most Salesforce solution provider should have already been notified by Salesforce that to provide better service, Salesforce is planning to change the service endpoints for Web-to-Case and Web-to-Lead, as mentioned in the following knowledge base article:
https://help.salesforce.com/articleView?eid=ss-tc&id=Updating-the-Web-to-Case-and-Web-to-Lead-Endpoint-URL&language=en_US&type=1
So all the code/configuration that refers to the old endpoints such as:
- https://
www.salesforce.com/servlet/servlet.WebToLead, or - https://
www.salesforce.com/servlet/servlet.WebToCase
Will need to change to:
- https://webto.salesforce.com/servlet/servlet.WebToLead, or
- https://webto.salesforce.com/servlet/servlet.WebToCase
The old endpoints will no longer work after planned time from Jun 2017.
The second issue is that Salesforce has disabled support for TLS 1.0 (https://help.salesforce.com/articleView?id=000221207&type=1) therefore depending on how the integration is done, you will need to update the code or configurations accordingly.
As we are using backend .NET code (4.5.x) I have added the code to select the highest version when possible right before we call the Salesforce service using HttpClient:
using (var client = new HttpClient())
{
System.Net.ServicePointManager.SecurityProtocol =
System.Net.SecurityProtocolType.Tls12 |
System.Net.SecurityProtocolType.Tls11 |
System.Net.SecurityProtocolType.Tls;
// ...
}
If the integration is done by using a static form on a web page (with form action) then the user's browser needs to have TLS 1.0+ support. Refer to the link above to know how to enable TLS 1.1+ on supported browsers.
Friday, 6 January 2017
Sitecore Habitat Transformer
Sitecore Habitat is a open source Sitecore demo website project that implements the Helix design concepts.
The way the project is designed/developed is recommended by Sitecore these days for building a new Sitecore website. The demo site contains many builtin features and a foundation that can be used in our own project.
The immediate headache(???) when beginning using Habitat as a base of your own project is that it has many Sitecore item paths, namespaces, etc stored under Habitat (path or namespaces) and people usually do a file-based find-and-replace to replace the Habitat string with a custom string for their own project. However by doing this might cause some issues which needs to be addressed manually afterwards.
To make life easier I have created a Powershell script that does this and it can be downloaded from https://github.com/codingdennis/SitecoreHabitatTransformer.
Please see the Readme there for more information on how to use it.
The way the project is designed/developed is recommended by Sitecore these days for building a new Sitecore website. The demo site contains many builtin features and a foundation that can be used in our own project.
The immediate headache(???) when beginning using Habitat as a base of your own project is that it has many Sitecore item paths, namespaces, etc stored under Habitat (path or namespaces) and people usually do a file-based find-and-replace to replace the Habitat string with a custom string for their own project. However by doing this might cause some issues which needs to be addressed manually afterwards.
To make life easier I have created a Powershell script that does this and it can be downloaded from https://github.com/codingdennis/SitecoreHabitatTransformer.
Please see the Readme there for more information on how to use it.
Thursday, 1 December 2016
Sitecore Bug - Archiving Specific Version of an Item
A colleague is trying to use the built-in Sitecore functionality to archive a specific version of the item. The way it is done is:
- Navigate to a content item and selected an old version of the item
- From the Review tab, in the ribbon, Schedule group, select the Archive Version Now menu item from the Archive dropdown.
Now the problem is that Sitecore will always select the latest version and pops up the dialog:
5 is the total number of versions I have but I want to archive version 2, which is the selected version. We have tested this in Sitecore 7.5 and 8.0 Update 3 (not tested on later versions) and they all behave the same.
The issue seems to be related to how the menu item is configured in the core database. So open Sitecore desktop and switch to core database and then in the Content Editor, navigate to the following item:
/sitecore/content/Applications/Content Editor/Menues/Archive/Archive Version Now
Check the Message field:
The value contains the (id=$Target) parameter so it is always selecting the latest version of the item (that is clicked from content tree).
To fix the issue, just remove (id=$Target) from the field value, save.
Now go back to the master database, find the item and select version 2. Click on the Archive Version Now menu item (Review / Schedule / Archive dropdown) again and ta..la... it says:
Hit OK and the selected version is archived.
If you wish to restore the version, go to Sitecore desktop / All Applications / Archive and choose the desired item to restore.
Subscribe to:
Posts (Atom)



