Wednesday 19 October 2016

Sitecore - unable to update item display name


Recently one of my friend was unable to update display name of an item. It was working fine for other items though. We checked  item:saving event handler but could not find anything which could have caused this issue. Then i found this stackoverflow link and tried checking directly in database

http://stackoverflow.com/questions/29850067/unable-to-change-display-name-of-item-why

I ran below sql query  where fieldid is of "__Display Name" field  and itemid is the item which was giving trouble.

SELECT *
FROM [dbo].[UnversionedFields]
WHERE ItemId = '{39F976FA-0ADC-4CE3-B600-449D33FE30FA}'
  AND FieldId = '{B5E02AD9-D56F-4C41-A065-A133DB87BDEB}'

It gave me two results ,


everytime i was updating my display name it was updating the row which is having "en" language in column. but content tree was always showing the value from the row which has language value as blank.

i checked if i have anyother blank language values . but could not find anything.

SELECT *
FROM [dbo].[UnversionedFields]
WHERE Language=''



  SELECT *
FROM [dbo].[VersionedFields]
WHERE Language=''

we deleted the item and reinstalled that item package from another server and it started working working fine.

if you have lot of items you can try running below sql query after taking your database backup. It should fix the issue

delete
FROM [dbo].[UnversionedFields]
WHERE Language=''



Monday 10 October 2016

Error loading hook: hook type="Sitecore.ContentSearch.Hooks.Initializer - Sitecore 8.1 CD setup

Recently while setting up our cd server we got below error

ERROR Error loading hook: <hook type="Sitecore.ContentSearch.Hooks.Initializer, Sitecore.ContentSearch" patch:source="Sitecore.ContentSearch.config" xmlns:patch="http://www.sitecore.net/xmlconfig/" />
Exception: System.InvalidOperationException
Message: Could not find configuration node: campaignManagementSearch/indexConfigurations/campaignManagementLuceneIndexConfiguration
Source: Sitecore.Kernel

This came because We were disabling Sitecore.Marketing.Lucene.IndexConfiguration.config file as per Sitecore instructions for setting up CD server in this version. But this configuration is being referred in Sitecore.Marketing.Lucene.Index.Web.config file which was still enabled and hence throwing exception. Enable Sitecore.Marketing.Lucene.IndexConfiguration.config file to fix this error