Monday, November 30, 2015

WFFM Enrol in Engagement Plans save action cannot be added when Analytics is Disabled

Recently, our product owner complaint to us about an issue in WFFM form.

Issue was, when he try to add a "Enrol in Engagement Plans" save action into a particular WFFM form, it returns following error message.

Error Message : This action cannot be added. Your configuration does not support it.


After a some investigation, it turns out to be that analytics is disabled for this particular WFFM form

"Disable analytics for this page" checkbox was checked



After enabling Analytics (i.e. UnCheck "Disable analytics for this page" checkbox), we were able to add "Enrol in Engagement Plans" save action into WFFM form.



 Happy Sitecore !! :-)

Friday, November 6, 2015

Using Add Contact to contact List WFFM Save Action with Sitecore 8

Yesterday, I saw a question posted into Sitecore Community form related to "Add Contact to Contact List" WFFM save action.

The issue was, when "Add the contact to a contact list" save action was used in a WFFM form.



when the user submits the form, he receives following error message in the page.

We experienced a technical difficulty while processing your request. Your data may not have been correctly saved.



And when checked in the error logs, we can see following error message

11668 09:38:20 WARN  Null ids are not allowed.
Parameter name: userName
Exception: System.ArgumentNullException
Message: Null ids are not allowed.
Parameter name: userName
Source: Sitecore.Kernel
   at Sitecore.Security.Accounts.User.FromName(String userName, Boolean isAuthenticated)
   at Sitecore.Form.Submit.AddContactToContactList.Execute(ID formid, AdaptedResultList fields, Object[] data)
   at Sitecore.Form.Core.Submit.SubmitActionManager.ExecuteSaving(ID formID, ControlResult[] list, ActionDefinition[] actions, Boolean simpleAdapt, ID sessionID)

11668 09:38:20 WARN  The 'Add Contact to Contact List[id={C5E1D916-2476-4BE4-AE90-7B419B55C9E1}]' save action failed: We experienced a technical difficulty while processing your request. Your data may not have been correctly saved.
11668 09:38:20 WARN  Web Forms for Marketers: an exception: We experienced a technical difficulty while processing your request. Your data may not have been correctly saved. has occured while trying to execute an action.

Then, I tried to add "Create User" save action into the WFFM form Save actions as shown below



And then when try to fill the form and submit it, it worked.  :-)



Reason for this is, to add a user into a Contact List using "Add contact to Contact List", he should be already created in Sitecore as a user.

Update : User is now added into Contact List



Will dig deep into code how and why this happens in a later blog post.

Happy Sitecore :-)


Wednesday, October 28, 2015

Multiple versions of an Item for a Language in Web database possible with Sitecore 8.1


In earlier versions of Sitecore (i.e.  Sitecore 8.0 or ealier), WEB database could only contain single item for a given language of an item.

In the hangout session done by Sitecore for Sitecore 8.1 release, I heard that it is possible to have more than one version of an item from given language in WEB database.


But, this is not possible to all the items. To allow multiple items be published to web database, an item must satisfy (or should contain) certain conditions.

One situation that allows multiple item versions for given language item is, item should have an Active Test running for different versions of the same language of that item




When the test successfully ends, Sitecore automatically creates a new version with the matching winning item version and published to Web database





NOTE: Web database will be only containing single item after the Test ends


So, next time when you teach Sitecore to a junior developer, remember NOT to say "Web database contain only one item version for a given language" :-D

Monday, October 19, 2015

rootPath and startItem attribute usege in Sites configuration in Sitecore

Recently, one of my colleagues asked me a question which questioned my knowledged in Sites configuration attributes in Sitecore web.config file

Question:

We have a content tree as follows




When a user visits the http://scfootsteps.local/ , user will be presented with the /sitecore/content/home item, which is the combination of rootPath + startItem in the <sites> configuration

<site name="website" rootPath="/sitecore/content" startItem="/home" ... />


But, what happens if user visits http://scfootsteps.local/aboutus url ?

Answer :

Before degging deeper into this, first refresh our minds with definitions of rootPath & startItem attributes in <sites> configuration

