Saturday, December 30, 2017

Conflict between Custom Sitecore Helix solution and Sitecore Experience Accelerator

I ran into issues when I was implementing my custom Helix based Sitecore solution where i had created my own Foundation, Feature and Project folders in Sitecore and later on decided to install Sitecore Experience Accelerator (SXA 1.5) on Sitecore 9

Sitecore Experience Accelerator itself comes bundled with these folders out of the box and if you install SXA after you deployed your custom Helix based solution having your own custom Foundation, Feature and Project folders, it will cause multiple issues.


  • SXA has its own folder definitions and will not recognize your own folders in Sitecore content tree if they pre-exist.
  • SXA will not work as expected as in some cases the Sitecore Powershell modules for SXA is considering the path of the folders than the GUID of these folder items. Now having two folders with same name at the same location causes confusion in SXA functionality and some of the features wont work. I got this error when I tried creating a site.


18404 16:42:41 INFO  Executing PsSitecoreItemProvider5.Start(providerInfo='Sitecore')

12196 16:42:41 INFO  Executing a script in ScriptSession '$scriptSession$|s4vp2xehh0dbnaigl0bqqbfs|d90f9428-5823-49a5-b7ad-2fe01ea6d874'.

12196 16:42:41 INFO  The script execution in ScriptSession '$scriptSession$|s4vp2xehh0dbnaigl0bqqbfs|d90f9428-5823-49a5-b7ad-2fe01ea6d874' completed in 6 ms.

ManagedPoolThread #3 16:42:41 ERROR Cannot bind argument to parameter 'TenantTemplateLocation' because it is null.

ManagedPoolThread #3 16:42:41 INFO  The script execution in ScriptSession '$scriptSession$|s4vp2xehh0dbnaigl0bqqbfs|526e5448-b4cc-44c2-9b9d-bff3f751d8c1' completed in 11848 ms.



  • Though I haven't digged enough to find out where this error was coming from, I see powershell code snippets used in SXA that looks like using layer names in the path to query some of the elements and I suspect if that is the issue.


    process {

        Write-Verbose "Cmdlet Get-GridSetup - Process"

        $query = "/sitecore/system/Settings/$Layer//*[@@templatename='Grid Setup']"

        $definitions = Get-Item -Path master: -Language "en" -Query $query

        $definitions

    }



  • If you are planning to use helix based architecture for your implementation along with SXA, make sure you first install SXA before you start creating your own layer folders.


Recommendation:

If you are planning to use SXA then install it before getting on the Helix based implementation.
Change your foundation serialization configuration not to include foundation, feature and project folder items as it would be assumed that you will install SXA content delivery packages yourself and that will have these folders created.

Happy SXA & Helix implementation