Gravatar for goetzathome@gmail.com

Question by Matt, Jul 6, 2015 3:10 PM

Coveo for Sitecore with custom Search Parameters template

[Update]: The problem came down to something missing in the published site. The error I got should have been my first clue to that.

I’m creating some new search pages for a site using Coveo for Sitecore. My two pages have different paths from which they may define filter rules (rulespath in the fields datasource). To support this I have duplicated the template at /sitecore/templates/CoveoModule/Search/Coveo Search Parameters, using a different name (for TDS reasons), and pointed my second related sublayout at the new type as its datasource. I can open the rules editor, and start creating a rule, but when I try to set the spesifics of the rule (which template to filter on), I get a generic error telling me “Root element is missing”. This happens even when my new template is using the same datasource paths as the pre-existing template.
I need to be able to configure my searches to source items for the filters from different places based on the page. How I get there is less important.

Stacktrace:

XmlException: Root element is missing.]
   System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo(String res) +189
   System.Xml.XmlTextReaderImpl.ParseDocumentContent() +1240
   System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options) +58
   System.Xml.Linq.XDocument.Parse(String text, LoadOptions options) +169
   Sitecore.Shell.Applications.Rules.RulesEditor.RulesEditorPage.Edit(String uid, String name, String control, String parameters) +257

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
   System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +76
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +211
   Sitecore.Web.UI.XamlSharp.Xaml.XamlControl.ExecuteAjaxMethod(AjaxMethodEventArgs e) +184
   Sitecore.Web.UI.WebControls.AjaxScriptManager.DispatchMethod(Control control, String parameters) +423
   Sitecore.Nexus.Pipelines.NexusPipelineApi.Resume(PipelineArgs args, Pipeline pipeline) +398
   Sitecore.Pipelines.Pipeline.Start(PipelineArgs args, Boolean atomic) +327
   Sitecore.Web.UI.WebControls.ContinuationManager.RunPipelines() +255
   Sitecore.Web.UI.WebControls.ContinuationManager.OnPreRender(EventArgs e) +226
   System.Web.UI.Control.PreRenderRecursiveInternal() +113
   System.Web.UI.Control.PreRenderRecursiveInternal() +222
   System.Web.UI.Control.PreRenderRecursiveInternal() +222
   System.Web.UI.Control.PreRenderRecursiveInternal() +222
   System.Web.UI.Control.PreRenderRecursiveInternal() +222
   System.Web.UI.Control.PreRenderRecursiveInternal() +222
   System.Web.UI.Control.PreRenderRecursiveInternal() +222
   System.Web.UI.Control.PreRenderRecursiveInternal() +222
   System.Web.UI.Control.PreRenderRecursiveInternal() +222
   System.Web.UI.Control.PreRenderRecursiveInternal() +222
   System.Web.UI.Control.PreRenderRecursiveInternal() +222
   System.Web.UI.Control.PreRenderRecursiveInternal() +222
   System.Web.UI.Control.PreRenderRecursiveInternal() +222
   System.Web.UI.Control.PreRenderRecursiveInternal() +222
   System.Web.UI.Control.PreRenderRecursiveInternal() +222
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4297
Gravatar for jflheureux@coveo.com

Comment by Jean-François L'Heureux, Jul 6, 2015 4:13 PM

It seems more of a problem with the Sitecore rule editor control and the XML it generates and loads. Did you try to run a Fiddler trace while doing the UI manipulations to see what XML the control is trying to load? Maybe the web server throws an error page in HTML and the control tries to load it as XML.

1 Reply
Gravatar for jflheureux@coveo.com

Answer by Jean-François L'Heureux, Jul 9, 2015 2:44 PM

Update and resolution from mgoetz: The problem came down to something missing in the published site. The error I got should have been my first clue to that.

Ask a question