rootPath
The path to the root item of the site in terms of Sitecore content tree. For example, it is set to /sitecore/content for the “website” site.

Quote : https://sdn.sitecore.net/SDN5/Articles/Administration/Configuring%20Multiple%20Sites/Adding%20New%20Site/site%20Attribute%20Properties/rootPath.aspx
startItem
The path to the start Item of the site. This Item will be opened by default when the site is requested. All relative URL paths will be relative to the startItem.

Quote : https://sdn.sitecore.net/SDN5/Articles/Administration/Configuring%20Multiple%20Sites/Adding%20New%20Site/site%20Attribute%20Properties/startItem.aspx

So, that means, anything under the "rootPath" is accessible from typing url.


Question :

Then the next question is, what happens if there are two items with the same name as follows
1) /sitecore/content/aboutus
2) /sitecore/content/home/aboutus



Answer :

Answer is, if item with the same name exists in under both nodes, item inside the /home (i.e. startItem) will get priority






When we delete/remove the item inside the home node (i.e. "sitecore/content/home/aboutus"), item outside the /home node (i.e. "sitecore/content/aboutus" will be displayed for the same url (http://scfootsteps.local/aboutus)





In the next post, we will dig deep into code to see how this above mentioned functionality is handled by Sitecore

happy Sitecore Footsptes  :-)

Friday, October 9, 2015

My Experience on Sitecore IP Geolocation service

Recently we had a task of configuring Sitecore IP Geolocation service with our existing Sitecore website. Even though the configuration is straight forward with good documentation, we were NOT able to configure Personalization to work properly.

i.e.
When we try to add a personalization with GEO IP rules, it didn't detect the country/IP information fro IP Geolocation service
Some sample configurations can be found in the following document
https://doc.sitecore.net/sitecore%20experience%20platform/ip%20geolocation/getting%20started%20with%20sitecore%20ip%20geolocation%20service


INSTALLATION


Follow the installation steps in the following document
https://doc.sitecore.net/Sitecore%20Experience%20Platform/IP%20Geolocation/Setting%20up%20Sitecore%20IP%20Geolocation#_Install_and_enable

NOTE :
If you don't have a way to configure your firewall settings to allow requests to the service by domain names, then you need to allow all the IPs for Microsoft Azure Datacenter, defined in the following document

https://msdn.microsoft.com/en-us/library/azure/dn175718.aspx

That contains larger number of IPs and they can be changed time to time

TROUBLESHOOTING


If your IP is not getting resolved correctly (or your personalizations are not working correctly), then try to use the 'TestIp.aspx' file in the following kb.sitecore.net artible and try to see if your IP is correction detected by Sitecore IP Geolocation services.

https://kb.sitecore.net/articles/798498


NOTE:
This TestIp.aspx page directly contacts/users GeoIP service and get the necessary data for the requested IP.

That is not the case when this service used in Sitecore website

Quote from doc.sitecore.net
When IP information is requested, the following steps are performed:
  • Lookup of IP information in the memory cache;
  • Lookup of IP information in the database;
  • Request to the Geolocation service.

Quote from Sitecore Support
When IP is resolved, the Geo Data (Country, City, etc) corresponded to the IP is searched in cache and then analytics database. If these storage contain data even incorrect, the service won't be used at all.

So, if you are continuously receiving incorrect information, then it is good to do following steps

1) Check whether the correct IP information is stored in the Analytics database:
  • Sitecore 7.5 - Sitecore 8.x: the "GeoIps" collection, Collection database (MongoDB)
  • Sitecore 6.4.1 - Sitecore 7.2: the "GeoIps" table, Analytics database (SQL)
And if incorrect Geo location information stared for a given IP, deleted that incorrect IP info from the GeoIps table/collection and do an app pool reset (to clear application cache). 
Correct Geo information will be cached/stored again in the next request.

2) Use proxy client (like Hide My Ass) to change your IP and try with a new IP


Monday, September 7, 2015

Sitecore Config Include Folders

