MediaCreatorOptions.KeepExisting is gone in Sitecore 9

I have a module I’ve been working on that sets the MediaCreatorOptions.KeepExisting setting to false. This module has several different versions for different versions of Sitecore, so there is always a version of it that works in any Sitecore version. In the master branch of the code repository we had version 8.1 (initial release) of Sitecore.Kernel.dll in the references. This has led to an interesting revelation regarding this KeepExisting property.

In Sitecore 8.1 Update 2 (rev. 160302), Sitecore deprecated KeepExisting but it could still be used in code. Instead, you were asked to use OverwriteExisting. When our module ran on this version or later (up to the final revision of 8.2), no errors occurred so we were oblivious to anything being wrong. Since our solution had 8.1 initial release DLLs referenced, we did not see a warning in Visual Studio.

Anyway, KeepExisting was still allowed all the way until Sitecore 9.0 (initial release) when they removed the property altogether. So when we began testing our module in Sitecore 9, we noticed this error:

Method not found: 'Void Sitecore.Resources.Media.MediaCreatorOptions.set_KeepExisting(Boolean)'.

So, the message is: If you have a module that uses KeepExisting, you’ll need to create a new release of it for Sitecore 9 and swap that out with OverwriteExisting. I had to do a lot of digging through the Sitecore.Kernel.dll file for each Sitecore version to find out when this was property was deprecated and when it was initially removed. Unfortunately, Sitecore did not include any of this information in their release notes / breaking changes. Boo!

Advertisements

When does Sitecore Certification expire?

An associate pinged me with this question the other day and I really had no idea. My first thought was that they didn’t expire, since I didn’t actually receive a certificate after becoming certified; instead, just an email reporting that I passed the exam, my score, and the instructor’s congratulations. Nothing about when to retake the exam or when my certification expires.

My first thought of who to ask about this was the Sitecore community on Slack. At first I received my mixed answers, but someone provided an accurate answer: every 3 years. This seemed kind of vague for me, so I decided to get an official answer. I ended up emailing back my instructor (after almost 3 years!) and asking about when it expires, and I got an even better answer:

Certification expiration dates are the same as the Mainstream Support End Date for the corresponding Sitecore version per Sitecore Product Support Lifecycle policy. You can find the mainstream support end date for every version of Sitecore here:  https://kb.sitecore.net/articles/641167

By checking the version of Sitecore I was trained on and its mainstream support end date, I was able to officially determine when my certification expires. However, you should make a point to get re-certified regularly as new versions of Sitecore come out with major changes. Hope this helps some of you out there!

 

 

Creating a Custom Facet in Coveo Hive – Part One

Recently I was tasked with creating a custom facet for a client’s Coveo for Sitecore implementation. I was implementing Coveo Hive, which worked well and it was very simple to add components to the page in a modularized fashion. After reviewing the proof of concept search page, the client realized they didn’t like the date slider component at all, and asked that we instead have a facet with two fields, start date and end date, and each field would have a calendar picker.

I quickly found out this was not available as an OOTB component. I would have to learn how to create a custom component and allow it to be added to a search page. I would have to manage state, facet appearance and breadcrumbs for the new facet. Due to the complexity of this task, I will be creating a blog post series for each major part. In this first blog post, I will go through the basic setup of your custom facet and at the end of this post, you should be able to see and interact with your facet to some extent. Final code will be provided at the end of the final blog post in this series. Let’s get started!

It Starts With Javascript (Or Typescript)

When I first started working on this, Coveo’s documentation suggested creating a custom component using Javascript. It looks like they’ve updated their documentation. You’ll want to start here and pick one of the two paths. I went the JS path, so my code will be different from yours if you choose the TS path.

Continue reading “Creating a Custom Facet in Coveo Hive – Part One”

Crawling root naming “gotcha!”

Short post for a small “gotcha” I experienced with indexing / crawling roots. I’m using indexing roots with Coveo for Sitecore (Hive) v4.1. I updated my roots and named them how I wanted them to be named, then rebuilt the index – only to find 0 items indexed, and the cloud panel reporting nothing happening.

The problem was, there wasn’t a crawling root with the default naming of ContentCrawler (or MediaItemCrawler for the media library). If you are indexing things in the content tree, you need at least one crawler with that exact name, or the rebuild will do nothing.

I don’t think you can have multiple crawlers with the same name, unless the crawlers are for different databases – meaning you can have two crawlers, both named ContentCrawler, one in your master index element and one in your web index element.

From my experience, other content crawlers after that (but within the same index element) can be named however you choose.

Error when serializing the property “RankingState”

I noticed this warning in the Experience Editor of a Coveo Hive search page, specifically on the search interface:

Warnings
  • RankingState
    • Error when serializing the property "RankingState". (Exception has been thrown by the target of an invocation.)

I immediately checked the Sitecore logs and found a long winded exception chain. The head exception was of course, “Exception has been thrown by the target of an invocation“. Many nested exceptions below that, at the very bottom of the chain, I found this error:

Exception: System.InvalidOperationException

Message: Cannot use DataAdapterProvider as xDB is disabled.

Source: Sitecore.Analytics.DataAccess

   at Sitecore.Analytics.DataAccess.DataAdapterProvider..ctor()

   at Sitecore.Analytics.Data.DataAccess.MongoDb.MongoDbDataAdapterProvider..ctor(Func`2 driverFactory)

Researching that error, I found that the problem was my settings in the Sitecore.Xdb.config file (under App_Config/Include). I had XDB disabled, but not XDB.Tracking disabled. I disabled XDB.Tracking and the warning went away. I assume if you have XDB disabled, you should also disable tracking because it relies on XDB. Just thought I’d quickly post this problem and solution as I continue working with Coveo Hive.