Saturday, 19 January 2019

Find Sitecore Item Path with the help of Item Id using SQL Script

Sometimes it's difficult to find the Item path if you are working on multi-site and their Sitecore Search is not working.

The same issue I was facing today, tried as much as possible. And came up with one approach to write SQL Script for this.


For this only need to write one SQL Function and then run the query with Item Id for which you are finding the item path.


Below is the SQL Function which you have to create in the Instance SQL Database where you are finding Item Information

USE [DBNAME]
GO
/****** Object:  UserDefinedFunction [dbo].[GetItemPath]   ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION [dbo].[GetItemPath] 
(
 @ItemID [uniqueidentifier],
 @RootItemPath [uniqueidentifier]
)
RETURNS varchar(MAX)
AS
BEGIN
 DECLARE @Result varchar(MAX);

 with scpath(Name, ParentID, id)
 as
 (
  select Cast(a.Name as varchar(MAX)), a.ParentID, a.ID
  from [Items] a
  where a.ID = @ItemID
  union all
  select Cast(b.Name + '/' + c.Name as varchar(MAX)), b.ParentID, b.ID
  from [Items] b
    inner join scpath c on b.ID = c.ParentID
  where c.ParentID is not null
 )

 select top 1 @Result = '/' + d.Name  from scpath d
  where d.ID = @RootItemPath
 RETURN @Result

END


Once function created now run the below script with Item Id

SELECT [Name], [dbo].[GetItemPath] (ID,'{11111111-1111-1111-1111-111111111111}') AS ItemPath 
 FROM [dbo].[Items]
 WHERE [ID] = '{45BC606D-21CE-4D03-B204-9EBAC0ABDF0B}'

sitecore-item-path


Hope it will help you, Enjoy your day :-)        

Sunday, 13 January 2019

Cannot process argument transformation on parameter 'Signer' during CreateSignedCert : NewSignedCertificate: Sitecore 9 Installation Issue

Getting this issue when i was trying to install another Sitecore 9 instance, did some google and found that need to first remove all the existing Sitecore certificates for CurrentUser and LocalMachine.
After this it works fine for me. 
Remember if already any Sitecore instance is running, then do not need to remove certificate for that instance

NewSignedCertificate-Sitecore


Below are the steps to fix this issue:

  • Open mmc (by win+R and type mmc)
  • Click on file and open Add/Remove Snap-in (CTRL+M)
  • Select Certificates from Left hand side and click on Add

  • Select as Computer Account - Next - Local Computer - Finish - OK
  • Console Root - Certificates (local Computer) -  Personal - Certificates
    • And now delete all the *.xconnect, *_SIF, *_sitecore_* related certificates
  • Same follow for Console Root - Certificates (local Computer) -  Trusted Root Certification Authorities - Certificates
    • And now delete all the *.xconnect, *_SIF, *_sitecore_* related certificates

removing-sitecore-certificate

  • Now again Click on file and open Add/Remove Snap-in (CTRL+M)
  • Select Certificates from Left hand side and click on Add
  • Select as Computer Account - Next - My User Account - OK - OK
  • Console Root - Certificates (local Computer) -  Personal - Certificates
    • And now delete all the *.xconnect, *_SIF, *_sitecore_* related certificates
  • Same follow for Console Root - Certificates (local Computer) -  Trusted Root Certification Authorities - Certificates
    • And now delete all the *.xconnect, *_SIF, *_sitecore_* related certificates
remove-sitecore-certificate-currentuser

After these steps, remove physical certificate files from directory c:certificates/

Now again run the final installation script, hope this will help to fix coming issue while installation.