I was looking into how patch file integration working when I found out that, there is another confi include folder defined in the sitecore.kernel.dll code.

Following code was found in the Sitecore.Configuration namespace of Sitecore.Kernel.dll




We all know "/App_Config/Include" folder where we can keep .config files. But, what is this "/App_Config/Sitecore/Components" folder.

"/App_Config/Sitecore/Components" folder does not come by default with fresh Sitecore instance. So, I created the folder structure and try including a test configuration file (test.config) and it worked fine.

Then, I search in the internet for any information about this folder and could not find anything in the following Sitecore documentation that describes about sitecore patching.

https://sdn.sitecore.net/upload/sitecore6/60/include_file_patching_facilities_sc6orlater-a4.pdf

But, then I did a search in the sdn.sitecore.net and found following document, which contains a description about the folder path and its usage.

https://sdn.sitecore.net/upload/sdn5/scrapbook/include%20file%20patching%20facilities.docx

Quote :
6.1 One more “Include” folderSitecore started to take into account one more folder during the initialization. The folder path in the following: /App_Config/Sitecore/Components. This folder is applied before applying the /App_config/Include folder. It does matter if we override settings, which are overridden by other include files.

Hope this helps!

WFFM Subscription Messages to Contact List with Sitecore 8

With Sitecore 7.5 and earlier, when you have WFFM installed, you will see "Subscribe to Recipient List" save action.
When this action is included into a WFFM form, it handles user subscription process.
i.e.
When user submit the form, a Subscription confirmation email is sent with a confirmation link
When the user clicks on that email link, user is added to selected Recipient list & Successful Subscription notification email is sent to the user.





But, with Sitecore 8.0 onward, WFFM does not have such feature built by default.
Off course, you will find "Add Contact to Contact List" save action which allows you to add users to contact list. But, it does not come with the Subscription email handling feature.




We contacted Sitecore support on this and they provide us with an Extended save action, which handles the user Subscription process like it did in earlier versions. (Reference No: 433957)



Sitecore has mention that this will be included in-built into their future WFFM module releases.

Big thanks to Sitecore Support for there hard-work on providing us this functionality.

Hope this helps to someone! :-)


Wednesday, August 26, 2015

Quick Info Tooltip for Sitecore Content Editor - Sitecore Marketplace Module

Every developer familiar with Sitecore Content Editor knows how irritating when you need to see some info about a another item while you are middle of editing an item.

In this situation, we need to save the currently editing item and then move/select the item that you need to get basic info about (like item path/item id/template id, etc) and come back to the first item which you were editing.

As a solution to this, we introduce Quick Info Tool-tip module, which is a simple and easy module to add into your solution.

Even though the Idea initially came from me, I got lot of help from one of my colleagues, Lakshman Rajapaksha - Sitecore Front-end Developer.

You can download it from following Sitecore Marketplace Url

https://marketplace.sitecore.net/en/Modules/Q/Quick_Info_Tooltip.aspx

Following is an screenshot of the tool-tip

<div>Uploaded by:  <a target='_blank' href='https://profile.sitecore.net:443/Profile.aspx?userId=l%2fdeZY%2fWGaoB3SBdqe7xnoEzTDlfC8hiu9OE23LLY9o%3d'>Chaturanga Ranatunga</a> </div><div>Website: <a target='_blank' class='short-url' href='http://sitecorefootsteps.blogspot.com' title='http://sitecorefootsteps.blogspot.com'>http://sitecorefootsteps.blogspot.com</a></div>

Wednesday, August 12, 2015

Sitecore User Password Policy Configurations

Today, one of my colleagues had an issue when trying to login to a sitecore backend. Initially, we thought the issue was with some configuration miss-match. But, later one of our colleagues found that we can login to sitecore backend using another user (not Admin user)

We finally came to a conclution that the issue was with the password policy. Since this was little bit new to me, I thought of taking a deeper look on this.

Following Sitecore documents provides few configurations that can be used

Configure password policy - doc.sitecore.net

And following document describes about Sitecore Security

Sitecore Security - doc.sitecore.net

In the above document, Sitecore mention following points which helps us to extend/understand how this works

Sitecore uses the .NET security engine, which offers several advantages:
  • A variety of plug-and-play features provided directly by Microsoft.
  • An abstraction from the real data source.
  • The option to replace or extend the default configuration with custom providers.
  • The performance speed of a pure ASP.NET solution.
  • The possibility of keeping the accounts in identifiable storage areas by using several providers simultaneously.


So, following are few more configurations that we can used to control the password policies of our Sitecore instance


minRequiredPasswordLength="<int>"
minRequiredNonalphanumericCharacters="<int>"
requiresQuestionAndAnswer="<bool>"
requiresUniqueEmail="<bool>"
maxInvalidPasswordAttempts="<int>"
 passwordAttemptWindow="<int>"
enablePasswordRetrieval="<bool>"
passwordFormat="Encrypted"
passwordStrengthRegularExpression="<RegularExpression>"


https://msdn.microsoft.com/en-us/library/system.web.security.membership_properties%28v=vs.110%29.aspx

Hope this helps.. :-)


Saturday, August 1, 2015

Sitecore for Dummies - YouTube Channel - My Sitecore Footsteps

One of my colleague gave me a great idea a year ago. Finally I was able to find some time and motivation to put that idea into reality.

We all get lot of questions/problems while doing our work. Sometimes they are just small things which we don't have to go through 30 minute/1 hour video for find out.
Most of the time, it is just 2-3 minute tasks which we need to learn.

So, for that, here comes "Sitecore for Dummies" youtube channel




The idea behind was to create simple and small (less than 5 minutes) videos which can be used to quickly learn something.

But, if you want to learn something throughly, then there are lot of great videos on youtube like Master Sitecore

I'm hopeful that Sitecore for Dummies videos will help a lot specially for beginners to Sitecore.



Monday, July 27, 2015

EXM 3.1 for Sitecore CMS 8.0 Update-3 Upgrade Note

Recently Sitecore relase a new version of Email Experience Manager - EXM 3.1 rev. 150703 for Sitecore 8.0 rev. 150427

This EXM version includes drastic changes from its earlier version, like moving dispatch queue into SQL database instead of MongoDB, etc

I tried to upgrade from 3.0 to 3.1 and the process went smoothly except in one occation.

When tried to run the Update Installation Wizard with the EXM 3.1 Update file (Email Experience Manager 3.1 rev. 150703.update), at the end of the installation process, it returned a critical error stating a .js file deletion failed error.



But, I later found in the upgrade documentation (EXM 31 Update Instructions.pdf) that, they are asking to manually deleting this file and its containing folder.

Remove the following files from all instances of EXM :
sitecore\shell\client\Applications\ECM\EmailCampaign.Client\Pipelines\UpdateMessagevariant\UpdateVariant.js
sitecore\shell\client\Applications\ECM\EmailCampaign.Client\Pipelines\UpdateMessagevariant

Saturday, July 18, 2015

How to change the tool/profiles used as the Rich Text Field Editor in Sitecore

Today we will discuss about the Rich-Text fields.

How to change the tool/profiles displayed as the Rich Text Field editor

  1. Login to Sitecore Desktop
  2. Change the database to "Core"
          

      3. Open "Content Editor"
      4. Under the "/sitecore/system/Settings/Html Editor Profiles", you will see different profiles for the editor.

         

       5.  Select the preferred profile (or create a new profile with the properties/tool tips that you want) and copy the path of that item.
As for my example, I have selected the "Rich Text Full" editor profile and copied the path of that item
/sitecore/system/Settings/Html Editor Profiles/Rich Text Full

       6.  Change the database back to "master"
       7.  Open the "Content Editor"
       8.  Select the Rich-Text type field of the template that you need have the Rich Text Editor
       9.  In the "Source" field, enter the path of the Editor Profile that you copied from the Core database.
            /sitecore/system/Settings/Html Editor Profiles/Rich Text Full

       10.  Now, when you click the "Show Editor" button for an item created from the above template, you will get the full tool tip options.