output
stringlengths 34
25.7k
| instruction
stringlengths 81
31k
| input
stringclasses 1
value |
---|---|---|
It is worth reviewing the validation rules on the Image Field. The validation rules have certain types of behaviour based on the result of the validation. The following are potential results:
The “Result” parameter determines the default result value of a validation.
Possible values are:
Valid = Green, everything is fine
Suggestion = Bright Orange, hmm, take a look at this
Warning = Orange, you should do something about this
Error = Red, this is an error you know
CriticalError = Red, user is warned before saving
FatalError = Red, user cannot save item before validator is cleared
Source: Source for quoted text and more information on validators
The dialog stating "Changes you made may not be saved". This can occur if someone has set a validator that requires the Image field to not be a) pointing to an image that is missing or b) no image.
So as @aseabridge suggested it is worth trying to point the image field to an image that exists. The other option is to review the validations set on the field and remove them if they should not exist. Worth noting they were placed in for a reason, make sure if your removing you don't break any potential business process reasons.
| Sitecore tries to reload the page when saving in Experience Editor
In a component I have rich-text with some text (no special characters). After I edit the text I press save and the page tries to reload with a warning.
Pressing on "Reload" will discard the change, and clicking on "Don't Reload" will leave the page with the Sitecore popup:
I am using: Sitecore.NET 8.0 (rev. 150812)
Why does Sitecore force a page reload?
| |
This is caused by having the Unicorn.SharedSecret.config loading prior to Unicorn.UI.config (which prevents the type definition on the auth provider from loading correctly due to Sitecore config patching rules).
Rename your Unicorn.SharedSecret.config to Unicorn.zSharedSecret.config and that should fix it.
| Unable to cast object of type 'System.String' to type 'Unicorn.ControlPanel.Security.IUnicornAuthenticationProvider' Using automated Tool API
I am trying to run an automated Unicorn Sync on one of My Environments. I have the shared secret key in Unicorn.UI.Config after I had tried using the shared Unicorn.Sharedsecret.Config file with the same result in both cases. I am publishing this secret key as an example it's not the one I am using.
Running Unicorn 3.3.0 RC5 / PowerShell ISE version 5.0.10586.117
Below is the script I am using in power shell to debug this issue:
$ErrorActionPreference = 'Stop'
$ScriptPath = Split-Path $MyInvocation.MyCommand.Path
# This is an example PowerShell script that will remotely execute a Unicorn sync using the new CHAP authentication system.
Import-Module $ScriptPath\Unicorn.psm1
# SYNC ALL CONFIGURATIONS
Sync-Unicorn -ControlPanelUrl 'http://[mysite]/unicorn.aspx' -SharedSecret 'zVjWBabXAAA3LHAA1pBuyoWgAAT4rvhhwu6svj5pT0bvAA09gNQHxrrpyTh4ciA' -Configurations @('default')
Below is the error being thrown with stack trace. Note at the end of the trace something about Invoke-WebRequest I am not sure if this is the root cause:
Unable to cast object of type 'System.String' to type 'Unicorn.ControlPanel.Security.IUnicornAuthenticationProvider'.
Server Error in '/' Application.
Unable to cast object of type 'System.String' to type 'Unicorn.ControlPanel.Security.IUnicornAuthenticationProvider'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the
error and where it originated in the code.
Exception Details: System.InvalidCastException: Unable to cast object of type 'System.String' to type
'Unicorn.ControlPanel.Security.IUnicornAuthenticationProvider'.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified
using the exception stack trace below.
Stack Trace:
[InvalidCastException: Unable to cast object of type 'System.String' to type 'Unicorn.ControlPanel.Security.IUnicornAuthenticationProvider'.]
Unicorn.Configuration.UnicornConfigurationManager..cctor() +85
[TypeInitializationException: The type initializer for 'Unicorn.Configuration.UnicornConfigurationManager' threw an exception.]
Unicorn.Data.DataProvider.UnicornSqlServerDataProvider..ctor(String connectionString) +28
[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.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +243
Sitecore.Reflection.ReflectionUtil.CreateObject(Type type, Object[] parameters) +77
Sitecore.Configuration.Factory.CreateFromTypeName(XmlNode configNode, String[] parameters, Boolean assert) +81
Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +100
Sitecore.Configuration.Factory.CreateObject(String configPath, String[] parameters, Boolean assert) +451
Sitecore.Configuration.Factory.CreateFromReference(XmlNode configNode, String[] parameters, Boolean assert) +91
Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +81
Sitecore.Configuration.Factory.GetInnerObject(XmlNode paramNode, String[] parameters, Boolean assert) +738
Sitecore.Configuration.Factory.AssignProperties(XmlNode configNode, String[] parameters, Object obj, Boolean assert, Boolean deferred, IFactoryHelper helper) +416
Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +198
Sitecore.Configuration.Factory.CreateObject(String configPath, String[] parameters, Boolean assert) +451
Sitecore.Configuration.Factory.CreateObject(String configPath, Boolean assert) +38
Sitecore.Configuration.Factory.GetDatabase(String name, Boolean assert) +105
Sitecore.Configuration.Factory.GetDatabase(String name) +31
Sitecore.Configuration.Factory.GetDatabases() +54
Sitecore.Data.Managers.ItemManager.InitializeEventHandlers() +24
(Object , Object[] ) +85
Sitecore.Pipelines.PipelineMethod.Invoke(Object[] parameters) +36
Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +365
Sitecore.Pipelines.Loader.InitializeManagers.Process(PipelineArgs args) +38
(Object , Object[] ) +56
Sitecore.Pipelines.PipelineMethod.Invoke(Object[] parameters) +36
Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +365
Sitecore.Pipelines.CorePipeline.Run(String pipelineName, PipelineArgs args, String pipelineDomain, Boolean failIfNotExists) +158
Sitecore.Nexus.Web.HttpModule.Application_Start() +165
Sitecore.Nexus.Web.HttpModule.Init(HttpApplication app) +498
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +534
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +172
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +339
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +296
[HttpException (0x80004005): Exception has been thrown by the target of an invocation.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9946024
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +90
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +261
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1069.1
At C:\Website\data\Unicorn\Unicorn.psm1:56 char:12
+ ... $result = Invoke-WebRequest -Uri $url -TimeoutSec 360 -UseBasicPars ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
Unicorn.UI.config looks like:
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<unicorn>
<!--
Authentication Provider
Provides a security protocol to determine who has access to the Unicorn Control Panel
-->
<authenticationProvider type="Unicorn.ControlPanel.Security.ChapAuthenticationProvider, Unicorn">
<SharedSecret></SharedSecret>
<ChallengeDatabase>web</ChallengeDatabase>
</authenticationProvider>
<!--
Legacy provider: this provides Unicorn 2.x and 3.0.x behavior for the security token. Deprecated.
<authenticationProvider type="Unicorn.ControlPanel.Security.LegacyAuthenticationProvider, Unicorn" />
-->
</unicorn>
How it appears in sitecore/admin/showconfig.aspx
One thing to add. I have tried the sync locally through the Unicorn's web UI before trying to implement any of this. It worked fine. This issue only arose when I attempted to define a shared secret key to be able to use the API tool.
Any help or comments are greatly appreciated
| |
I've used a multilist with search and just used a regex in the validate field to limit to choices to the field requirements know each case.
Here is an example regex that limits zero to 5 items ^({[^}]+}|?){0,5}$
For zero to 1 item change the 0,5 to 0,1. To force one item set to 1,1.
Src blog post by Ben Ramey
| What fieldtype should I use to select one item from a bucket
I have a template in which I want to provide a field where editors can select 1 item from a bucket. I am just not sure which field type I should use. The best match for working with buckets seems to be the "Multilist with Search", but that is more suited for selecting multiple items and I need only (and max) 1.
Does anyone have any experience on this - where your editors were happy with the result?
| |
The existing Form Verification/Assess Security Risk action still points to the old Sitecore.Form.Submit.AssessSecurityRisk which is marked Obsolete. Normally Obsolete messages are marked with "Please use X instead"...
Given that the out of the box Assess Security Risk Action is still using the obsolete class you are probably ok to continue to use this for the moment (until the next upgrade at least). I would still raise a support ticket and ask for clarification though.
EDIT:
In Sitecore 8.2 the Assess Security Risk item has no Class or Assembly items set, which suggests the item has been left in as a legacy for existing forms but is no longer used. It may be that the form submissions are encoded by default now, but worth verifying with Support.
The verification was removed in WFFM 2.4 rev 151103, which would have been rolled into the later WFFM versions.
The default Assess Security Risk verification had worked incorrectly for the list fields. This verification can now be removed from the form. (66912)
| WFFM 8.1 upgrade - AssessSecurityRisk is obsolete
We are in process of upgrading from WFFM 8.0 to WFFM 8.1 and when rebuilding our code I received an error on a class we built which inherits AssessSecurityRisk.
[deprecated] class Sitecore.Form.Submit.AssessSecurityRisk
'AssessSecurityRisk' is obsolete
public class AssessSecurityRiskCustom: Sitecore.Form.Submit.AssessSecurityRisk
{
...
}
Any thoughts please pass on.
Thx in advance.
Dan
| |
Sitecore Personalization using GEO IP is not executed:
It works after i added new rule under (/sitecore/system/Settings/Rules/Definitions/Elements/GeoIP/)to check country with country code not country name as already exists in sitecore.
The existing rule:
where the country compares to specific country did not work properly because the returned value for "Country" from the service is "country code" so it compares country code with country name
I added a new rule “CountryCode” to check country with country code under the following path then it works.
(/sitecore/system/Settings/Rules/Definitions/Elements/GeoIP/CountryCode)
Update
Adding text from rules for Text and Type properties so that users can copy directly from here.
Text:
where the country [operatorid,StringOperator,,comares to] [value,,,specific country code]
Type [shared]:
Sitecore.Analytics.Rules.Conditions.CountryCondition,Sitecore.Analytics
| Sitecore IP Geo location Service-Personalization with Geo-based conditions does not work
Sitecore Personalization using GEO IP is not executed .
I have activated "Sitecore IP Geo location Service" and followed all steps needed to activate the service for Sitecore instance (8.1 update 1)
Install Sitecore IP Geo location Service package.
Enable the Sitecore.CES.config, Sitecore.CES.GeoIp.config, and
Sitecore.CES.GeoIP.LegacyLocation.config files.
Navigate to Sitecore/admin/Testip.aspx and insert my "IP" and i got
GeoIp location information
Then i added simple personalize rule as the attached image to hide
one of the controls for specific country then publish the page but
the rule is not executed.
| |
You need to create on /sitecore/system/Settings/Buckets/Facets a new facets add field name (must be lowercase).
You have the field Minimum Number ( Minimum Number of Items - The minimum number of items that the facet must appear in before it is shown in the search results [shared, standard value].
Set the value 0 and it will appear in your search results.
| Display Facets With 0 Values
I'm working on a Lucene-based search page on Sitecore 8.1. I'd like to be able to display all facets and all facet values, even when there are 0 aggregate results for it.
Currently, what I get back from a Lucene query is
{
"Facets": {
"Categories": [
{
"Name": "facetOne",
"Values": [
{
"Name": "F1Value1",
"AggregateCount": 1,
"Aggregate": 1
}
]
},
{
"Name": "facetTwo",
"Values": [
{
"Name": "F2Value1",
"AggregateCount": 2,
"Aggregate": 2
}
]
}
]
}
}
However, I'd like to get back facets with 0 values as well, such as facetThree and F2Value2 in this example:
{
"Facets": {
"Categories": [
{
"Name": "facetOne",
"Values": [
{
"Name": "F1Value1",
"AggregateCount": 1,
"Aggregate": 1
}
]
},
{
"Name": "facetTwo",
"Values": [
{
"Name": "F2Value1",
"AggregateCount": 2,
"Aggregate": 2
},
{
"Name": "F2Value2",
"AggregateCount": 0,
"Aggregate": 0
}
]
},
{
"Name": "facetThree",
"Values": [
{
"Name": "F3Value1",
"AggregateCount": 0,
"Aggregate": 0
}
]
}
]
}
}
Is it possible to do this within the ContentSearch API? If so, how?
edit: here's (a simplified version of) the back-end code, in case it helps
using (IProviderSearchContext context = ContentSearchManager.GetIndex("sitecore_master_index").CreateSearchContext())
{
var query = context.GetQueryable<TQueryable>();
query = query
.FacetOn(f => f.FacetOne)
.FacetOn(f => f.FacetTwo)
.FacetOn(f => f.FacetThree);
var results = query.GetResults();
}
Update: I've learned that there is an override to .FacetOn that takes a "minimumResultCount" argument. That does not appear to be doing anything, however. I'm not sure if that functionality is broken, or if I'm doing something wrong.
Update 2: I submitted a support ticket to Sitecore. They have confirmed there is a bug. Essentially, the Lucene provider doesn't process the minimum result count property of the query. Sitecore has opened a bug for it and is investigating. They confirmed that it is NOT an issue for Solr, and is only limited to the Lucene implementation.
| |
I wasnt extending the adminpage base class. My script tag should have read like this:
<%@ Page Language="c#" Inherits="Sitecore.sitecore.admin.AdminPage" %>
There a good writeup and example page in this post on BrainJocks.
| How to create a quick, one-off admin page without compiling
I need to make a quick Sitecore admin script to inspect a series of items. I need to do this without compiling my solution.
I made a sample ASPX page under /sitecore/admin/ using:
<script runat="server" language="text/c#">
but when I try to view it I get Sitecore telling me ItemNotFound.
Is this type of 'pure script' page supported under Sitecore? Is there a piece of functionality I am missing?
| |
You are correct .. none of the old publishing pipelines are called when the new service is installed.
Background
Traditionally, Sitecore publishes one item at a time. This is inefficient at a larger scale so the Publishing Service, instead, processes items in batches.
This means the existing pipelines are no longer conceptually compatible so there needed to be a 'batched' way of accessing the changes generated from a publish operation.
At the end of a publish, the Publishing Service will push all 'manifest results' (i.e changes that have just have just published) in batches to a pipeline.
The args object of this pipeline contains all items have that been created / updated / deleted during the publish process but before the caches have been cleared.
So if you need to check that certain types of item have been published or need to log anything extra or make any other changes then this pipeline is the place to do it.
Sitecore handles the batching and loading for you, you just process the batches as part of the pipeline arguments.
Details
The pipeline you need to look at the PublishBatchResult pipeline (found as part of the Sitecore Module in App_Config\Include\Sitecore.Publishing.Service.config - rather than the Publishing Service itself).
From the config:
This pipeline is called from publishingservice:publishend event handler which subscribes to the publish end event. Publish results will
be passed to this pipeline in batches. The size of the batch is defined by 'manifestResultLoadBatchSize' parameter specified within
the publishingservice:publishend configuration section.
If you create a processor in here you will receive a PublishEndResultBatchArgs object which will contain a batch of ManifestOperationResult<ItemResult> objects from which you can interrogate and some other helpful properties.
As mentioned, you can adjust the size of these batches in the config.
Sitecore uses this pipeline to issue the events that clear the caches on the CD servers .. so putting your processor before this means your processor will get called before the cache clear, afterwards is gets called after the cache clear.
| How and where to add custom processors for publishing with Sitecore Publishing Service
Publishing Service is very new and while moving through various parts, I had a couple of questions.
The way we know it know is that the PublishItem Pipeline prior to Publishing Service will not have any effect, after installing Sitecore Publishing Service.
In the current situation, can we customize some Pipeline in Sitecore Publishing Service?
If yes, say I have a custom Processor in PublishItemProcessor - for some additional logging and hence I have written it below UpdateStatistics in current scenario - where will that go moving forward with Publishing Service?
| |
In SPE you should be able to do the following to get a list of all users with the admin role.
This should get you users, with admin role who are not the default admin
$users = Get-User -Filter*
| Where-Object {$_.IsAdministrator -and $_.Profile.UserName -ne 'sitecore\admin'}
Then you should pipe through the $users variable add a new role and user set-user to remove admin writes by setting it to false
$users | ForEachObject {
Add-RoleMember -Identity developer -Members $_.Profile.UserName
Set-User -Identity $_Profile.UserName -IsAdministrator $false }
Complete script
$users = Get-User -Filter* | Where-Object {$_.IsAdministrator -and $_.Profile.UserName -ne 'sitecore\admin'}
$users | ForEachObject {Add-RoleMember -Identity developer -Members $_.Profile.UserName Set-User -Identity $_Profile.UserName -IsAdministrator $false }
Worth referring to SPE gitbook for User and Roles Commands and Set-User documentation for more info on what you can change with Set-User and how you can get different users.
| Update all users in the Administrator Role
I want to be able to update all users who have the Administrator checkbox selected without manually going through each of the user. In the same script I would like to add them to another Role. This way there is only one user with the Administrator checked.
I would like to use Sitecore PowerShell extensions module.
| |
Thanks for the assistance of JammyKam I was able to figure out the issue. Basically we had some views in our source control (Views / Forms (also the EditorTemplate)) that were OLD and had references to:
Sitecore.Forms.Mvc.Data.Analytics
Sitecore.Forms.Mvc.Extensions
When publishing, the WFFM 8.1 views were overwritten with the WFFM 8.0 views that were in the solution.
| WFFM 8.1 Upgrade - Namespaces removed from Sitecore.Forms.Mvc
Converting WFFM from 8.0 to 8.1, using MVC and came across an error after my build and deploy to my local environment. Error appearing is one of our Views has the below in lines 1 & 2 which causes errors.
@using Sitecore.Forms.Mvc.Data.Analytics
@using Sitecore.Forms.Mvc.Extensions
When running, receive this:
Server Error in '/' Application.
Compilation Error
Description: An error occurred during the compilation of a resource
required to service this request. Please review the following specific
error details and modify your source code appropriately.
Compiler Error Message: CS0234: The type or namespace name 'Analytics'
does not exist in the namespace 'Sitecore.Forms.Mvc.Data' (are you
missing an assembly reference?)
Source Error:
Line 1: @using Sitecore.Forms.Mvc.Data.Analytics Line 2: @using
Sitecore.Forms.Mvc.Extensions
I looked into the Release Notes for 8.1 and did not see any references to this namespace being broken.
I also opened up Sitecore.Forms.Mvc.dll file for 8.0 and compared with 8.1 in ILspy. I did not see the namespace Sitecore.Forms.Mvc.Data.Analytics in the 8.1 version as it was in the 8.0 dll file
Any help greatly appreciated to resolve this issue.
| |
So turns out that this issue is a bit more complicated. After troubleshooting for days we figured out that this was a redirection issue. Nothing in the application but its how Coveo 4 handles redirection.
CM Site: https://cm.mysite.com
CES Site: http://myCESServer
From Coveo 4 on, the server side Linq to Search requests go through the Coveo Search API via a secured POST call.
The client side js api calls the Coveo Search API using a get call.
Get can move between https and http without an issue but POST on the other hand cannot.
When the query was run on the CM server using Linq to Search (https://cm.mysite.com/somepagewhichrunsquery), it generates a post request and (HERE IS WHERE IT GOES WRONG) posts it to the non https version of the url http://cm.mysite.com/coveo/rest this forces the NLB to push it to https and this causes the search to end up as @uri instead.
This issue causes many others. My other ticket related to coveo indexing 1300+ items also suffers from the same issue.
How do we fix this?
Well. For us, we needed a hotfix for Coveo July 2016 release since we were already in production.
But this fix is going to be part of the October 2016 release - which is due to be release in a couple of days.
You can find the downloads at developers.coveo.com/display/public/SitecoreV4/Downloads
| Coveo indexes about 1300+ records for the coveo web index and fails
Here is the error:
Job started: Index_Update_IndexName=Coveo_web_index|#Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Coveo.Framework.Utils.Rest.HttpClientException: Failed to obtain resource located at 'http://DOMAIN.com/coveo/rest?indexName=Coveo_web_index'.
[BEGIN RESPONSE BODY]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<title>502 - Web server received an invalid response while acting as a gateway or proxy server.</title>
<style type="text/css">
<!--
body{margin:0;font-size:.7em;font-family:Verdana, Arial, Helvetica, sans-serif;background:#EEEEEE;}
fieldset{padding:0 15px 10px 15px;}
h1{font-size:2.4em;margin:0;color:#FFF;}
h2{font-size:1.7em;margin:0;color:#CC0000;}
h3{font-size:1.2em;margin:10px 0 0 0;color:#000000;}
#header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:"trebuchet MS", Verdana, sans-serif;color:#FFF;
background-color:#555555;}
#content{margin:0 0 0 2%;position:relative;}
.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}
-->
</style>
</head>
<body>
<div id="header"><h1>Server Error</h1></div>
<div id="content">
<div class="content-container"><fieldset>
<h2>502 - Web server received an invalid response while acting as a gateway or proxy server.</h2>
<h3>There is a problem with the page you are looking for, and it cannot be displayed. When the Web server (while acting as a gateway or proxy) contacted the upstream content server, it received an invalid response from the content server.</h3>
</fieldset></div>
</div>
</body>
</html>
[END RESPONSE BODY] ---> System.Net.WebException: The remote server returned an error: (502) Bad Gateway.
at System.Net.HttpWebRequest.GetResponse()
at Coveo.Framework.Utils.Rest.HttpClient.ExecuteRequest(String p_Url, HttpWebRequest p_Request, Int64 p_CallId)
--- End of inner exception stack trace ---
at Coveo.Framework.Utils.Rest.HttpClient.ExecuteRequest(String p_Url, HttpWebRequest p_Request, Int64 p_CallId)
at Coveo.Framework.Utils.Rest.HttpClient.PostRaw(String p_Url, String p_Body)
at Coveo.Framework.Utils.Rest.HttpClient.Post(String p_Url, String p_Body)
at Coveo.SearchServiceProvider.Rest.ClientSessionWrapper.ExecuteQuery(QueryParams p_QueryParams)
at Coveo.AbstractLayer.Communication.CES.CESCommunication.<>c__DisplayClass3b.<CreateDeletedDocumentsPoller>b__3a()
at Coveo.Framework.Synchronization.Poller.WaitUntilComplete()
at Coveo.AbstractLayer.Communication.CES.CESCommunication.StopRebuild(RebuildContext p_Context)
at Coveo.SearchProvider.ProviderIndexBase.PerformRebuild(IProviderUpdateContext p_Context, Action`1 p_CrawlerAction)
at Coveo.SearchProvider.ProviderIndexBase.Rebuild(IndexingOptions p_IndexingOptions, IProviderUpdateContext p_Context, Action`1 p_CrawlerAction)
at Coveo.SearchProvider.ProviderIndex.TryPerformIndexingOperation(IndexingOptions p_IndexingOptions, Action p_Action)
at Coveo.SearchProvider.ProviderIndex.Rebuild()
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Sitecore.Reflection.ReflectionUtil.InvokeMethod(MethodInfo method, Object[] parameters, Object obj)
at Sitecore.Jobs.JobRunner.RunMethod(JobArgs args)
at (Object , Object[] )
at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
at Sitecore.Jobs.Job.ThreadEntry(Object state)
| |
In my world I try to make sure templates are controlled by the development team so that we always deploy those. That allows us to make minor changes across the board without worrying about deployment issues. Training for authors to stay out of the templates is required, or you have to split up the template into a 'structural' and 'marketing' template with inheritance so that the authors have a place to play separate from where you deploy.
This doesn't work as well when you need to do something like add a component to specific pages in a specific placeholder. For me, this isn't something that should be automated with TDS, nor should it be in source control. This is an authoring task.
If the task can't be accomplished because it requires something that hasn't been deployed, that code/structure should be deployed first and then the authoring task should occur in production. (You might want to take a copy back into pre-prod/staging/UAT/wherever just to double-check everything works before you go to prod.) In this continuous delivery model, you are deploying code that needs to be able to work without the author needing to make the change. Perhaps you have feature toggling, perhaps you have things triggering alternate display flows based on the presence of a component, but in some way you need to make this 'safe' for delivery to production.
When you do have a lot of authoring edits that need to be made in production, I would consider that part of the package that needs to be deployed is a Sitecore Powershell Extensions (SPE) script or something similar that can be executed in production to avoid manually executing all the steps.
| TDS workflow when content items need to be deployed
This likely applies to other serialization solutions as well, but I'm specifically using TDS in this case.
Here is the scenario:
A site is developed and has gone live with some baseline content. This base structure is in TDS.
Content authors have made edits to content items (as they do with a WCM).
Meanwhile, development is being done which adds new fields to templates, potentially restructures pages with new renderings.
Now this new development needs to be deployed without overwriting content changes.
Typically you will configure your Deployment Properties in TDS so that your production packages do not include items "owned" by content authors. But what about cases where new functionality requires introducing new content, or structural changes to existing content?
Is there some sort of best-practice workflow with Razl or TDS that can help with this? It just a matter of syncing production content and having a content "freeze" prior to deploying the new functionality?
| |
I added Googlebot to the Browser Agent and the site is now coming up as mobile-friendly on the Google Mobile-Friendly Test page.
| Googlebot - Not Seeing Mobile Version - Not Mobile Friendly
I have a website with the Response Header Vary set to "User-Agent". I have verified that none of the JavaScript or CSS code is blocked using the Fetch as Google tool. When looking at the Rendering tab for Googlebot type Mobile:Smartphone it is showing that Googlebot is seeing the normal web version and not the mobile version. It also shows on the Rendering tab that the visitor would have seen the page showing the mobile version correctly.
Google is showing my website as not mobile friendly. But, there is a very nice mobile version of the website for mobile that comes up when I visit with my iPhone or use the Google Chrome simulator. Also, I am not using a second URL for my mobile version (m.mysite.com).
We are using the Mobile Device Detector module for detecting a mobile device.
Our Sitecore version is: Sitecore.NET 7.5 (rev. 141003).
Do I have to convert my website using Bootstrap in order to get Googlebot to see my mobile version and consider my site mobile friendly? It has been suggested that I change the site to use Separate URLs.
Here are the response Headers:
Here is the rule which sends the Mobile version.
Here is the Google Mobile Usability Report:
Here is the Google Mobile-Friendly Test:
The Screen Width Rule Element for Device Detection points to:
Sitecore.SharedSource.MobileDeviceDetector.Rules.Conditions.ScreenWidthCondition, Sitecore.SharedSource.MobileDeviceDetector
Edit:
Here is the version of 51Degrees we are using. 51Degrees emailed us to say that the version we are using is no longer supported and that we should look into using 3Chillies.
| |
While a lot of the suggestions were helpful, my issue ended up being related to migrating to different servers. Prior to inheriting this website, it appears that the database was consistently backed up and migrated across servers; from local, to staging, to production, and now a new production. The properties table in the core database was storing all instances (CD and CM server names). I ended up deleting all the records in that table. Once that happened, indexing improved. After that I was seeing a few intermittent issues potentially being caused by index locking - so I implemented the Switch on Rebuild strategy. Since making those two tweaks I am no longer experiencing issues.
| OnPublishEndAsync not triggering on CD Server
I am setting up an existing site to use separate authoring and delivery servers. We have configured the onPublishEndAsync event to use the web database, and check for threshold is set to true. When I publish the site, and look at the logs: My authoring server has rebuilt the indexes appropriately, however, the indexes on the CD server are out of date.
Is there a configuration that will force my CD environment to detect when it's source database has been published to and initiate at least an incremental build?
Sitecore 8.0.150812 (also patched with https://kb.sitecore.net/articles/992608)
The Sitecore.ContentSearch.DefaultConfigurations.config has the following relevant setting:
<onPublishEndAsync type="Sitecore.Support.ContentSearch.Maintenance.Strategies.OnPublishEndAsynchronousStrategy, Sitecore.Support.440383.449997">
<param desc="database">web</param>
<!-- Whether or not a full index rebuild should be triggered when the number of items in the EventQueue exceeds the number specified
in ContentSearch.FullRebuildItemCountThreshold. -->
<CheckForThreshold>true</CheckForThreshold>
</onPublishEndAsync>
Here is a portion of one of the custom indexes:
<index id="custom_index"
type="Sitecore.ContentSearch.LuceneProvider.LuceneIndex, Sitecore.ContentSearch.LuceneProvider">
<param desc="name">$(id)</param>
<param desc="folder">$(id)</param>
<!-- This initializes index property store. Id has to be set to the index id -->
<param desc="propertyStore" ref="contentSearch/indexConfigurations/databasePropertyStore" param1="$(id)" />
<configuration ref="contentSearch/indexConfigurations/eventIndexConfiguration" />
<strategies hint="list:AddStrategy">
<!-- NOTE: order of these is controls the execution order -->
<strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/onPublishEndAsync" />
<strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/intervalAsyncMaster" />
</strategies>
<commitPolicyExecutor type="Sitecore.ContentSearch.CommitPolicyExecutor, Sitecore.ContentSearch">
<policies hint="list:AddCommitPolicy">
<policy type="Sitecore.ContentSearch.TimeIntervalCommitPolicy, Sitecore.ContentSearch" />
</policies>
</commitPolicyExecutor>
<locations hint="list:AddCrawler">
<crawler type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch">
<Database>master</Database>
<Root>/sitecore/content/mysites/Home</Root>
</crawler>
</locations>
</index>
| |
You are right, you granted to much privileges. You don't have to assign any server roles, but you should should assign db_datawriter, dbreader and public role memberships for your user to the web and master databases. You should also assing execute permissions on all the stored procedures for your db user.
for the core database, assign the following role memberships:
db_datareader
db_datawriter
public
aspnet_Membership_BasicAccess
aspnet_Membership_FullAccess
aspnet_Membership_ReportingAccess
aspnet_Profile_BasicAccess
aspnet_Profile_FullAccess
aspnet_Profile_ReportingAccess
aspnet_Roles_BasicAccess
aspnet_Roles_FullAccess
aspnet_Roles_ReportingAccess
edit: most recent public installation guide that I found: https://dev.sitecore.net/~/media/Downloads/Sitecore_Experience_Platform/8_0/Sitecore_Experience_Platform_8_0/Non-secure/Installation-Guide-SC80-A4.ashx
The best advice is to follow the installation guide for your version, download it on https://dev.sitecore.net
| Server Role for SQL Server Account?
Connecting to SQL Server I currently have set the Server Role sysadmin on the account accessing SQL Server where I'm about to host Sitecore databases. My guess is that it's way to much privileges for the account, and really wonder if dbcreator would be the correct Server Role for the SQL Server account?
| |
You can use targetHostName setting in your site definition. It tells Link Manager to use that host name while generating url.
It doesn't change the way how sites are resolved on your CM and CD servers. This only tells Sitecore to generate links using that particular host name for your site no matter if you're on CM or CD server.
You can read more about site attributes here SDN - Site Attribute Properties
| Create link as CD from CM
We have a Sitecore installation with a content management server and a content delivery server.
Now: I have an item, for which I want to create a link (for sending in an email). The link should be created on the CM server, but point to the relevant page on the CD server.
The servers are on different domain, why it doesn't make sense to send the CM link.
Currently my endeavors are as follows:
string oldSiteName = Sitecore.Context.GetSiteName();
Sitecore.Context.SetActiveSite("website");
UrlOptions urlOptions = new UrlOptions
{
AlwaysIncludeServerUrl = true,
SiteResolving = true
};
string link = LinkManager.GetItemUrl(item, urlOptions);
Sitecore.Context.SetActiveSite(oldSiteName);
This, however, still generates links to the CM domain.
Edit: I added a part of the source code I forgot when first creating the post
| |
I have figured out what was the issue.
Brief Problem Description
I have been using the same code as the one for the Sitecore Installation Wizard upload UI. The only modification done in the implementation is that instead of reading the the ASPX page, I have created an item which is mapped onto the ASPX page and also, it should allowed only CSV file to be uploaded instead of Zip file.
Solution
The issue was due to the path I had specified in the Frame SRC
private void Page_Load(object sender, EventArgs e)
{
this.Upload.Attributes["src"] = Constants.UploadFileApp + WebUtil.GetQueryString();
}
The Constants.UploadFileApp value is
/sitecore/shell/applications/package generator/upload/uploadfile
I should have use the following path
/sitecore/shell/applications/package generator/upload/uploadfile2
Because of this, it causes the Form to redirect to itself hence causing the Error Code 302 as shown in the Inspect Element Network Tab in the question.
So, I had only need to change the above code to the one below:
private void Page_Load(object sender, EventArgs e)
{
this.Upload.Attributes["src"] = Constants.UploadFile2App + WebUtil.GetQueryString();
}
where Constants.UploadFile2App has the path
/sitecore/shell/applications/package generator/upload/uploadfile2
PS:Sorry for missing some information in the question
| Sitecore Upload Window
I am currently developing a module where I am using the Sitecore Upload window. Most of the implementation of the Upload window is the same as the one of Package Installation Wizard.
The issue is that when I click on the Upload button, it open the window however, I get Document Not Found.
The code is as follows:
public static void Upload(ClientPipelineArgs args, Edit fileEdit)
{
if (!args.IsPostBack)
{
UploadForm.Show(ApplicationContext.PackagePath, true);
args.WaitForPostBack();
}
else
{
if (!args.Result.StartsWith("ok:", StringComparison.InvariantCulture))
return;
string[] strArray = args.Result.Substring("ok:".Length).Split('|');
if (strArray.Length < 1 || fileEdit == null)
return;
fileEdit.Value = strArray[0];
}
}
The code for the Show Method
public static void Show(string directory, bool postback)
{
Assert.ArgumentNotNull(directory, "directory");
Context.ClientPage.ClientResponse.ShowModalDialog(GetUrl(directory), postback);
}
And this calls the GetUrl Method
private static string GetUrl(string directory)
{
Assert.ArgumentNotNull(directory, "directory");
var urlString = new UrlString(Constants.UploadFileApp);
urlString.Append("di", ApplicationContext.StoreObject(directory));
return urlString.ToString();
}
The Constants.UploadFileApp has the path /sitecore/shell/applications/package generator/upload/uploadfile.
In the Core DB, the path of the uploadfile is /sitecore/content/Applications/Package Generator/Upload/UploadFile
EDIT 1
This is how the url is being changed
| |
Sitecore Powershell Extensions is always the answer. There is a standard report available. More info here.
But just in case you might want to try something else:
Sitecore query : /sitecore//*[@__lock!='' and @__lock!='<r />'] This could take a while though..
Index query: (lock:true AND _latestversion:true) You could skip the latest version here if you want it for all versions..
Credits to Dan Sinclair.
| Is it possible to get a list of all locked items?
Our editors would like to be able to see all locked items at a glance to be able to clean up locks.
There is of course the option to show locked items in the Quick Action Bar in the content tree, but it doesn't show if any descendents are locked, only items currently showing so this doesn't really help.
Is there something out of the box or do we need to use Sitecore Powershell Extensions or something else?
| |
By digging in the sourcecode I found out, that there is a parameter called "ShowEachLanguage" which you can use like this:
Query=./descendant-or-self::*|Root={Root}|ShowEachLanguage=1
| Getting items for all languages using Advanced System Reporter
I am using ASR to create a report, of all items created before a certain date.
However, in my result set, I am only getting items from the current language, English, but I would like one entry for each language, like we get when we use the search in the content editor.
Is there a way to get this?
I can see, that ASR uses sitecore queries, and that the scanner in use, ItemScanner, is using the following query:
Query=./descendant-or-self::*|Root={Root}
However, I have not been able to edit it, so it returns entries for all language versions.
| |
You're using Mobile Device Detector module from Sitecore Marketplace ( https://marketplace.sitecore.net/modules/mobile_device_detector.aspx ).
Yes, it's using FiftyOne.Foundation.dll and some extra code for rules above it.
There is additional processor added to the httpRequestBegin pipeline called DeviceResolver which tries to resolve what device is used.
And ScreenWidthCondition uses HttpContext.Current.Request.Browser.ScreenPixelsWidth to determine screen value so it's not really related to anything Sitecore specific.
| What dependencies does the Mobile Device Detection Rule have?
My Sitecore site has a rule to determine if the mobile version of the web site should be shown. Can anyone explain to me in detail what exactly is happening with this rule? Is there a DLL involved? Is this something that comes with Sitecore out of the box? Is this using 51Degrees somehow?
I found this DLL reference:
EDIT:
The Screen Width Rule Element for Device Detection points to:
Sitecore.SharedSource.MobileDeviceDetector.Rules.Conditions.ScreenWidthCondition, Sitecore.SharedSource.MobileDeviceDetector
| |
You can do this using Sitecore's eventing engine, by creating event handlers for the roles:usersAdded event, the roles:usersAdded:remote event, or both.
The roles:usersAdded event is raised when users have been added to one or more roles on the environment. In other words, if you have a single-server environment then this is the event that you will want to tie into. Additionally, if you have a split CM/CD environment and you want to listen for users being added to roles on the same server that you added the handler on then this is the event you will want to use.
In contrast, the roles:usersAdded:remote event is used on the CM server when you have a split CM\CD environment and want to listen for this event occurring on the CD.
While it may seem a little confusing that you have a :remote event for adding users to roles, when roles are stored in the Core DB which is shared by both the CM and CD, the events are fired from the code, so having a :remote listens for the code on the CD environment that adds users to roles.
| How to run custom logic when a user has been added to a particular role?
In Sitecore, is there a way that I can run custom logic when a user is added to a particular role?
| |
This magically fixed itself on Friday. I am not really sure why or how, but I am not complaining.
| Error when trying to return custom facet data in JSON format
I have created some custom facets where I store some data. I would like to display this data on the User Profile but I am running into issues.
I am using this link as a guide to set this up: http://reyrahadian.com/2016/08/27/sitecore-8-extending-experience-profile-part-2-displaying-contact-facet-simple-properties/
My HttpRouteConfig.cs file looks like:
using System.Web.Http;
using System.Web.Routing;
using Sitecore.Pipelines;
namespace MySite.Presentation
{
public class HttpRouteConfig
{
public virtual void Process(PipelineArgs args)
{
RegisterRoutes(RouteTable.Routes, args);
}
protected virtual void RegisterRoutes(RouteCollection routes, PipelineArgs args)
{
routes.MapHttpRoute("customcontact_customfields", "sitecore/api/ao/v1/contacts/{contactId}/customfields", (object)new
{
controller = "CustomFields",
action = "GetCustomFields"
});
}
}
}
My controller looks like:
using MySite.Models.Utility;
using Sitecore.Analytics.Tracking;
using Sitecore.Configuration;
using Sitecore.Diagnostics;
using Sitecore.Cintel.ContactService;
using Sitecore.Cintel.Endpoint.Plumbing;
using System;
using System.Net;
using System.Net.Http;
using System.Web.Http;
namespace MySite.Presentation.Controllers
{
[AuthorizedReportingUserFilter]
public class CustomFieldsController : ApiController
{
[HttpGet]
public object GetCustomFields(Guid contactId)
{
try
{
var contactManager = GetContactManager();
var contact = contactManager.LoadContactReadOnly(contactId);
if (contact == null)
{
Log.Info("MySite.Presentation.Controllers.CustomFieldsController.GetCustomFields: Contact not found!", this);
throw new ContactNotFoundException();
}
var customFacet = contact.GetFacet<IContactCompanyInfo>(ContactCompanyInfo.FACET_NAME);
Log.Info("MySite.Presentation.Controllers.CustomFieldsController.GetCustomFields: Company: " + customFacet.Company + " Industry: " + customFacet.Industry + " Sub Industry: " + customFacet.SubIndustry + " Revenue Range: " + customFacet.RevenueRange, this);
return customFacet;
}
catch (ContactNotFoundException ex)
{
Log.Error("MySite.Presentation.Controllers.CustomFieldsController.GetCustomFields", ex, this);
return Request.CreateResponse(HttpStatusCode.NotFound, ex.Message);
}
}
private static ContactManager GetContactManager()
{
var contactManager = Factory.CreateObject("tracking/contactManager", true) as ContactManager;
Assert.IsNotNull(contactManager, "Could not create instance of ContactManager");
return contactManager;
}
}
}
My Javascript file looks like:
define(["sitecore", "/-/speak/v1/experienceprofile/DataProviderHelper.js", "/-/speak/v1/experienceprofile/CintelUtl.js"], function (sc, providerHelper, cintelUtil) {
var app = sc.Definitions.App.extend({
initialized: function () {
var localUrl = "/customfields/";
providerHelper.setupHeaders([
{ urlKey: localUrl }
]);
var url = sc.Contact.baseUrl + localUrl;
var $that = this;
providerHelper.initProvider(this.AdditionalInfoDataProvider, "", url, this.AdditionalInfoTabMessageBar);
providerHelper.getData(this.AdditionalInfoDataProvider,
$.proxy(function (jsondata) {
cintelUtil.setText($that.CompanyValue, jsondata.Company, true);
cintelUtil.setText($that.IndustryValue, jsondata.Industry, true);
cintelUtil.setText($that.SubIndustryValue, jsondata.SubIndustry, true);
cintelUtil.setText($that.RevenueRangeValue, jsondata.RevenueRange, true);
}));
}
});
return app;
});
When I try to reference: https://stage.mysite.com/sitecore/api/ao/v1/contacts/3187658b-b035-4d2e-b348-7e98aed90990/customfields
I get the super-helpful response of:
{ "Message": "An error has occurred." }
You might note that I have some logging in my controller. I can tell that I am at least getting the controller to call because I see the Company Name, etc. written into the logs when I call the above URL.
Any ideas?
I am running Sitecore 8.1 Update 2.
Update: Per suggestion, I turned off customErrors and now I get:
{ "Message": "An error has occurred.", "ExceptionMessage": "The
'ObjectContent`1' type failed to serialize the response body for
content type 'application/json'.", "ExceptionType":
"System.InvalidOperationException", "StackTrace": null,
"InnerException": { "Message": "An error has occurred.",
"ExceptionMessage": "Self referencing loop detected for property
'parent' with type 'MySite.Models.Utility.ContactCompanyInfo'. Path
'members[0]'.", "ExceptionType":
"Newtonsoft.Json.JsonSerializationException", "StackTrace": " at
Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.CheckForCircularReference(JsonWriter
writer, Object value, JsonProperty property, JsonContract contract,
JsonContainerContract containerContract, JsonProperty
containerProperty)\r\n at
Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.CalculatePropertyValues(JsonWriter
writer, Object value, JsonContainerContract contract, JsonProperty
member, JsonProperty property, JsonContract& memberContract, Object&
memberValue)\r\n at
Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter
writer, Object value, JsonObjectContract contract, JsonProperty
member, JsonContainerContract collectionContract, JsonProperty
containerProperty)\r\n at
Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeList(JsonWriter
writer, IEnumerable values, JsonArrayContract contract, JsonProperty
member, JsonContainerContract collectionContract, JsonProperty
containerProperty)\r\n at
Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter
writer, Object value, JsonObjectContract contract, JsonProperty
member, JsonContainerContract collectionContract, JsonProperty
containerProperty)\r\n at
Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter
jsonWriter, Object value, Type objectType)\r\n at
Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter
jsonWriter, Object value, Type objectType)\r\n at
System.Net.Http.Formatting.BaseJsonMediaTypeFormatter.WriteToStream(Type
type, Object value, Stream writeStream, Encoding
effectiveEncoding)\r\n at
System.Net.Http.Formatting.JsonMediaTypeFormatter.WriteToStream(Type
type, Object value, Stream writeStream, Encoding
effectiveEncoding)\r\n at
System.Net.Http.Formatting.BaseJsonMediaTypeFormatter.WriteToStreamAsync(Type
type, Object value, Stream writeStream, HttpContent content,
TransportContext transportContext, CancellationToken
cancellationToken)\r\n--- End of stack trace from previous location
where exception was thrown ---\r\n at
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task
task)\r\n at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task)\r\n at
System.Web.Http.WebHost.HttpControllerHandler.d__1b.MoveNext()"
} }
Update 2: This is what my facet looks like:
using Sitecore.Analytics.Model.Framework;
using System;
namespace MySite.Models.Utility
{
public interface IContactCompanyInfo : IFacet
{
string Company { get; set; }
string RevenueRange { get; set; }
string Industry { get; set; }
string SubIndustry { get; set; }
}
[Serializable]
public class ContactCompanyInfo : Facet, IContactCompanyInfo
{
public const string FACET_NAME = "Company Info";
private const string FIELD_COMPANY = "Company";
private const string FIELD_INDUSTRY = "Industry";
private const string FIELD_SUB_INDUSTRY = "SubIndustry";
private const string FIELD_REVENUE_RANGE = "RevenueRange";
public ContactCompanyInfo()
{
EnsureAttribute<string>(FIELD_COMPANY);
EnsureAttribute<string>(FIELD_INDUSTRY);
EnsureAttribute<string>(FIELD_SUB_INDUSTRY);
EnsureAttribute<string>(FIELD_REVENUE_RANGE);
}
public string Company
{
get { return GetAttribute<string>(FIELD_COMPANY); }
set { SetAttribute(FIELD_COMPANY, value); }
}
public string Industry
{
get { return GetAttribute<string>(FIELD_INDUSTRY); }
set { SetAttribute(FIELD_INDUSTRY, value); }
}
public string SubIndustry
{
get { return GetAttribute<string>(FIELD_SUB_INDUSTRY); }
set { SetAttribute(FIELD_SUB_INDUSTRY, value); }
}
public string RevenueRange
{
get { return GetAttribute<string>(FIELD_REVENUE_RANGE); }
set { SetAttribute(FIELD_REVENUE_RANGE, value); }
}
}
}
| |
To start off, I would always recommend training for someone who needs to make use of a WCMS platform before they go in. There is always going to be so much involved.
One option is using the sitecore apis you could always create a Wizard Tool that works through content creation or managing content for certain pages. The cost and time effort of that would be really high.
Out of the box I generally find, one of the most crucial aspects of making an end-users sitecore content editing experience great is the information architecture and the work put in to supporting the Experience Editor. I've linked to the base docs for sitecore regarding both content editor or experience editor below. You'll find quick googles show you how to best support experience editor in different scenarios.
Experience Editor
The Experience Editor is a WYSIWYG editor that allows you to easily
make changes to items directly on the page. You can edit all the items
that are visible on the page — text, graphics, logos, links, and so
on.
In the Experience Editor, you can edit the fields of the current item
and the fields of any items rendered on the page. For instance, if the
menu on the page consists of titles of the product items, you can edit
the titles without navigating to the product items themselves.
Content Editor
The Content Editor is an editing tool that you can use to manage and edit all the content on your website. It is designed for more experienced content authors who are familiar with Sitecore and the functionality that it contains.
The Content Editors appearance and functionality vary depending on the user’s roles, the local security settings, and the customizations that have been implemented on the Sitecore installation.
Worth reading up on: The Experience Editor and Content Editor and Other Editing Tools
SPEAK UI
If you really want to customise it, I recommend reading into SPEAK UI first which is what powers a lot of the sitecore client currently.
Maybe give creating a new speak application that'll handle displaying or managing content in a manner you are expecting a go. Worth reading: Speak for newbies part 1 creating a new application
I will be honest with you my personal experience has been, forcing me to rip my hair out, but I know there those who appreciate it.
Finally check out https://github.com/Sitecore/speak.theming never tried it myself but seems cool, allowing you to change the default speak colors :), more customization.
Helix
If your interested in providing the content editors a decent experience in content editor look into the Helix architecture and look at how it works with the information inside sitecores client, especially when you are building the templates. It's a good starting point for a modular approach. Source: http://helix.sitecore.net/
| I'm looking to implement a better UI Solution for managing content
Has anyone come across this type of feature in the marketplace or created a solution themselves? Mainly thinking about non-technical content managers having the easiest of UI solution for managing content.
Thanks in advance.
| |
NB: The following description works for both xDB on-premises as well as xDB Cloud.
In Sitecore Experience Database aka Sitecore xDB, there are Collection repository and Reporting repository.
Collection
The Collection repository is powered by MongoDB and includes the following databases:
analytics
tracking.live
tracking.history
tracking.contact
Reporting
The Reporting repository is powered by SQL Server and includes the following databases:
reporting
reporting.secondary
Processing
Between those two repositories, Sitecore has Processing role, which takes raw visitors data, aggregates, processes, does some magic and saves into the Reporting repository.
Content Delivery
In front of the Collection repository, Sitecore has Content Delivery role (aka CD), which has direct access to MongoDB databases and it writes all visitors activity in a raw format.
Reporting Service
Behind the Reporting repository, Sitecore has Reporting Service role, which has direct access to SQL Server database.
Content Management
Under the Reporting Service role, Sitecore has Content Management role (aka CM), which sends SQL queries to the Reporting Service role to execute them against the reporting SQL Server databases.
The Content Management role, provides the following apps:
Experience Analytics
Experience Profile
The Experience Analytics app takes data from the Collection repository. While the Experience Profile app takes data from the Collection repository.
Note: I took away the sitecore_analytics_index search index from the above description to simply it a bit.
Troubleshooting
Therefore, if the Experience Profile app doesn't show any data that means something goes wrong in the above sequence, and typical troubleshooting scenario is as follows:
Check if the CD role flushes raw visitors' data into the Collection repository:
Using Robomongo tool, connect to the analytics database and run the following query against the Interactions collection to see date time of the last save interaction:
db.Interactions.find().sort({SaveDateTime:-1}).limit(1)
If you can see recently saved documents then go to step #2.
If not then check the connection strings to the databases of the Collection repository, and if your session state provider supports the Session_End event, because this is when Sitecore starts flushing data.
When Sitecore can't flus data, it dumps it in the file system under the \Data\Submit Queue path.
Check if the Processing role saves cooked date in the Reporting repository:
Using SQL Server Management Studio, connect to the reporting database and run the following query against the [Trail_Interactions] table:
SELECT TOP 1 [Processed] FROM [Trail_Interactions] ORDER BY [Processed] DESC
If you can see recently processed interaction then go to step #3.
If not then you need to check Sitecore Log files on the Processing role. Most likely there is an exception(s) that explains why aggregation process fails. However, it's tricky with an xDB Cloud Set, because you don't have an access to it. In this case, I would recommend filing a support ticket to Sitecore.
Check if the Content Management role is configured to talk to the Reporting Service. The following configuration files must be enabled:
Sitecore.Xdb.Remote.Client.MarketingAssets.config
Sitecore.Xdb.Remote.Client.config
Sitecore.PathAnalyzer.RemoteClient.config
| xDB Cloud Experience Analytics not refreshing
I'm using the xDB Cloud 1.0 setup in Sitecore 8.1. The site is successfully tracking contacts as I can see new profiles under the Experience Profile. However, the aggregate data on Experience Analytics is not refreshing and still showing 0 visits. I am using the Sitecore.Cloud.Xdb.Update 8.1.0 rev. 160210 package, and no errors in the logs. And it has been several days, so there should definitely be aggregated data. Is there something I am supposed to trigger to cause the reporting to update, or is that supposed to happen automatically in the cloud?
| |
The underlying logging framework that Sitecore uses is Apache Log4Net, and this has not changed for a very long time (since early 6.x). Even the version used is the same, 1.2.11 I believe.
The pattern used for logging messages is also exactly the same between the versions:
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%4t %d{ABSOLUTE} %-5p %m%n" />
</layout>
The Log Analyser tools relies on a certain pattern being used in the log4net log files. Since the underlying framework and the pattern have not changed it will work with the latest versions of Sitecore without any issues.
| Sitecore log analyzer supported on latest versions?
I noticed that the Sitecore Log Analyzer on market place does not say anything about the latest Sitecore versions and whether it is supported or not. I have used it on 8 and it was working fine but haven't tried on versions 8.1 and 8.2. Do you know if this module is supported on the latest Sitecore releases?
| |
The issue was that in my efforts to trim the index of waste, i.e. remove fields that I'm not accessing, I removed a certain special field (though it is not marked in any way as being important, though by name it makes sense in hindsight). I removed the "_uniqueid" field from the index configuration. Specifically here:
<fieldMap>
...
<field fieldName="_uniqueid" storageType="YES" indexType="TOKENIZED" vectorType="NO" boost="1f" type="System.String" settingType="Sitecore.ContentSearch.LuceneProvider.LuceneSearchFieldConfiguration, Sitecore.ContentSearch.LuceneProvider">
<analyzer type="Sitecore.ContentSearch.LuceneProvider.Analyzers.LowerCaseKeywordAnalyzer, Sitecore.ContentSearch.LuceneProvider" />
</field>
...
I had created a new IndexConfiguration.config file unique to my index. I tested and I was able to remove all other fields from the index. Toggling this field on or off reproduced the issue.
EDIT:
With the _uniqueid field omitted from the index configuration, the field will still appear in the index (via Luke or other means). Including it in the index configuration will solve this problem.
| Sitecore 8: Items Duplicated in Web Index After Publish
In only our Staging/Production environment, items are being duplicated in our web index after a publish is performed. The only distinction between the duplicate items (via Luke) is that any indexed images are prefixed with "/sitecore/shell"
If I perform a manual index rebuild from Indexing Manager, the results are as expected.
The index uses a copy of the default IndexConfiguration with some slight modifications (edited), renamed to be newsIndexConfiguration and it is referenced properly on the index implementation
<index id="$(News.Index.Name.Web)" type="Sitecore.ContentSearch.LuceneProvider.LuceneIndex, Sitecore.ContentSearch.LuceneProvider">
<param desc="name">$(id)</param>
<param desc="folder">$(id)</param>
<!-- This initializes index property store. Id has to be set to the index id -->
<param desc="propertyStore" ref="contentSearch/indexConfigurations/databasePropertyStore" param1="$(id)" />
<configuration ref="contentSearch/indexConfigurations/newsIndexConfiguration" />
<strategies hint="list:AddStrategy">
<strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/onPublishEndAsync" />
</strategies>
<commitPolicyExecutor type="Sitecore.ContentSearch.CommitPolicyExecutor, Sitecore.ContentSearch">
<policies hint="list:AddCommitPolicy">
<policy type="Sitecore.ContentSearch.TimeIntervalCommitPolicy, Sitecore.ContentSearch" />
</policies>
</commitPolicyExecutor>
<locations hint="list:AddCrawler">
<crawler type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch">
<Database>web</Database>
<Root>/sitecore/content/Global/News/Articles</Root>
</crawler>
</locations>
</index>
It goes without saying that there is custom code all over this implementation at this point. However, this is a new feature that started with the default configuration. I cannot figure out what might be causing the duplicates to be added on publish.
It was erring without the <indexAllFields> element set to true, which I can live with, but certainly isn't ideal.
I should note, when I perform a Republish (including all children) at the newsroom root, it adds these multiple values, not just 1 additional duplicate, but 5 or even more sometimes, it feels quite arbitrary.
In the past, in this instance, I've gotten around this by filtering out results that contain "/sitecore/shell" in the image field, but this is merely a Band-Aid. Any help to solve this would be greatly appreciated.
| |
This usually happens when that field has been removed since the save action email template was created.
Have you renamed/removed any fields since you created it?
I'd suggest opening up the save action, removing the [Phone] field, [Message] field etc and then adding them back to the email template using the dropdown of fields. Then saving and trying again.
WFFM binds the [my field] placeholders to the fields based on a hidden id so if these are changed then it can loose the reference to the field.
| WFFM Send Email Message When no Field Data
I have set up a WFFM form and am using the Send Email Message save action. In the Email I have fields from the form (Selected by using the drop down list of fields in the editor). If the user does not fill in the field (its not a required field), the [FieldName] appears in the text of the email. I would of thought it should just be blank? Can I override this behavior without writing a custom save action?
WFFM Version: 8.1 rev. 160304 Sitecore 8.1 rev. 160304
Update
Here is the Html of the email from the email editor in the save action:
<p>[<label id="{43439BEE-8420-425B-8568-EFA16E6CD862}">First Name</label>]&nbsp;[<label id="{59FC07BC-F52A-430C-A77C-9B9C7D33D91D}">Last Name</label>] has contacted Blahblahblah.com with a question regarding Order Status.</p>
<p>Contact Details:</p>
<p>First Name:&nbsp;[<label id="{43439BEE-8420-425B-8568-EFA16E6CD862}">First Name</label>]</p>
<p>Last Name:&nbsp;[<label id="{59FC07BC-F52A-430C-A77C-9B9C7D33D91D}">Last Name</label>]</p>
<p>Email:&nbsp;[<label id="{DA938496-CD20-446C-9799-7F974AEAEC32}">Email</label>]</p>
<p>Phone:&nbsp;[<label id="{9EB25349-9772-4D5C-9690-E9301A1A6915}">Phone</label>]</p>
<p>Best Time To Be Contacted:&nbsp;[<label id="{0291B856-8E75-4E1E-A6A9-FCC72103560B}">Best Time To Be Contacted</label>]</p>
<p>Request A Call Back:&nbsp;[<label id="{65BE7408-3645-44DD-803D-BD97B1518FCF}">Request a Call Back</label>]</p>
<p>Message:&nbsp;[<label id="{312DA275-AD4B-4EE2-88AB-CE8A3083090A}">Message</label>]</p>
<p>Attachment:&nbsp;[<label id="{4D31A48A-F714-417A-9987-3BC127AA6DE9}">Attachments</label>]</p>
<p>Product:&nbsp;[<label id="{6DC3B0CE-6C57-4180-9C43-D91A7345A28F}">Product</label>]</p>
<p>Product Category:&nbsp;[<label id="{71C70DBB-1A49-40FE-8667-B15E8C63B9E9}">Product Category</label>]</p>
<p>Product Collection:&nbsp;[<label id="{97813AA2-E7F8-4EF3-BF9F-1585F48CF690}">Product Collection</label>]</p>
<p>Product Color/Finish:&nbsp;[<label id="{A81E3A28-7D34-4407-94BC-D1F58A3AA8FD}">Product Color/Finish</label>]</p>
<p>Blahblahblah Brands order or confirmation #:&nbsp;[<label id="{8DE1665E-0996-4D1D-A685-410FB1D16246}">Blahblahblah Brands order or confirmation #</label>]</p>
<p>Product's Model or SKU from Proof of Purchase:[<label id="{78B78963-CE8E-404A-8782-AD0D8DA26E8A}">Product's Model or SKU from Proof of Purchase</label>]</p>
<p>Installation Date:&nbsp;[<label id="{05868311-16B0-4E74-B95B-C7F898F6A64E}">Installation Date</label>]&nbsp;[<label id="{95CE2944-4369-4854-A346-5EE9653368D7}">Year</label>]</p>
<p>I registered my warranty online:</p>
<p>Yes: [<label id="{D2C19DCA-C362-4FC8-B7DF-C7E7A9D7FF8D}">Yes</label>]</p>
<p>No:&nbsp;[<label id="{842B6C17-A1C1-499D-85E5-33BC6F4594B8}">No</label>]</p>
<p>Thank You</p>
<p>&nbsp;</p>
And here is the email I get:
Ethan Schofer has contacted Blahblahbah.com with a question regarding Order Status.
Contact Details:
First Name: Ethan
Last Name: Schofer
Email: [email protected]
Phone: [Phone]
Best Time To Be Contacted: [Best Time To Be Contacted]
Request A Call Back: False
Message: [Message]
Attachment: [Attachments]
Product: Blah
Product Category: Bath Drains
Product Collection: Blah
Product Color/Finish: Blue
Blahblahblah Brands order or confirmation #: [Blahblahblah Brands order or confirmation #]
Product's Model or SKU from Proof of Purchase:[Product's Model or SKU from Proof of Purchase]
Installation Date: October 2016
I registered my warranty online:
Yes: False
No: False
Thank You
| |
Like Mark Cassidy mentioned above, <mvc.requestBegin> would be a close "equivalent". I ran into a similar situation wanting non-authenticated users to be redirected to the <site loginPage="/login">. The only caveat I had was that I needed some custom logic to create virtual users based on their IP address (site to site VPN), so I decided to extend the Sitecore.Layout.RenderLayout.SecurityCheck like so:
namespace YourNamespace.Custom
{
public class InternalSecurityCheck : SecurityCheck
{
public virtual void Process(RequestBeginArgs args)
{
Assert.ArgumentNotNull(args, "args");
Profiler.StartOperation("Check security access to page.");
if (!HasAccess() || Context.User.LocalName.ToLower().Equals("anonymous"))
{
//logic for checking IP and creating virtual user if internal
CreateVirtualUserIfInternal();
}
if (!HasAccess())
{
args.AbortPipeline();
var loginPage = GetLoginPage(Context.Site);
if (loginPage.Length > 0)
{
var urlString = new UrlString(loginPage);
if (Settings.Authentication.SaveRawUrl)
{
urlString.Append("url", HttpUtility.UrlEncode(Context.RawUrl));
}
var absolutePath = HttpContext.Current.Request.Url.AbsolutePath;
if (!string.IsNullOrEmpty(absolutePath))
{
urlString["returnUrl"] = absolutePath;
}
Tracer.Info("Redirecting to login page \"" + loginPage + "\".");
WebUtil.Redirect(urlString.ToString(), false);
}
else
{
Tracer.Info("Redirecting to error page as no login page was found.");
WebUtil.RedirectToErrorPage("Login is required, but no valid login page has been specified for the site (" + Context.Site.Name + ").", false);
}
}
Profiler.EndOperation();
}
The above code should also preserve the return url if a page is bookmarked or session expires while visiting. I think the only remaining piece, after extending the SecurityCheck is binding it to the <mvc.requestBegin:
<mvc.requestBegin>
<processor type="YourNamespace.Custom.InternalSecurityCheck, YourNamespace.Web" />
</mvc.requestBegin>
(https://community.sitecore.net/developers/f/8/t/2808 assisted me thru some of this). Hope this is helpful.
| MVC equivalent of SecurityCheck Pipeline Processor
What is the pipeline processor responsible for redirecting the user to the login page if they do not have access to the page being loaded? In a Sitecore webforms solution, this is handled by the SecurityCheck pipeline processor, but what is it in a Sitecore MVC solution since the RenderLayout pipeline does not execute?
| |
Unicorn 3.2 is built against .NET 4.5, and Sitecore 8.2 is built against .NET 4.5.2. There are some funny edge cases where the earlier framework assembly calling the later framework assembly breaks - like this one.
To fix this update to Unicorn 3.3 RC9, which is built against .NET 4.5.2 and squashes a bunch of bugs. It's a plain ol' NuGet package upgrade to install it. Refer to https://github.com/kamsar/Unicorn/issues/175
| Bad IL format in Unicorn
Unicorn 3.2
Sitecore 8.2 160729
When I sync, it crashes with this error. But only on a few projects.
[A] master:/sitecore/templates/Feature/Navigation/_Navigable/Navigation/LinkTitle (230de8d4-f378-40b0-9c46-c1cfb5facf98)
ERROR: Bad IL format. (System.BadImageFormatException)
at Sitecore.Data.Database.GetItem(ID itemId)
at Unicorn.Pipelines.UnicornSyncComplete.SyncedItemPostProcessor.<>c__DisplayClass0_0.b__1(ChangeEntry change)
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at Unicorn.Pipelines.UnicornSyncComplete.SyncedItemPostProcessor.Process(UnicornSyncCompletePipelineArgs args)
at (Object , Object[] )
at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
at Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain)
at Unicorn.SerializationHelper.SyncTree(IConfiguration configuration, Action`1 rootLoadedCallback, IItemData[] roots)
at Unicorn.ControlPanel.Pipelines.UnicornControlPanelRequest.SyncVerb.Process(IProgressStatus progress, ILogger additionalLogger)
| |
Based on this blog post the only valid options are Comment, Name and Full Name. You can try changing your value from User Name to Full Name but I'm not sure if it will give you what you need. You may need to create a very simple custom field for this, or alternatively create a custom rule action as per the linked article.
| Prepopulate WFFM field with username
I would like to use the rules engine to prepopulate a WFFM form field with the logged in user's username. Unfortunately, I can't seem to get this to work, even though the conditions and actions that I am using are provided out of the box.
I don't see any errors in my logs or at runtime - the field value is just not being set.
If you look at the below screenshot of the form designer, the rule that I am using is at the bottom left.
Does anyone know what I'm doing wrong here or if there is something special that I need to do in order to get this working?
| |
If you have a global js file of some kind then you should be able to do something like the following:
<script>
window.onload = new function () {
var valSummary = $('.scfValidationSummary');
if (valSummary.length && valSummary.html().trim() != "") {
location.hash = "#error-container";
}
}
</script>
This should scroll the user to the container. You could change the location to go to where you want to though. This would need to run after any WFFM js runs though in order to work.
We wire up our custom WFFM code using the data attribute on the WFFM form and then hook into the submit event of the form like so which might be another way to fire some js to scroll the user:
var $wffmForm = $('[data-wffm]');
$wffmForm.on('submit', onSubmit);
function onSubmit(e) {
//do stuff here
}
| How to change the focus of a WFFM upon validation errors?
I'm trying to make Web Forms for Marketers forms on our site ADA Compliant. In order to do this, screen readers need to be able to focus where the validation errors are when a form fails. In WFFM, this seems to be in the "scfValidationSummary" class, seen here: http://prntscr.com/csoimr
However, instead of focusing on the errors, WFFM focuses the user on the first input box instead, as seen in this screenshot: http://prntscr.com/cso418
This means that when the screen reader begins, it just starts at the fields and will not read any errors to the user. Users not alerted that they have errors, and can't progress past the form.
From what I understand, WFFM reloads the page upon error validation, meaning I can't use simple javascript to focus on the scfValidationSummary class. I could try making sure our javascript runs after WFFM's, but that seems like an unreliable idea.
I'm looking for advice on how to override this functionality. I'm thinking of trying to insert a tabIndex property on the class that surrounds the errors (scfValidationSummary) in the Sitecore.Forms.Core.dll - I'd have to override WFFM's functionality at that point, somehow (not sure how much effort this is).
Any advice you can offer? Sitecore version is 7.5 (rev. 141003). WFFM is 2.5 rev 141014.
| |
So turns out that this issue is a bit more complicated. After troubleshooting for days we figured out that this was a redirection issue. Nothing in the application but its how Coveo 4 handles redirection.
CM Site: https://cm.mysite.com
CES Site: http://myCESServer
From Coveo 4 on, the server side Linq to Search requests go through the Coveo Search API via a secured POST call.
The client side js api calls the Coveo Search API using a get call.
Get can move between https and http without an issue but POST on the other hand cannot.
When the query was run on the CM server using Linq to Search (https://cm.mysite.com/somepagewhichrunsquery), it generates a post request and (HERE IS WHERE IT GOES WRONG) posts it to the non https version of the url http://cm.mysite.com/coveo/rest this forces the NLB to push it to https and this causes the search to end up as @uri instead.
This issue causes many others. My other ticket related to coveo indexing 1300+ items also suffers from the same issue.
How do we fix this?
Well. For us, we needed a hotfix for Coveo July 2016 release since we were already in production.
But this fix is going to be part of the October 2016 release - which is due to be release in a couple of days.
You can find the downloads at https://developers.coveo.com/display/public/SitecoreV4/Downloads
| Odd Linq ContentSearch issues with Coveo 4.0
After upgrade to Coveo 4.0 I am getting an error related to the version field. Here is the query I am running in Linq Scratch Pad:
using (var context = ContentSearchManager.GetIndex("Coveo_web_index").CreateSearchContext())
{
return context.GetQueryable<SearchResultItem>().Take(10).ToList();
}
As you can see the query itself is no magic, I did not change it.
The Searchprovider.config by default has:
<fields hint="raw:AddComputedIndexField">
<field fieldName="calculateddimension">Sitecore.ContentSearch.ComputedFields.CalculatedDimension,Sitecore.ContentSearch</field>
<field fieldName="istemplate">Sitecore.ContentSearch.ComputedFields.IsTemplate,Sitecore.ContentSearch</field>
<field fieldName="haschildren">Sitecore.ContentSearch.ComputedFields.HasChildren,Sitecore.ContentSearch</field>
<field fieldName="lock">Sitecore.ContentSearch.ComputedFields.IsLocked,Sitecore.ContentSearch</field>
<field fieldName="parsedcreatedby">Sitecore.ContentSearch.ComputedFields.ParsedCreatedBy,Sitecore.ContentSearch</field>
<field fieldName="parsedupdatedby">Sitecore.ContentSearch.ComputedFields.ParsedUpdatedBy,Sitecore.ContentSearch</field>
<field fieldName="parsedlanguage">Sitecore.ContentSearch.ComputedFields.ParsedLanguage,Sitecore.ContentSearch</field>
<field fieldName="site">Sitecore.ContentSearch.ComputedFields.Site,Sitecore.ContentSearch</field>
<field fieldName="sizerange">Sitecore.ContentSearch.ComputedFields.FileSizeGrouping,Sitecore.ContentSearch</field>
<field fieldName="version">Sitecore.ContentSearch.ComputedFields.StoreVersionTermVector,Sitecore.ContentSearch</field>
<field fieldName="urllink">Sitecore.ContentSearch.ComputedFields.UrlLink,Sitecore.ContentSearch</field>
<field fieldName="isbucket_text">Sitecore.ContentSearch.ComputedFields.IsBucket,Sitecore.ContentSearch</field>
<field fieldName="alltemplates">Sitecore.ContentSearch.ComputedFields.AllTemplates, Sitecore.ContentSearch</field>
</fields>
And in the index I can see the version field.
@fversion24653 String 1
I get the error:
Property accessor 'Version' on object 'Sitecore.ContentSearch.SearchTypes.SearchResultItem' threw the following exception:'The given key was not present in the dictionary.'
I have index all fields as true.
<coveoQueryFieldPipeline patch:source="Coveo.SearchProvider.config">
<processor type="Coveo.SearchProvider.Processors.Queries.AddAllFieldsProcessor, Coveo.SearchProviderBase"/>
</coveoQueryFieldPipeline>
The base Coveo.SearchProvider.config indexes version, id and unique id fields.
<fieldType fieldName="_id" settingType="Coveo.Framework.Configuration.FieldConfiguration, Coveo.Framework" type="Sitecore.Data.ID, Sitecore.Kernel" returnType="System.String" />
<fieldType fieldName="_uniqueid" settingType="Coveo.Framework.Configuration.FieldConfiguration, Coveo.Framework" type="Sitecore.Data.ItemUri, Sitecore.Kernel" returnType="System.String" />
<fieldType fieldName="name" isFacet="true" isSortable="true" includeForFreeTextSearch="true" isMultiValue="false" settingType="Coveo.Framework.Configuration.FieldConfiguration, Coveo.Framework" />
<fields hint="raw:AddComputedIndexField">
<field fieldName="calculateddimension">Sitecore.ContentSearch.ComputedFields.CalculatedDimension,Sitecore.ContentSearch</field>
<field fieldName="istemplate">Sitecore.ContentSearch.ComputedFields.IsTemplate,Sitecore.ContentSearch</field>
<field fieldName="haschildren">Sitecore.ContentSearch.ComputedFields.HasChildren,Sitecore.ContentSearch</field>
<field fieldName="lock">Sitecore.ContentSearch.ComputedFields.IsLocked,Sitecore.ContentSearch</field>
<field fieldName="parsedcreatedby">Sitecore.ContentSearch.ComputedFields.ParsedCreatedBy,Sitecore.ContentSearch</field>
<field fieldName="parsedupdatedby">Sitecore.ContentSearch.ComputedFields.ParsedUpdatedBy,Sitecore.ContentSearch</field>
<field fieldName="parsedlanguage">Sitecore.ContentSearch.ComputedFields.ParsedLanguage,Sitecore.ContentSearch</field>
<field fieldName="site">Sitecore.ContentSearch.ComputedFields.Site,Sitecore.ContentSearch</field>
<field fieldName="sizerange">Sitecore.ContentSearch.ComputedFields.FileSizeGrouping,Sitecore.ContentSearch</field>
<field fieldName="version">Sitecore.ContentSearch.ComputedFields.StoreVersionTermVector,Sitecore.ContentSearch</field>
<field fieldName="urllink">Sitecore.ContentSearch.ComputedFields.UrlLink,Sitecore.ContentSearch</field>
<field fieldName="isbucket_text">Sitecore.ContentSearch.ComputedFields.IsBucket,Sitecore.ContentSearch</field>
<field fieldName="alltemplates">Sitecore.ContentSearch.ComputedFields.AllTemplates, Sitecore.ContentSearch</field>
</fields>
EDIT #1:
Also seeing the following error:
46984 13:14:44 WARN The current item could not be processed by the field processor Sitecore.ContentSearch.VirtualFields.LatestVersionFieldProcessor.
Exception: System.Collections.Generic.KeyNotFoundException
Message: The given key was not present in the dictionary.
Source: mscorlib
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at Sitecore.ContentSearch.VirtualFields.LatestVersionFieldProcessor.TranslateFieldResult(IDictionary`2 fields, FieldNameTranslator fieldNameTranslator)
at Coveo.SearchProvider.CoveoDocumentTypeMapper.ReadDocumentFields[TElement](QueryResult p_Document, IEnumerable`1 p_FieldNames, DocumentTypeMapInfo p_DocumentTypeMapInfo, IEnumerable`1 p_VirtualFieldProcessors, TElement p_Resul
| |
I'm on a proof of concept for the same question at the moment this week.
What i'm doing:
1. no caching for personalisation
- Set Cache header for all pages ==> Hit from Cloudfront
- Set No Cache header for pages with personalisation. ==> Miss from Cloudfront
(Currently testing)
Set a Cookie with the Value of a rule
Whitelist that cookie in cloudfront
in the mvc:requestbegin pipeline. Ready the cookie value and set the matching value in sitecore.
make sure that there are not to many possibilities. Or else it will get to many misses from the cdn.
With these changes the following page will be served from cloudfront:
- Pages with no personalisation
- Pages with a specific rule.
There is a whitepaper from Nick Hill that has further information. http://blog.boro2g.co.uk/personalization-at-scale-whitepaper/
| Sitecore with personalisation and CDN such as CloudFlare
If I wanted to set up Sitecore to use CloudFlare (or an other CDN) how would I enable personalisation? Would I have to exclude any pages using personalisation from being cached by the CDN, or is there some other way to handle this?
| |
Loooong time ago I wrote a blog post describing how to handle this issue. It was for Sitecore 6.5 but I guess it should work on any other version as well.
Sitecore serves media items even with incorrect extensions
The idea is that there is an extra processor added to httpRequestBegin pipeline which checks whether the extension used in requested url is same as extension of the media item.
My solution returned 404 not found in such a scenario but you can easily change it to 301 redirect if you think it's a better idea.
| How do I manage Media library file extensions for SEO purposes?
How can I make the media library only serve up content for a files actual extension, and perform a 301 permanent redirect to the actual URL for any other extension.
For SEO reasons.
By default the media library works for multiple extensions, e.g. ashx, doc, docx etc
I can get the media library links to be generated with the right extension.
But I want search engines which have a link to an invalid extension to updated to the actual file extension.
To prevent the same file being indexed multiple time on different paths.
If it was a web page could have a canonical URL, but for media library items, need to perform a permanent redirect to the actual file desired url/extension.
| |
Explanation of what is happening
The PropertyValueReader simply reads the value of a property. Unless the property you are reading is already formatted as an ISO date, you cannot set that value on a Sitecore date field and expect that Sitecore will recognize the date. You must convert the value read from the property into an ISO date. When you write "the raw value is correct", this is what I assume you are seeing.
One solution
The IsoDateValueReader will convert a DateTime object into an ISO date. If you are using the IsoDateValueReader and you are not getting a value in the field, it is probably because the value you are reading is not a DateTime object.
You can configure the value mapping so it converts the value into an ISO date. This can be handled using the field Transformer for source value.
This field lets you specify a reader that takes the value from the source object and transforms it into a new value. This new value is then passed to the writer so it can be written to the target object.
If you are certain the value you are reading from the source object is a DateTime object, select the reader Value Readers/Common/ISO Date Value Reader for the transformer.
Another solution
An alternative approach is to make sure the date is in the proper format when it is read from the source object. This can be accomplished by creating a custom value reader using the SequentialValueReader type. This type allows you to chain multiple value readers together, where a value reader uses the value read from the previous value reader.
So you could do the following. Imagine the value read from the source object is a DateTime object.
DateTimeValueReader reads the DateTime object
IsoDateValueReader read the DateTime object and converts it to a string
In the particular case described in the question, I think this is overkill. This solution makes sense when the value you read from the source object is not already in a format that can easily be used within a mapping process. If you are reading a DateTime already, that is a format that can easily be used.
What's an example of a value that cannot easily be used? One example is a date read from an external system as a string. In the US, 10/11/2016 means 11 October 2016. In other parts of the world, it means 10 November 2016. Converting the string to a DateTime when you read the value from the external system allows you to avoid this kind of confusion.
| POCO DateTime not mapping correctly in Data Exchange Framework
I created a ValueAccessor that utilizes the PropertyValueReader. When the mapping happens for my C# DateTime to my Sitecore DateTime, the raw value is correct in Sitecore but the form field in content editor provides the equivalent of the minimum value for the Date.
Using the ISO Date Value Reader makes the raw field null along with the field in content editor.
Is there a specific reader and writer to use for DateTime mapping in the Data Exchange Framework?
Update: Question was answered below but a potential date issue has been questioned in the comments. Here is the detailed information around the scenario I am doing.
The dates originate from these json fields. I am doing a JsonConvert.DeserializeObject on the json. I get the following for the dates in the POCO:
Created Date
Updated Date
The Value Mappings are as follows:
Created Date
Updated Date
I've left the created date alone and added the ISO date reader to the updated date.
After the pipeline runs, here are the CE views of the created item:
Raw View
| |
You can use one of the modules already available for this.
https://jeffdarchuk.com/2015/10/26/sitecore-tokenmanager/
Context from what the link covers:
TokenManager preview
It’s been a while since my last blog post, that’s because I’ve been working hard on a sitecore extension. I’m in the process of working out the last bugs but here’s a preview of what it will be capable of.
Where is it used?
It is found in the Telerik editor from a rich text field.
what is a token?
A token is a small chunk of text that is dynamically replaced with something else when the rich text field is rendered.
Why use tokens?
The most basic of uses is to use tokens to store common information that will change at the same time on every page, such as a customer service phone number, or address. However I’ve devised several more use cases that the TokenManager will be able to accomplish
| Content variable in sitecore fields
I got a scenario where i want to add variable in content say multiline text. This variable is kind of link which will be populated based on user profile. Having said that i m looking for best recommended approach so that content author or for that reason any developer in future should not delete or overlooked this variable and publish it without any checks. I may add validation for field and provide help text to deal with this. Is there any better approach to tackle this?
| |
I wrote the article that you linked to in your question, and my main motivation for writing it was the (current) lack of documentation around this new feature.
Does this work if the data sources are in a different workflow than the page?
The answer is no. The workflow command executed on the datasource items is the exact same one as the "parent" item. There is a check in code that checks if the datasource item has a workflow attached to it, and if so if it has a workflow command with the exact same ID as the original. If you have 2 different workflows, even though the command names may match, the IDs will not.
If your items are in the same workflow but a different workflow state, then it will work.
What could be done to move everything on the currently visible version of a page, to move it to the final state of the workflow for each data source on the page & the page version itself, regardless of workflow type.
If you're using Sitecore 8.2, then provide a new implementation of the Workflow With Datasource command with whatever logic you need:
<commands>
<command name="webedit:workflowwithdatasourceitems" type="Sitecore.ExperienceEditor.WebEdit.Commands.WorkflowWithDatasourceItems, Sitecore.ExperienceEditor" />
</commands>
If you're on an earlier version of Sitecore and want to implement this functionality then my original blog post has links to articles which provide this information. You could take a look at this implementation on Workflow Bundling by Jamie Scott and change the logic in the "bundling workflow command" to move the items to the final workflow stage. You would obviously want to check that the parent item is also being moved to the final workflow stage before doing the same with the datasources.
This should only approve the version of the page previewing for a particular date, and the referenced data sources as used by renderings on that version of the page.
I don't think any of the modules or the code in Sitecore 8.2 will account for Preview date in the workflow approval. You'll need to do something custom, I'm not even sure the Preview date is passed as a parameter to the workflow either. I'm not aware of being able to approve from the Experience Editor in Preview Mode either, which will only show you a preview of the page of items that have been approved (since if the item/datasource has not been approved, it will not be published at that date)
| Bulk workflow approval
A content editor is on the experience editor, they have previewed the page, they are happy with the page, they want it to approve the version of the page they are previewing, so it is ready to go live when scheduled.
The page has lots of renderings with datasources.
For each data source, they have to approve it individually.
The content author just wants to approve the whole page, without having to approve each component.
I see 8.2 includes some features to keep datasources in sync with the parent page - "WebEdit.AffectWorkflowForDatasourceItems". (as well as to be able to approve individual data sources, and see on how many other pages they are used)
Does this work if the data sources are in a different workflow than the page?
https://jammykam.wordpress.com/2016/09/05/sitecore-8-2-managing-datasource-components-and-workflow-from-the-experience-editor/
Is there any documentation on this?
What could be done to move everything on the currently visible version of a page, to move it to the final state of the workflow for each data source on the page & the page version itself, regardless of workflow type.
This should only approve the version of the page previewing for a particular date, and the referenced data sources as used by renderings on that version of the page.
| |
There are a number of known issues with the Sitecore Multilist with Search field type especially with Sitecore 8.
Sitecore provide a workaround with a new Field Type called the AdvancedSearchList. You can download it here:
https://kb.sitecore.net/articles/372032
| "Multilist with Search" Field Does Not Return Search Results With Two Or More Items Selected
This is for Sitecore 8.1 Update 3, using Solr 5.5.
It appears that in a Multilist with Search Field, if the field has two or more items currently selected (it does not matter whether the item has been saved or not), the search request that is sent ends up generating an improper Solr query that causes no results to be returned.
For example, here is a query that is generated when trying to perform a search on the field:
((-_group:(8ef752a6793c446d849aa5a0b455457a) AND -_group:(da0d9a141798455da6a66994742e48c8)) AND ((((_content:(roger) OR _name:(roger) OR _displayname:(roger)) AND _path:(79e09ae03e614e069349b05ca2aada81)) AND _template:(8904e4c272604056b65ddb881a06de95)) AND _latestversion:(True)))
It's the first grouping that is attempting to exclude already selected items within the field that causes this search to fail. We can manually modify the query to "fix" it and return what we want:
First we can negate the grouping
-((-_group:(8ef752a6793c446d849aa5a0b455457a) AND -_group:(da0d9a141798455da6a66994742e48c8)) AND ((((_content:(roger) OR _name:(roger) OR _displayname:(roger)) AND _path:(79e09ae03e614e069349b05ca2aada81)) AND _template:(8904e4c272604056b65ddb881a06de95)) AND _latestversion:(True)))
Or we can arrange the grouping to be "correct":
(
-_group:(beff3037e34941e4ae4608d7524118df)
AND -_group:(a5b7d1a6f38148189f0f88aeb84162fc)
AND -_group:(26e8bb2e727746c89c2577dda04afa54)
AND -_group:(c4ff9b4b053d4e749758ec1261f35124)
AND
((((_content:(roger) OR _name:(roger) OR _displayname:(roger)) AND _path:(79e09ae03e614e069349b05ca2aada81)) AND _template:(8904e4c272604056b65ddb881a06de95)) AND _latestversion:(True))
)
Essentially, Sitecore is incorrectly grouping the "_group" fields together so this problem will only show up when one more than one item is selected.
I've fixed this issue for now by modifying the client side javascript to no longer send the selected id's to the search handler:
\sitecore\shell\Controls\BucketList\BucketList.js, line 140
self.getSelectedIdsFilter = function (){
return "";
//return [].slice.call($(self.clientId + '_selected').options, 0)
// .map(function (option) { return "&-id=" + option.value })
// .join('');
};
Doing the above modification to the client-side JS allows me to correctly search on a Multilist with Search field. However, I consider it a hack and was wondering if anyone had a "proper" solution to this problem? I looked into overriding the default search handler, but the "problem code" that is responsible for taking the search request and parsing it into a solr query seemed especially difficult to replace/modify due to how it was architected.
.
| |
I'm not sure what version of Sitecore you are using but there is a module that supports uploading videos to show in the Page Editor (now Experience Editor), it says it only supports up to 6.5 though so I'm unsure if it will work for later versions of Sitecore.
The module extends the inbuilt Help Template that ships with Sitecore and adds a new field called 'Help Videos'.
https://marketplace.sitecore.net/Modules/P/Page_Editor_Help.aspx?sc_lang=en
It might give you some ideas though on how to approach this. Other than this module I think you would need to build something custom to do this.
Where do you want to show this extra info - Experience Editor or Content Editor?
It will probably be easier to do this in Experience Editor.
You could do something like this to add a custom button and then link that to a modal popup that passes the component id and loads in a video/text/image etc with additional help for that component perhaps:
http://www.nonlinearcreations.com/Digital/how-we-think/articles/2016/05/How-to-customize-the-Sitecore-Experience-Editor.aspx
| Content Author /editor help view with gif animation in sitecore cms
Is there module in sitecore market place where help text is extended to include any gif image or animation image or screenshot to educate content author about specific field behavior or content behavior?
| |
Add a your IP-addresses to Sitecore.Analytics.ExcludeRobots.config. This method does allow the use of single IP addresses, ranges and subnets. Those IP addresses will not be tracked anymore. However, I'm not sure if these settings are applied to existing records in the XDB:
Supported values and formates:
IP address, e.g. 10.2.3.4;
IP range, e.g. 10.1.2.3 - 10.1.2.30;
Subnet, e.g. 10.2.3.*
If you want to remove the interactions based on those IP-addresses from the XDB, please note that you need to write some custom logic. Anders Laub wrote a nice blogpost on this subject: https://laubplusco.net/sitecore-dms-visits-specific-ip-addresses/
The IP-address is stored in the Interactions table (fieldname: IP), but the IP-address stored as a binary object.
*please note: all IP addresses might be stored as a hash in the XDB
about that.
edit:
confirmation on the hashed IP addresses by @Matthias Gmur from the Sitecore slack channel:
<!-- ANALYTICS - REDACT IP ADDRESS
Determines if the IP addresses that initiated the interaction are redacted when writing to the database.
Note: IP addresses are hashed by default. Setting this value to true removes your ability to determine the actual IP address that initiated the interaction.
When the setting is enabled, the database stores an empty IP address (0.0.0.0) instead of the actual IP address.
Default value: false
-->
<setting name="Analytics.RedactIpAddress" value="false" />
| Filtering xDB reports by IP address
Repost from Stack overflow
I have analytics report for my website.
I hadn't configured robot detection service while setting up solution.
I am not using Sitecore GeoIP service. I would like to filter my existing analytics report to exclude our own traffic.
Can we do that on existing report? Does xDB store IP addresses information for visits by default, if yes; is there any way to extract that information to create custom report
| |
I would say it's of high importance. Depending on the event queue interval, if all your CD's share the same core database, it can cause index triggering to be missed. Typical event queue checks are two minutes apart so you can see how easy it is to be off 1 minute in either direction from a baseline. So says Sitecore:
"Synchronize all servers to a single reliable time source, for example, by means of the Network Time Protocol (NTP). The aggregation of engagement automation states depends on the system time and changing this can lead to incorrect aggregation results or loss of data." Configure a content delivery server
EDIT
The default event queue check interval is only 2 seconds (not 2 minutes). With this in mind, I would up the recommendation from high importance to critical importance.
| Does the Time and Timezone between all CD's and CM's need to be the same?
In a distributed environment where the solution has multiple CD's and at least one CM (if not more), as well as other roles like processing servers, how important is the time and timezone synchronicity?
An example:
CD1: EDT
CD2: UTC
Processing Server: PDT, 1 minute behind
CM: MDT, 1 minute ahead.
| |
I found out that field is populated with UTC regardless of what the server time zone is.
| Event Queue Created Field (time stamp)
I noticed today after I published that the times being put into the created field of the event queue happened to be dates from the future. All the servers CM, CD, DB, QA are PST. I set the time zone value to
<setting name="ServerTimeZone" value="400" />
(https://msdn.microsoft.com/en-us/library/gg154758.aspx).
This could be related to my CD indexes not updating correctly. Any thoughts on making the time match with the server? I adjusted the timezone value in the web.config and republished and it did not make a difference.
| |
One key field required for Coveo index was not filled with value in sitecore. Due to this, when coveo indexed, it was unable to form the item url. On analysis, we found this out and reached out to the content author to update the item field values.
We did reindex again and coveo was able to form the correct item url. Thanks everyone for helping.
| Coveo index does not update Item
I am facing an issue with Coveo search. In website's search results page, when I click a search result, it is throwing me a 404 error. In CES indexcontent, if I search same item and click on the Uri, it throws a 404 in CES as well. So I tried updated a field of the item, Coveo reindexed the item. In CES, I can see that item details updated. When I click uri in CES, it is still throwing a 404. Can you please help me to fix this issue.
Thanks.
| |
It seems like your webservers operate behind a load balancer/proxy, SSL certificate is installed only on the load balancer/proxy and communication between load balancer/proxy and Sitecore is plain HTTP.
Client -> HTTPS -> Load Balancer/proxy -> ALWAYS http -> server
I am afraid Sitecore does not completely support this configuration. As far as I remember, some part of Sitecore does use context URL as a basis of generating/modifying URLs. Such configuration was not tested and is not officially supported. In this case, you may experience the following issues:
You will not be able to open a number of the Sitecore dialogs due to their iframe src value set to http://... .
Always include a server URL setting that cannot be used since it will generate the wrong URL.
So, full SSL appears to be a safe option for now.
Cliend -> HTTPS -> Proxy -> HTTPS -> Sitecore
You have to do this in IIS directly.
Following article may be helpful:
http://weblogs.asp.net/scottgu/archive/2007/04/06/tip-trick-enabling-ssl-on-iis7-using-self-signed-certificates.aspx
https://doc.sitecore.net/sitecore_experience_platform/setting_up__maintaining/security_hardening/configuring/increase_login_security
| Failed to execute 'send' on XMLHttprequest' - Sitecore
We are using sitecore 7.2 with Coveo for sitecore(3.0). When I try to edit a rich text field for an item using EditHtml, I am getting this message below and not able to accept the changes.
Failed to execute 'send' on XMLHttprequest': Failed to load 'https://www.cm.instancename.com/sitecore/shell/~/xaml/sitecore.shell.applications.contenteditor.Dialogs.EditHtml.aspx?hdl=someGuid.
But when i try make changes using ShowEditor and use Design, the changes I made are accepted.
Can anyone help me to understand why this issue is occurring.
| |
According to the output of rs.conf(), you currently have three replica set members: two of them hosted on 42.159.225.222, and another one on 42.159.226.69.
You need to make sure that the Sitecore application has direct access to both of these IP addresses via the ports specified. Even though you only have 42.159.225.222 in your connection string, the MongoDB driver may attempt to connect to any server available in the replica set.
| Sitecore xDB cannot connect to a MongoDB replica set
On our Sitecore 8 production instance, we are getting the below error messages. This client site we have recently inherited from another partner and on preliminary investigation from our end, we see they have implemented replica sets for MongoDB
<add name="analytics" connectionString="mongodb://{IP}:27017,{IP}:27018/sitecore_analytics?replicaset=SiteCoreDMS" />
Which looks correct. These are the errors in Sitecore logs:
7056 04:22:01 ERROR Cannot create tracker.
Exception: System.IO.IOException
Message: Unable to read data from the transport connection: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
Source: System
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at MongoDB.Bson.IO.ByteBufferFactory.LoadFrom(Stream stream)
at MongoDB.Driver.Internal.MongoConnection.ReceiveMessage[TDocument](BsonBinaryReaderSettings readerSettings, IBsonSerializer serializer, IBsonSerializationOptions serializationOptions)
at MongoDB.Driver.Operations.QueryOperation`1.GetFirstBatch(IConnectionProvider connectionProvider)
at MongoDB.Driver.Operations.QueryOperation`1.<Execute>d__0.MoveNext()
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
at Sitecore.Analytics.Data.DataAccess.MongoDb.MongoDbCollection.<>c__DisplayClass29`1.<FindOneAs>b__28()
at Sitecore.Analytics.Data.DataAccess.MongoDb.MongoDbCollection.Execute(Action action, ExceptionBehavior exceptionBehavior)
at Sitecore.Analytics.Data.DataAccess.MongoDb.MongoDbCollection.FindOneAs[TDocument](IMongoQuery query, ExceptionBehavior exceptionBehavior)
at Sitecore.Analytics.Data.DataAccess.MongoDb.MongoDbContactStorage.LoadContactIdentifier(ID id)
at Sitecore.Analytics.Data.DataAccess.MongoDb.MongoDbDataAdapterProvider.TryLoadContact(ID id, IContactFactory factory, LeaseOwner leaseOwner, TimeSpan leaseDuration)
at Sitecore.Analytics.Data.ContactRepository.TryLoadContact(Guid id, LeaseOwner leaseOwner, TimeSpan leaseDuration)
at Sitecore.Analytics.Tracking.ContactManager.TryLoadContact(Guid contactId, Int32 lockDurationMinutes)
at Sitecore.Analytics.Pipelines.EnsureSessionContext.LoadContact.Process(InitializeTrackerArgs args)
at (Object , Object[] )
at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
at Sitecore.Analytics.DefaultTracker.EnsureSessionContext()
at Sitecore.Analytics.Pipelines.CreateTracker.GetTracker.Process(CreateTrackerArgs args)
at (Object , Object[] )
at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
at Sitecore.Analytics.Tracker.Initialize()
Nested Exception
Exception: System.Net.Sockets.SocketException
Message: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
Source: System
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
7056 04:22:01 ERROR Cannot start analytics.
Exception: System.InvalidOperationException
Message: Tracker.Current is not initialized
Source: Sitecore.Analytics
at Sitecore.Analytics.Pipelines.StartAnalytics.StartTracking.Process(PipelineArgs args)
at (Object , Object[] )
at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
at Sitecore.Analytics.Pipelines.HttpRequest.StartAnalytics.Process(RenderLayoutArgs args)
--------------------------------------------
ERROR Exception when executing agent aggregation/automationRangeManager
Exception: System.IO.IOException
Message: Unable to read data from the transport connection: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
Source: System
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at MongoDB.Bson.IO.ByteBufferFactory.LoadFrom(Stream stream)
at MongoDB.Driver.Internal.MongoConnection.ReceiveMessage[TDocument](BsonBinaryReaderSettings readerSettings, IBsonSerializer serializer, IBsonSerializationOptions serializationOptions)
at MongoDB.Driver.Operations.QueryOperation`1.GetFirstBatch(IConnectionProvider connectionProvider)
at MongoDB.Driver.Operations.QueryOperation`1.<Execute>d__0.MoveNext()
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
at Sitecore.Analytics.Automation.Data.MongoDbAutomationProvider.GetEarliestAutomationTransitionTimestamp()
at Sitecore.Analytics.Automation.Aggregation.Data.Processing.RangeManagerAgent.Execute()
at Sitecore.Analytics.Core.BackgroundService.Run()
Nested Exception
Exception: System.Net.Sockets.SocketException
Message: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
Source: System
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
Attaching output of rs.status()
SiteCoreDMS:SECONDARY> rs.status()
{
"set" : "SiteCoreDMS",
"date" : ISODate("2016-10-12T06:49:33Z"),
"myState" : 2,
"syncingTo" : "42.159.226.69:27017",
"members" : [
{
"_id" : 0,
"name" : "42.159.225.222:27017",
"health" : 1,
"state" : 2,
"stateStr" : "SECONDARY",
"uptime" : 2474004,
"optime" : Timestamp(1476254930, 1),
"optimeDate" : ISODate("2016-10-12T06:48:50Z"),
"lastHeartbeat" : ISODate("2016-10-12T06:49:32Z"),
"lastHeartbeatRecv" : ISODate("2016-10-12T06:49:31Z"),
"pingMs" : 0,
"syncingTo" : "42.159.226.69:27017"
},
{
"_id" : 1,
"name" : "42.159.225.222:27018",
"health" : 1,
"state" : 2,
"stateStr" : "SECONDARY",
"uptime" : 2474006,
"optime" : Timestamp(1476254930, 1),
"optimeDate" : ISODate("2016-10-12T06:48:50Z"),
"self" : true
},
{
"_id" : 2,
"name" : "42.159.226.69:27017",
"health" : 1,
"state" : 1,
"stateStr" : "PRIMARY",
"uptime" : 2474002,
"optime" : Timestamp(1476254930, 1),
"optimeDate" : ISODate("2016-10-12T06:48:50Z"),
"lastHeartbeat" : ISODate("2016-10-12T06:49:32Z"),
"lastHeartbeatRecv" : ISODate("2016-10-12T06:49:33Z"),
"pingMs" : 2,
"electionTime" : Timestamp(1474819533, 1),
"electionDate" : ISODate("2016-09-25T16:05:33Z")
}
],
"ok" : 1
}
SiteCoreDMS:SECONDARY>
| |
Is not a good practice to install in Sitecore folder your custom code. In Sitecore Modules are installed modules like WFFM, EXM , etc.
Also if you override some custom functionality is recommended to add into a **\sitecore\shell\Override** folder.
You need to have a separation between your code and Sitecore code.
Normally css, js you add into an Assets folder in root folder.
Views you need add into Areas folder if you use MVC Areas or into Views folder if you not use Areas.
Layouts, sublayouts you add into Layouts folder but is recommended to have subfolders for different type of sublayouts.
| Where should I place my Sitecore Custom Module file assets?
When developing sitecore modules, is it recommended to install the different custom files in the sitecore folder or sitecore modules folder? Please see below screenshot:
Actually, I am installing most of my files (aspx, xml, css, js) in the sitecore modules folder.
I know that the Sitecore folder is mainly specific to the Sitecore CMS but can I add my custom files in this folder?
| |
As you already noticed Experience Editor utilizes SPEAK, but Content Editor "is not there yet".
I am not sure whether you can have single code to handle both locations.
I would go partially SPEAK and Sheer but it depends what you want to achieve.
In Experience Editor you can extend front-end pipeline written in SPEAK
(/sitecore/client/Applications/ExperienceEditor/Pipelines/Save):
This how you normally ask user in Experience Editor via SPEAK to confirm something. (This is an example of confirm before you navigate somewhere else and you have unsaved changes)
experienceEditor.Dialogs.confirm(TranslationUtil.translateText(TranslationUtil.keys.The_item_has_been_modified), function (isOk) {
if (!isOk) {
if (onCloseCallback) {
return onCloseCallback(isOk);
}
return null;
}
ExperienceEditorContext.instance.disableRedirection = disableRedirection;
Sitecore.Commands.Save.execute(ExperienceEditorContext.instance);
experienceEditor.Common.addOneTimeEvent(function () {
return ExperienceEditorContext.isContentSaved;
}, function () {
if (onCloseCallback) {
return onCloseCallback(isOk);
}
}, 100, this);
return null;
});
Regarding Sheer, I suppose you already know how to do it.
If you have any additional questions, ask I will try to answer.
| How do I trigger Sitecore SPEAK alerts programatically?
So I'm trying to extend a pipeline (item:saved), and I need an alert to pop up with the options Yes, No and Cancel.
Before SPEAK came along, I would just use some Sheer functionality, like SheerResponse.Alert(), but I have been led to believe Sheer is not supported in the Experience Editor.
What's the proper way of creating this type of alert from codebehind, making sure it works in both Content Editor as well as Experience Editor? I'm using the initial release of Sitecore SXP 8.2
| |
With the working examples from K. Heye and christian-hagelid, I realized that I had an assumption, and had created the Field Search Type in the Core database, where all the items lies as well.
However, it works by creating it directly in the master database.
| How do I add a new search filter to use with my Item Buckets?
I want to add a search filter which can be used for building search queries in Sitecore as per described in the documentation. The search filter should filter by inherited templates.
I have followed the description here:
In the content tree, navigate to
/sitecore/system/Settings/Buckets/Search Types. Sitecore recommends
that you add new search filters in the User Defined folder.
Select the User Defined folder, and on the Home tab, in the Insert
group click Field Search Type. Give the new search type an
appropriate name. This is the name that users enter in the search
box to apply the filter. For example: if you name the search type
Date, the user must type in Date: in the search box to apply the
filter. The name is case sensitive.
In the new search type item, in the Search Type section, in the
Control Type field select the type of control that is most
appropriate for your search.
In the Display Text field, enter an appropriate text and ensure that
the wording is consistent with all the other search filters. This
text is displayed in the drop-down menu when users browse the search
filters.
If you want to apply a custom syntax to the Control Type field to
create specific output., enter this in the Web Method field. For
example, if the Control Type field is a calendar, the Web Method
field can make a request to a web service to tell Sitecore to
display a calendar control that only allows you to select a date
from the last 2 calendar years.
However, the filter doesn't appear when I try to use it:
I can see an XHR request to https://url/sitecore/shell/Applications/Buckets/ItemBucket.asmx/GetAllSearchFilters
Which returns all the filters in a JSON format, where mine is not included. The full response can be posted per request.
The data entered in the Field Type Search item is as follows:
Icon: /sitecore/shell/Applications/Buckets/images/text.png
Name: inherited
Field: _templatesimplemented
Control Type: Auto Suggest
Control Type Parameter:
Display Text: Search by Base Template
Web Method: ItemBucket.asmx/GetTemplates
Client Side Hook: id
The question is, what am I missing, to configure a Search Filter?
| |
I have seen the same behavior - what I concluded out of some tests is that WFFM is taking the "title" of the field in which the form was first requested. After that, it will stay in that language until the site restarts. WFFM caches some stuff it should not, and I assume this is one of those. We've had other issues with translations in WFFM due to the same phenomenon (in error reporting).
So, as that actually could not really be fixed in our version and we could not wait for a patch, we used the fieldID property instead like this:
var fieldItem = Sitecore.Context.Database.GetItem(new ID(field.FieldID));
// use fieldItem.Name
We continued with the fieldItem.Name which is the actual name of the field item in Sitecore - this will not change when switching languages.
| Web Forms for Marketers and language
We are using the WFFM module with a custom save action.
Now, running through the AdaptedResultList we can access the fields with data. In this field set there is a property called FieldName. In my developer environment this follows the language the form is submitted in. But in the production environment it takes the language of the last updated version of the form.
What should I do to get the form name in a language-consistent way? The overall problem is that the language of FieldName changes in an unpredictable way.
| |
I ended up resolving this by adding Read and Write permissions for my role on the /sitecore/templates/System/Layout/Rendering Parameters/Standard Rendering Parameters/__Standard Values item.
| What Role or Security Permission is required to edit the Placeholder and Datasource fields of a component?
We are setting up permission for users of our site, and have assigned our users to the roles sitecore\Sitecore Client Authoring and sitecore\Sitecore Client Designing.
However this does not allow the user to edit the Placeholder and Data Source fields of the component as you can see they are greyed out.
What changes do I need to make to make these fields editable?
Update
Full User Roles
sitecore\Sitecore Client Users
sitecore\Author
sitecore\Sitecore Client Social Authoring
sitecore\Analytics Testing
sitecore\Analytics Personalization
sitecore\Sitecore Client Authoring
sitecore\Sitecore Client Designing
| |
This is how you could use the using statement inside Powershell
function Using-Object
{
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)]
[AllowEmptyString()]
[AllowEmptyCollection()]
[AllowNull()]
[object]
$InputObject,
[Parameter(Mandatory = $true)]
[scriptblock]
$ScriptBlock
)
try
{
.$ScriptBlock
}
finally
{
if ($null -ne $InputObject -and $InputObject -is [System.IDisposable])
{
$InputObject.Dispose()
}
}
}
Using-Object ($streamWriter = New-Object System.IO.StreamWriter("$SitecoreDataFolder\newfile.txt")) {
$streamWriter.WriteLine('Line written inside Using block.')
$streamWriter
}
This is how you could disable events in Sitecore
Using-Object ($ed = New-Object Sitecore.Data.Events.EventDisabler) {
# "Disabled"
}
Notice that a script execution triggers some events in the background (you can observe index rebuild jobs even if you run empty script).
Once you wrap something with using statement, everything what is inside should work in 'switched context', with all events disabled.
I tested it and number of items added to indexing queue is different.
| Can you run Sitecore Powershell without triggering Sitecore events?
I want to write a script which could potentially clean up a load of unused assets, but I would like it not to trigger events (index rebuilds etc).
Is there a way to say "do this silently" in a Powershell script?
| |
I'm assuming that since you've linked the Scaling Guide that you're using VMs in Azure. If the site leans heavily towards consumption-oriented, I would put a number of content delivery servers behind a load balancer in Azure and use the Azure CDN to distribute content worldwide. Make sure that you have the appropriate caching turned on in Sitecore as well and performance/load test your site extensively.
You can find more details around Azure CDN here: https://azure.microsoft.com/en-us/documentation/articles/cdn-overview/
| best practices in scaling sitecore
What are the best best practices on scaling sitecore 8 worldwide on Azure?
https://sdn.sitecore.net/upload/sitecore7/70/scaling_guide_sc70_a4.pdf
Thanks
Bart
| |
Yes it will. There are no field types that ship out of the box, that gives you that functionality.
If you are going to explore making your own customisation for this, I would suggest the Multilist with Search field is a good place to start.
A good place to start could be: Have a Field Day With Custom Sitecore Fields
| Multilist Field where users can add new values
I'm looking to replicate the SharePoint taxonomy functionality in Sitecore - there is the ability in SharePoint to type a new value in a multivalue field and it would automatically create the new taxonomy value on save. Is there a good way to replicate this functionality in Sitecore? Will this require a custom field?
| |
Your problem lays in casting to MediaItem object, you should use ImageField instead.
Use this:
Sitecore.Data.Fields.ImageField myImageItem = (Sitecore.Data.Fields.ImageField)Sitecore.Context.Item.Fields["MyImageField"];
then:
Sitecore.Resources.Media.MediaManager.GetMediaUrl(myImageItem.MediaItem);
| Media Items all return 404
On sitecore 8.2 inital version.
I am doing the following:
var myImageItem = (MediaItem) Sitecore.Context.Item.Fields["MyImageField"].Item;
if (myImageItem != null)
{
viewModel.ImageAlt = myImageItem.Alt;
var url = MediaManager.GetMediaUrl(myImageItem);
if (!string.IsNullOrWhiteSpace(url))
{
viewModel.ImageUrl = url;
}
}
The url however is always returning a 404 item not found. The logs show the following:
14008 13:40:38 WARN Request is redirected to document not found page. Requested url: /media/94EF96BAA8214F6D9262C9FCB2137F2C.ashx, User: sitecore\admin, Website: MyWebsite
15432 13:40:58 WARN Request is redirected to document not found page. Requested url: /media/94EF96BAA8214F6D9262C9FCB2137F2C.ashx, User: sitecore\admin, Website: MyWebsite
I have turned off mediarequest extension default of .ashx by following instructions on: https://community.sitecore.net/technical_blogs/b/sitecorejohn_blog/posts/sitecore-idiosyncrasies-media-urls
Even with this turned off .ashx media urls still being returned.
| |
I think your Lucene index needs a trim. Especially if it hasn't been this slow always, but just gradually started degrading little by little.
Since it's not a production server, my first recommendation would be to issue a full Index Rebuild and let it run for however long it needs. If you see a really slow rebuild speed, your problem lies elsewhere unfortunately.
Also: <setting name="ContentSearch.MaxMergeMB" value="512" /> this setting seems very low to me. I've seen Lucene happily use up 6-8 GB of memory for around 125.000 items. Increasing this to 4 or even 8 GB would be my next visiting point.
| Performance issue when inserting item to Lucene index
I have a Sitecore 8 instance with a bucket with aprox. 150K items, and like 200K total.
Publishing is working very slow. I mean, really slow, sometimes 5 items per second. I've stripped all code we had on the pipeline and the issue persists.
I believe this may be related with the insertion of items during publish into the Lucene index. I've tested a manual insertion of an item into the index and I can see it takes a long time, up to two or three seconds sometimes:
var contentSearchIndex = ContentSearchManager.GetIndex("sitecore_master_index");
contentSearchIndex.Refresh((SitecoreIndexableItem)scItem);
I've tried performance tuning the index with this article, but no luck:
https://community.sitecore.net/technical_blogs/b/sitecore_7_development_team/posts/sitecore-7-performance-tuning-part-2
Is there a way of having a fast indexing with a relatively large amount of items? Is there something else that comes to mind that I could try?
Here's a copy of my index config file:
https://drive.google.com/file/d/0B2fC8NS-H2h4TG1lcG9CRUlfN3M/view?usp=sharing
| |
Ignoring my NuGet approach above; the only obvious option you have available is a lesser-known feature in Sitecore packages called "poststep". Essentially you can instruct Sitecore to execute some code, after your package has installed.
Sean Holmesby describes it here: Sitecore Upgrade Post Step Scripts
While the blog post mentions this in regards to .update packages, this works for all Sitecore packages.
Inside your package archive, you'll find the sc_poststep.txt file.
Enter a fully qualified Namespace, Assembly here (I think you can add multiple) and implement the transformation code in a class. Your class needs to implement the IPostStep interface.
It's clunky, but it's the only option I know of that could achieve what you want.
| Update web.config configuration in a Sitecore module
I am working on creating a module that I was hoping to have be installed right thru the Sitecore shell. The deeper I go, the more I realize I will need to make manual changes to the web.config to get this to work. For example this snippet would be needed:
<handlers>
<add name="Nancy" verb="*" type="Nancy.Hosting.Aspnet.NancyHttpRequestHandler" path="/services/*" />
</handlers>
The main reason I wanted this as a separate module and not something like a NuGet package is so it can be installed very surgically on target boxes, rather than installing it for the entire codebase and introducing this functionality to all servers including delivery servers (which I don't necessarily want). I could ultimately abandon my current approach and make this into a web service but holding off on that just yet.
TL;DR: is there any way to include any configuration higher than configuration/sitecore in an install package? Other suggestions welcome. Thanks!
| |
For this menu option to show the user must have read access to the /sitecore/content/Applications/WebEdit/Common Field Buttons/Edit related item item in the Core database or be a member of the sitecore\Sitecore Client Designing Role.
| How can I make the Edit the related item menu show in Experience Editor?
I am setting permissions for content editors of a site. The user in question is a member of the following roles:
sitecore\Sitecore Client Users
sitecore\Author
sitecore\Sitecore Client Social Authoring
sitecore\Analytics Testing
sitecore\Analytics Personalization
sitecore\Sitecore Client Authoring
sitecore\Sitecore Client Designing
When this user logs in to Experience Editor and clicks the More option of a component's properties, the Edit the related item option is not shown.
See the screenshot.
However, if I log in with a user that has the Administrator checkbox set on their "User Profile" then this option is visible.
What security setting should I change to make the Edit the related item visible for a non-administrator user?
| |
Nonlinear Digital did a little rule of thumb for 7.5, I guess it still holds true(ish) now - they said:
"As a basic rule of thumb, Sitecore calculates diskspace sizing projections using 5KB per interaction and 2.5KB per identified contact and these two items make up 80% of the diskspace"
So if an interaction is essentially a user session you should be able to roughly calculate usage. For example for a (small) site we're launching we roughly figured the following:
Google Analytics said it had 12,916 visits per month
With 9,620 unique users
So:
5kB x 12,916 = 65MB per month (assuming each visit is an "interaction")
+
2.5kB x 9,620 = 25MB per month (assuming each user gets stored as a new "contact")
= 90MB
* 20%
= 109 MB
So around 100MB per month.
This is very finger in the air calculation and I've not validated the figures that NonLinear talk about but it is a good start for you.
References
http://www.nonlinearcreations.com/Digital/how-we-think/whitepapers/Whitepaper-Planning-your-Sitecore-xDB-infrastructure.aspx
| Sizing MongoDB Servers for xDB
Is there guidance on sizing the Mongo DB servers when running xDB on premises? I've found some guidance on sizing MongoDB for session state (link) but can't find anything on the analytics side.
To be clear, I'm not looking for "you need XXGB of RAM and XXXGB of disk" but more of what variable go into what sort of formula for sizing.
| |
The best practice is to have everything in Sitecore.
User profile fields are stored in Core db.
You can define "database" in your field source.
You will define source of your field like :
databasename=master&datasource=/sitecore/content/cars
See also: https://sitecorecontextitem.wordpress.com/2014/02/10/working-with-custom-user-profile-fields-in-sitecore/
| Best practices for user profile one-to-many relationships with attributes
In multiple Sitecore sites I have implemented a separate SQL database for storing information related to the user profile where one-to-many relationships where concerned. One such example is:
UserA has a BMW and Ford
UserB has a Mercedes, Volvo and Toyota.
These values might appear in the user profile area where the user can add/delete.
Is there a best practice for this type of user profile information that is self-contained in Sitecore that I have overlooked?
| |
One option is to use NSSM - the Non-Sucking Service Manager.
It basically has the ability to install any .exe as a service in Windows.
Download it and put it anywhere in your system PATH. Then open up a command prompt, navigate to your SOLR-5.0.0 (as appropriate) directory and issue this command:
nssm install solr5
This prompts you to configure your service and get things going.
Reference: How to Run Solr5 as a Service on Windows
| How to get Solr to run as a service?
I have a Sitecore 8.1 instance and we are using Solr 4.10 for search. I followed the Solr installation guide found here - https://sitecore-community.github.io/docs/search/solr/fast-track-solr-for-lazy-developers/. The instructions there show you how to start the Solr instance manually. However, I was wondering how to set up Solr as a Windows service so that it runs automatically.
Thanks,
Corey
| |
For a 6.5 update 1 using DMS you are unfortunately out of luck.
In 6.5, you cannot load balance the CM servers (you dont need it but just stated for completeness)
In 6.5 versions before update 4 you cannot use a shared session for DMS.
You cannot do much else than recheck the loadbalancer configuration for stickyness.
| Session State options for Sitecore 6.5 Update-1 w/DMS?
Our problem is that periodically one of the CD servers CPU soars to 100% and IIS needs to be restarted to get it to calm down. While investigating the logs we found the following two stacktraces:
ManagedPoolThread #97 15:45:40 ERROR Error committing data row Pages.ef42d298-9973-4c98-9457-1ad4c4761749 : Concurrency violation: the UpdateCommand affected 0 of the expected 1 records.
ManagedPoolThread #97 15:45:40 WARN Errors while committing data. Retrying...
System.Exception: Error committing datatable: Pages ---> System.Exception: Commit error: Concurrency violation: the UpdateCommand affected 0 of the expected 1 records.
at Sitecore.Analytics.Data.DataAccess.DataAdapters.Sql.SqlDataAdapterProvider.Update(DataTable table, UpdateOptions options)
at Sitecore.Analytics.Data.DataAccess.DataAdapters.Sql.SqlDataAdapterProvider.Update(DataTable table)
at Sitecore.Analytics.Data.DataAccess.DataAdapters.Sql.SqlDataAdapterProvider.Update(DataSet dataSet)
--- End of inner exception stack trace ---
at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
at Sitecore.Pipelines.CorePipeline.Run(String pipelineName, PipelineArgs args, String pipelineDomain, Boolean failIfNotExists)
at Sitecore.Pipelines.CorePipeline.Run(String pipelineName, PipelineArgs args, String pipelineDomain)
at Sitecore.Pipelines.CorePipeline.Run(String pipelineName, PipelineArgs args)
at Sitecore.Analytics.Pipelines.CommitDataSet.CommitDataSetPipeline.Run(CommitDataSetArgs args)
at Sitecore.Analytics.Data.TrackerChanges.__AW_Flush()
For this particular issue we found this knowledge base article (Concurrency violation issues in DMS) which indicated that perhaps a visitor had bounced from one of the load-balanced CDs to the other. The load balancer is configured for sticky sessions but the visitor could have transferred for several reasons like one of the cookies expired, one of the CDs was being taken out of the pool temporarily, etc. Since our scenario lined up with "Scenario 1" in the documentation (Load balancer with 2 or more CDs, and InProc Session State mode), our solution could be to configure a SQLServer based session state.
Another error we saw at the same time on the same CD was one that is pretty familiar when the CDs aren't configured properly or the load balancer isn't using sticky sessions:
34320 21:16:21 ERROR Application error.
Exception: System.Web.HttpException
Message: Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.
See http://go.microsoft.com/fwlink/?LinkID=314055 for more information.
Source: System.Web
at System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError)
at System.Web.UI.ViewStateException.ThrowMacValidationError(Exception inner, String persistedState)
at System.Web.UI.ObjectStateFormatter.Deserialize(String inputString, Purpose purpose)
at System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter2.Deserialize(String serializedState, Purpose purpose)
at System.Web.UI.Util.DeserializeWithAssert(IStateFormatter2 formatter, String serializedState, Purpose purpose)
at System.Web.UI.HiddenFieldPageStatePersister.Load()
at System.Web.UI.Page.LoadPageStateFromPersistenceMedium()
at System.Web.UI.Page.LoadAllState()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at ASP._layouts_flm_masterpages_baselayout_aspx.__AW_ProcessRequest(HttpContext )
at ASP._layouts_flm_masterpages_baselayout_aspx.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Nested Exception
Exception: System.Web.UI.ViewStateException
Message: Invalid viewstate.
Client IP: 10.8.5.172
Port: 44240
Referer: http://xxxxxxxxxxxxxxxxx/Blog/Default.aspx
Path: /Blog/Default.aspx
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.109 Safari/537.36
ViewState: /wEPDwUKLTkxNzg0OTU0NQ9kFgQCAQ9kFgJmD2QWBgIDDxYCHgRUZXh0BRsgLSBGaW5hbmNpYWwgTGl0ZXJhY3kgTW9udGhkAgUPFgIfAAXFATxtZXRhIG5hbWU9ImtleXdvcmRzIiBjb250ZW50PSJGaW5hbmNpYWwgYmxvZ3MsIGZpbmFuY2lhbCBibG9nLCBmaW5hbmNpYWwgbGl0ZXJhY3kgYmxvZywgZmluYW5jaWFsIHNlcnZpY2VzIGJsb2csIGZpbmFuY2lhbCBzdWNjZXNzIGJsb2csLCBwZXJzb25hbCBidWRnZXRpbmcgYmxvZywgZmluYW5jaWFsIGxpdGVyYWN5IG1vbnRoIGJsb2ciIC8+ZAIHDxYCHwAF7wE8bWV0YSBuYW1lPSJkZXNjcmlwdGlvbiIgY29udGVudD0iRmluYW5jaWFsIExpdGVyYWN5IE1vbnRoIEJsb2cgYWJvdXQgRmluYW5jaWFsIFN1Y2Nlc3MuICBTdGFydGluZyBvbiB0aGUgZmlyc3QgZGF5IG9mIEZpbmFuY2lhbCBMaXRlcmFjeSBNb250aCAoQXByaWwgMSksIEkgd2lsbCB0YWtlIG9uZSBzdGVwIGEgZGF5IHRvIGltcHJvdmUgbXkgZmluYW5jZXMgYW5kIGJsb2cgYWJvdXQgbXkgZXhwZXJpZW5jZS4gIiAvPmQCBRBkZBYCAgMPZBYCAgEPZBYCZg9kFgICAQ9kFgJmD2Q...
Upon inspection though, I confirmed that both CDs used the same MachineKey and so possibly the viewstate was corrupted or the churning CD had a problem validating it. In fact, it could be unrelated, but it was the only other sign we have to follow.
Based on the info we have so far, it was determined that we could or should use a SQL Session State server to avoid the DMS concurrency issues when this happens, preventing the endless retries and CPU getting maxed out. We planned to follow the Walkthrough: Configuring a shared session state database using the SQL Server provider
However, while doing research to do just that, I found information that made my question whether SQL Session State was even an option with our version of Sitecore:
ASP.NET Session State support for Sitecore Client
Sitecore DMS errors when using the ASP.NET out-of-process session-state modes
Ultimately the question is... What are our options to resolve this issue to properly configure load-balanced content delivery servers with DMS functionality? We need to be able to deploy OS patches, code updates, etc... so there is always the possibility that one server goes down or traffic is transferred to another node. Also, upgrading to a later version of Sitecore is not really an option at this point since a new site is being built on the recommended version to launch in the coming year and there is no desire to expend a lot of effort on the current solution.
Configuration:
Version: Sitecore 6.5 Update-1 (rev. 120706)
1 Content Management server
2 load-balanced Content Delivery servers
| |
In Coveo for Sitecore you can use the coveoItemProcessingPipeline to add other items that should also be indexed. This is similar in concept to the Sitecore indexing.getDependencies pipeline
public class IndexWildcardItems : IProcessor<CoveoItemProcessingPipelineArgs>
{
public void Process(CoveoItemProcessingPipelineArgs p_Args)
{
var indexableItem = p_Args.Item as SitecoreIndexableItem;
if (indexableItem != null && indexableItem.Item != null && IsCustomWildcardItem(indexableItem.Item))
{
IEnumerable<Item> wildcards = GetWildcardItems(indexableItem.Item);
p_Args.OutputItems.AddRange(wildcards.Select(x => (SitecoreIndexableItem)x));
}
}
And patch the config in:
<pipelines>
<coveoItemProcessingPipeline>
<processor type="MySite.Custom.ContentSearch.Processors.IndexWildcardItems, MySite.Custom" />
</coveoItemProcessingPipeline>
</pipelines>
You will need to provide the correct logic for IsCustomWildcardItem() to determine if the current item being indexed is a valid Wildcard item and the logic required for GetWildcardItems(indexableItem.Item) to return the all the items for this particular wildcard.
The items are then added to the indexing queue and will be indexed as normal like any other item.
You'll also need to handle indexing the URLs for your items. The tricky part here is determining which site an item belongs to and how to determine which wildcard an item belongs to. There are so many factors that can affect this, such as your exact set up and content architecture, so is beyond the scope of this answer without a lot more information. By default, Coveo will resolve the ClickUri field when it is returned by the REST service. This means that if you have your LinkProvider set up to generate the correct link then the returned URL will be generated correctly.
You can read more information about the Coveo coveoProcessParsedRestResponse pipeline and the ResolveResultClickableUriProcessor processor which resolves the ClickUri:
<coveoProcessParsedRestResponse patch:source="Coveo.SearchProvider.Rest.config">
<!--
This processor resolves the REST results clickUri field in the context of
the current site using the Sitecore LinkManager.
-->
<processor type="Coveo.SearchProvider.Rest.Processors.CoveoProcessParsedRestResponse.ResolveResultClickableUriProcessor, Coveo.SearchProvider.Rest"/>
</coveoProcessParsedRestResponse>
Note: The above is true for Coveo version 3, the pipelines and processors involved may be slightly different for Coveo version 4 but the concepts remain the same.
| Indexing Wildcard Items in Coveo for Sitecore
I'm new to Coveo. I'm trying to work out the best way to index wildcard pages. So when you publish a wildcard item, all the corresponding wildcard pages get indexed nicely with their correct URL's.
I've achieved this many times before with Lucene and Solr using trickery with custom item crawlers. But I know that Coveo for Sitecore has has bunch of different pipelines for you took hook in to.
I feel certain the answer is in there somewhere, but I don't know enough to find it.
| |
Given this works for you on other environments with (presumably) the same code, the problem is most likely somewhere in the databases or files not in version control (including tokenized files).
Whenever I see a NullReferenceException without any obvious clue as to what was null, I go straight to the source code.
Sitecore.UIUtil.GetBrowserClassString(), the method throwing the null-ref exception, has the following source code:
public static string GetBrowserClassString()
{
string str = string.Empty;
if (UIUtil.IsIE())
str = str + " ie" + " ie" + (object) UIUtil.GetBrowserMajorVersion();
else if (UIUtil.IsFirefox())
str = str + " ff" + " ff" + (object) Client.Device.Capabilities.Browser.MajorVersion;
else if (UIUtil.IsWebkit())
str = str + " ff" + " wk" + " wk" + (object) Client.Device.Capabilities.Browser.MajorVersion;
return str.Trim();
}
The most likely part of that code that could reasonably be null (thanks to statics and value types) is Client.Device. Perhaps you have some site in <sites> misconfigured, or one of the devices in /sitecore/layout/devices is missing or misconfigured (for example, the Capabilities object might be null if your Sitecore instance has something odd in the Capabilities Type field).
| GetBrowserClassString() Throws Error when installing a package in SXP8.1U3
Having problems when uploading a Sitecore Package from one environment to the next. Both environments have the same version level (Sitecore XP 8.1U3 / EXM 3.3).
Screen error message reads:
[NullReferenceException: Object reference not set to an instance of an object.]
Sitecore.UIUtil.GetBrowserClassString() +347
Sitecore.Shell.Controls.Standard.FormPageXmlControl.OnLoad(EventArgs e) +1154
System.Web.UI.Control.LoadRecursive() +67
System.Web.UI.Control.LoadRecursive() +164
System.Web.UI.Control.LoadRecursive() +164
System.Web.UI.Control.LoadRecursive() +164
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4497
Sitecore Log Output:
3028 15:10:20 INFO File has been uploaded: D:\inetpub\wwwroot\Sitecore\Data\packages\ClientMailCoreSpeakApplication.zip
ManagedPoolThread #5 15:10:25 INFO Job started: Install
ManagedPoolThread #5 15:10:25 INFO Installing package: D:\inetpub\wwwroot\Sitecore\Data\packages\ClientMailCoreSpeakApplication.zip
ManagedPoolThread #5 15:10:56 INFO Installation was aborted at entry: items/core/sitecore/client/Applications/Client Mail/{B1F6C86A-4F1D-4A60-8949-EC945ABE0675}/en/1/xml
ManagedPoolThread #5 15:10:56 INFO Installation was aborted
ManagedPoolThread #5 15:10:56 INFO Job ended: Install (units processed: )
Note that the Sitecore log does NOT show the 500 error displayed to
the browser.
Process:
Upload Package File - Successful.
Click through to Name and License Dialog - Successful.
Clicking the Install button immediately throws an error.
Package Contains:
Contains Sitecore items meant for the core database to install a new Speak Application.
| |
Here is how you can do this:
1. Create reporting query item
Create somewhere an item of template /sitecore/templates/System/Analytics/ReportQuery
Example fields configuration:
Write down an item ID somewhere, we will need it later.
2. Create item based reporting query class
Example code:
Note: This Constants.ReportingQueries.ItemVisits is an item ID of your reporting query item, put this into constant or pull from configuration.
public class ExampleVisitsQuery : ItemBasedReportingQuery
{
public ExampleVisitsQuery(ReportDataProviderBase reportProvider = null)
: base(Constants.ReportingQueries.ItemVisits, reportProvider)
{
}
public ID ItemId { get; set; }
public long Visits { get; protected set; }
public override void Execute()
{
var parameters = new Dictionary<string, object>
{
{"@ItemId", ItemId}
};
var dt = this.ExecuteQuery(parameters);
if (dt != null && dt.Rows.Count > 0)
{
var result = dt.Rows[0]["Visits"];
if (result != null && result != DBNull.Value)
Visits = (long)dt.Rows[0]["Visits"];
}
}
}
3. Get your data
This is where we get the data.
var query = new ExampleVisitsQuery (this.ReportDataProvider)
{
ItemId = id
};
query.Execute();
long itemViews = query.Visits;
Note:
this.ReportDataProvider is an instance of ReportDataProviderBase type.
In this can be null
As a output you get number of views.
4. Sort your data
Once you get Visits for all items you can easily sort them.
Assuming you have got a list of items ids as an input here is what you can do:
if (entryIds.Any())
{
var views = new Dictionary<ID, long>();
foreach (var id in entryIds)
{
var query = new ExampleVisitsQuery(this.ReportDataProvider)
{
ItemId = id
};
query.Execute();
var itemViews = query.Visits;
if (itemViews > 0)
views.Add(id, itemViews);
}
var ids = views.OrderByDescending(x => x.Value).Take(maxCount).Select(x => x.Key).ToArray();
}
source: WeBlog
| Sorting Pages by most views
I have a requirement in our 8.1 update 2 solution to provide a sorting mechanism for pages based on the number of views. This data lives in the analytics database and I'm looking for a way to retrieve the data without querying the database directly. Is there an API in place out of the box that I can use to get an item's view count?
I've verified that the data I need exists in the [Sitecore_Analytics].[dbo].[Fact_PageViews] table. From a best practices standpoint, what is the best way to retrieve this data and use it in our components?
| |
This is not a solution I recommend for a production server, but if you need a certificate for a development server, I have a solution for you.
I use use a PowerShell script to create a certificate, and then configure my IIS site to use the certificate.
Here is the script I use. Before running the script you must set the variable $dnsname to the name of your site.
$dnsname = "aaa"
$pwd = ConvertTo-SecureString -String "123456" -Force -AsPlainText
$print = (New-SelfSignedCertificate -certstorelocation cert:\localmachine\my -dnsname $dnsname).Thumbprint
$path = "c:\Windows\temp\cert.pfx"
Export-PfxCertificate -cert cert:\localMachine\my\$print -FilePath $path -Password $pwd
$file = ( Get-ChildItem -Path $path )
$file | Import-PfxCertificate -CertStoreLocation cert:\LocalMachine\Root -Password $pwd
Remove-Item $path
After you run the script, you can assign the certificate to your site:
Open IIS Manager
Select your site
Edit bindings for the site
Add a new binding.
For type, set https.
For hostname, set the value of the $dnsname variable from the PowerShell script.
From the SSL certificate dropdown, select the certificate with the name that matches the hostname.
Click OK to save your changes.
Now you can access your server using your preferred host name without getting any browser errors.
Note: Lest anyone mistake me for a PowerShell guru, I found this script on the internet long ago. I've been using it for years. At this point, I can't remember where I originally got, so unfortunately I cannot give proper credit.
| How do you setup your local Sitecore instance to support HTTPS in either a single or multi-tenant configuration?
I'm using SXA and have found that while using the Maps and Location Finder component that the utodetect location feature is no longer available for insecure origins.
You may see an error such as this in the DevTools console.
What are some possible approaches to both configuring the HTTPS setup locally, but also for a team of developers?
Also noticing that the Chrome browser complains about it too next to the omnibox.
| |
You can try the Sitecore Log Analyzer. You can filter by timeframe and add a string qualifier and look for Job started/ended statements in the logs.
| How can I get a list of execution times for my Sitecore scheduled task?
I have a scheduled task in Sitecore and I want to find the timestamp for its past executions. I can find this information in the Sitecore logs by looking to see when the info message gets written like:
ManagedPoolThread #3 03:31:12 INFO Starting: <TaskName> (asynchronously)
ManagedPoolThread #18 03:31:12 INFO Job started: ScheduleCommand '{<ID>}'
ManagedPoolThread #3 03:31:13 INFO Ended: <TaskName>
This works in a sense but it is pretty tedious analyzing logs like this.
Is this history stored in a database/table anywhere that I can query?
| |
I have outlined 3 options for you below. Rocks is perhaps the easiest to setup and use but isn't so easy to use on remote environments. SPE is perhaps the most flexible and powerful option. Writing code against the APIs is quick and dirty but gets the job done. So there is no right answer really, it depends on your use-case.
Option 1: Sitecore Rocks
You can use Sitecore Rocks to do this quite easily:
https://visualstudiogallery.msdn.microsoft.com/44a26c88-83a7-46f6-903c-5c59bcd3d35b/view/Discussions/3
Install Rocks from the link above and then in the Sitecore Rocks explorer, select the node/item where you want to create your items, bring up the context menu and select "Add" and then "New Item":
Select the template you want to use and add the details of one or more items like so:
Click ok and Rocks should create them for you.
Option 2: Sitecore Powershell Extension
Another option is Sitecore Powershell Extensions. Install it from here:
https://marketplace.sitecore.net/en/Modules/S/Sitecore_PowerShell_console.aspx
Add the following script and run it, it will prompt you for the item and template to use and then create items:
#This script will create sitecore items based on given count and template
$InputCount = Show-Input "How many items do you want to create?"
$InputTemplate = Show-Input "Using which template you want to create item?"
$getCurrentItem = Get-Item .
$NewItemPath = $getCurrentItem.FullPath
$CurrentChildCount = $getCurrentItem.Children.Count+1
for ($index = $CurrentChildCount; $index -lt $CurrentChildCount+$InputCount; $index++)
{
new-item -Path $NewItemPath -Name $index -type $InputTemplate
}
More info on how to use this script here: http://sitecorejourney.nileshthakkar.in/2015/10/how-to-create-bulk-items-in-sitecore.html
Great GIT Book on SPE here: https://sitecorepowershell.gitbooks.io/sitecore-powershell-extensions/content/
Option 3: Sitecore APIs
Write some c# code to do this and put it in a page in /sitecore/admin or somewhere else that is secure, add the Sitecore dll/namespace references needed and run it.
using (new SecurityDisabler())
{
Database masterDb = Sitecore.Configuration.Factory.GetDatabase("master");
Item parentItem = masterDb.Items["/sitecore/content/home"];
TemplateItem myTemplate = masterDb.GetTemplate("my template");
for (int i = 1; i <= 100; i++)
{
parentItem.Add("my test item " + i, myTemplate);
}
}
This should create 100 items for you based on your specific template under the home item. Just change the path to the parent item and the template you want to use and it should work fine. Notice SecurityDisabler is used to allow permissions to create items.
| What is the best way to bulk-create items programmatically?
What is the best way to create many items in bulk under a certain item, using code?
What are the things to consider in such scenarios?
What are the pros and cons?
| |
This will also fold in protection for the media request:
var theURL = Sitecore.Resources.Media.MediaManager.GetMediaUrl(mediaItem);
mediaUrl = Sitecore.Resources.Media.HashingUtils.ProtectAssetUrl(theURL);
Here is the link to Sitecore documentation that explains about protecting Sitecore media from abuse - https://doc.sitecore.net/sitecore_experience_platform/setting_up__maintaining/security_hardening/configuring/protect_media_request
| How do you get the link for a media item?
I have an item in the media library in Sitecore and I want to place a link to that item on the site. How do I properly get the link for that media item?
| |
You need to provide the dependencies in config. For example, the out of the box Send Email Message save action has the following definition in Sitecore:
If you check in Sitecore.WFFM.Dependencies.config you will find a matching definition:
<sitecore>
<wffm>
<!--Save actions constructor configuration-->
<actions>
...
<sendMessage type="Sitecore.WFFM.Actions.SaveActions.SendMessage, Sitecore.WFFM.Actions">
<param name="settings" ref="/sitecore/wffm/settings" />
<param name="mailSender" ref="/sitecore/wffm/mailSender" />
</sendMessage>
...
</actions>
</wffm>
</sitecore>
If you create a custom save action then create a duplicate of this node and change the type to your own implementation and change the Factory Object Name to point to your new config node.
| WFFM Unable to use Email Editor in Custom Send Email action
I am trying to create a custom WFFM SaveAction that sends an email, and I would like to still use the Email Editor. The problem is, how do I get the information entered through the editor in my custom SaveAction. If I inherit from SendMail, I can't add the SaveAction to the form. I get in the log:
The constructor parameters may not match or it may be an abstract class.
So I just step back to using ISaveAction, but then I can't access the data from the editor. It seems like I need the IMailSender and IEmailAttributes that SendMail takes, but I can't seem to make that work. How do I access the data from the email editor in a custom SaveAction?
WFFM 8.1
| |
After spending some time in Sitecore logs and googling I decided to check Solr logs.
In my case they are stored in C:\solr\solr-5.4.1\server\logs\
That was smart move. I immediately found a clue:
2016-10-12 21:21:34.271 INFO (qtp7980742-52) [ ]
o.a.s.s.HttpSolrCall [admin] webapp=null path=/admin/cores
params={core=mycore&action=STATUS&version=2.2} status=0
QTime=10 2016-10-12 21:21:34.284 ERROR (qtp7980742-54) [
x:mycore] o.a.s.h.a.ShowFileRequestHandler Can not find:
schema.xml
[C:\solr\solr-5.4.1\server\solr\mycore\conf\schema.xml]
It happened that I copied schema.xml file to wrong location. After moving it to mycore\conf and restarting site everything returned back to normal.
I hope Sitecore can make that error message more helpful in next release.
| Unable to connect to [http://localhost:8983/solr], Core: [mycore]
I am creating Solr Sitecore search index. After index was added to Solr and Sitecore configuration was updated to connect to it, I suddenly got yellow screen of death:
Connection error to search provider [Solr] : Unable to connect to
[http://localhost:8983/solr], Core: [mycore]
With this call stack:
[SearchProviderConnectionException: Connection error to search provider [Solr] : Unable to connect to [http://localhost:8983/solr], Core: [mycore]]
Sitecore.ContentSearch.SolrProvider.SolrSearchIndex.Initialize() +961
Sitecore.ContentSearch.SolrProvider.SolrContentSearchManager.Initialize() +169
Sitecore.ContentSearch.SolrProvider.UnityIntegration.UnitySolrStartUp.Initialize() +1506
[HttpException (0x80004005): Connection error to search provider [Solr] : Unable to connect to [http://localhost:8983/solr], Core: [mycore]]
System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +540
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +186
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +172
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +402
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +343
[HttpException (0x80004005): Connection error to search provider [Solr] : Unable to connect to [http://localhost:8983/solr], Core: [mycore]]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +539
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +125
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +731
Checked Sitecore logs. There is another call stack there, but at the end it is the same 404 Solr error:
10832 17:31:14 ERROR Unable to connect to [http://localhost:8983/solr], Core: [mycore]
Exception: SolrNet.Exceptions.SolrConnectionException
Message: The remote server returned an error: (404) Not Found.
Source: SolrNet
at SolrNet.Impl.PostSolrConnection.Get(String relativeUrl, IEnumerable`1 parameters)
at SolrNet.Impl.SolrBasicServer`1.GetSchema()
at Sitecore.ContentSearch.SolrProvider.SolrSearchIndex.Initialize()
Nested Exception
Exception: System.Net.WebException
Message: The remote server returned an error: (404) Not Found.
Source: System
at System.Net.HttpWebRequest.GetResponse()
at SolrNet.Impl.PostSolrConnection.Get(String relativeUrl, IEnumerable`1 parameters)
When I try to check that URL in browser everything works fine. Tried all these URLs below and all them returned 200 with expected page or XML data:
http://localhost:8983/solr/mycore/select?q=*&rows=1000
http://localhost:8983/solr/#/
http://localhost:8983/solr/#/mycore
| |
This is a common issue with the Sitecore Preview mode when the website site definition has gone missing.
In versions of Sitecore through 8.0 and lower (I'll edit with exact revision number), the website site definition is hardcoded in the bowels of the Sitecore code, which means if you are trying to remove it, it can cause issues.
In versions of Sitecore 8.1 and later, this was resolved using a couple different Sitecore settings.
Two things to check:
Check The Site Definition in the Configuration
Check Sitecore Settings
If your version of Sitecore has it, check out these settings:
<!--
PAGE PREVIEW SITE NAME
Specifies the name of the site that is used to generate page previews, for example "website".
If blank, Sitecore uses the value in the Preview.DefaultSite setting.
Default value: "" (use the value of the Preview.DefaultSite setting) -->
<setting name="PagePreview.SiteName" value=""/>
<!--
PREVIEW - RESOLVE SITE
If false, the Preview.DefaultSite setting specifies the context site to use when a user previews an item.
If true, when a user previews an item, Sitecore tries to resolve the root item and the context site based on the current content language
and the path to the item. If Sitecore cannot resolve the context site, it uses the site that is specified in the Preview.DefaultSite setting.
Default value: false (use the value of the Preview.DefaultSite setting) -->
<setting name="Preview.ResolveSite" value="true"/>
If your intention is to get rid of the website defiition, you won't
be able to do it until you set these variables (assuming your version
of Sitecore supports it.) If your version of Sitecore doesn't NOT
support it, you will be forced to keep the website active.
| Sitecore 8.0 Preview Mode not rendering all the way
The preview mode loads the page, but it has the SPEAK square just spinning over the top of it with an server error in '/' Application at the top where the ribbon is suppose to be. If I inspect the page and remove the Div tag " the preview loads fine and is functional.
Here is a little bit of the stack trace:
Source Error:
Line 2: @using Sitecore.ExperienceEditor.Speak.Ribbon.Controls.Chunk
Line 3: @model Sitecore.Mvc.Presentation.RenderingModel
Line 4: @Html.Sitecore().Controls().Chunk(Model.Rendering)
Source File: e:\wwwroot\jenkins\Web\sitecore\shell\client\Sitecore\Speak\Ribbon\Controls\Chunk\Chunk.cshtml Line: 4
Stack Trace:
[MissingMethodException: Method not found: 'Boolean System.Web.WebPages.BuildManagerWrapper.IsNonUpdateablePrecompiledApp(System.Web.Hosting.VirtualPathProvider, Microsoft.Internal.Web.Utils.IVirtualPathUtility)'.]
System.Web.Mvc.BuildManagerViewEngine.GetPrecompiledNonUpdateable() +0
System.Threading.LazyInitializer.EnsureInitializedCore(T& target, Boolean& initialized, Object& syncLock, Func`1 valueFactory) +246
Here is a screen shot:
| |
We're definitely in the grey zone here; as not very many people can speculate on the reasoning that took place while this functionality was designed.
That said; the simpler the explanation the more likely it is.
When a bucket is created, all that really happens is the IsBucketItemCheckbox field gets set to checked
using (new EditContext(parameter, SecurityCheck.Disable))
{
if (!parameter.IsBucketItemCheck())
parameter.IsBucketItemCheckBox().Checked = true;
Event.RaiseEvent("item:bucketing:ending", (object) parameters, (object) this);
Log.Info("Created Bucket Item for " + (object) parameter.ID, (object) this);
}
Then; bucket config patches in bucket code to the AddFromTemplateCommand functionality on a Data Provider level.
<database id="master">
<Engines.DataEngine.Commands.AddFromTemplatePrototype>
<obj type="Sitecore.Buckets.Commands.AddFromTemplateCommand, Sitecore.Buckets" />
</Engines.DataEngine.Commands.AddFromTemplatePrototype>
</database>
Jumping through a few hoops and pipelines, essentially Sitecore will check the same checkbox for new items, if the parent item has the checkbox checked.
<buckets.isBucket>
<processor type="Sitecore.Buckets.Pipelines.BucketStatus.IsBucket.CheckIfItemIsABucket, Sitecore.Buckets"/>
</buckets.isBucket>
And the code
internal static bool IsBucketItemCheck(this Item item)
{
if (item != null && item.Fields[Sitecore.Buckets.Util.Constants.IsBucket] != null)
return item.Fields[Sitecore.Buckets.Util.Constants.IsBucket].Value.Equals("1");
return false;
}
(item, in this case, is the item the command is being invoked on - which would be the parent Item. Remember, new items are added via parent.Add())
And I believe that's all there is to it. The indexing code for buckets will index all items where the Is Bucket field is checked and that's why you see your root node in results.
Unless you disable it, as you mention yourself.
| Why is Sitecore including the bucket parent in the search result by default
When creating buckets, I've always puzzled over one implementation decision from Sitecore in regards to buckets. By default, the bucket parent item is included in the list when you are searching for bucket items. Essentially my question is, WHY? It seems really strange. If I have a a product bucket with a bunch of product items in it, why wold I want to see the product bucket item come up in the results?
I'm aware that there is a setting to turn this off (BucketConfiguration.ExcludeContextItemFromResult) but I can't understand why that is set to false by default.
| |
The issue may be related to your other question where it appears that you have some invalid date formats. From the StackTrace it looks like the issue is related to one of the Media facets. I would try disabling the 'Date uploaded' facet under /sitecore/client/Applications/Dialogs/SelectMediaDialog/PageSettings/Facets from the Core database to see if that removes the error.
More information about disabling facets at the bottom of this knowledge base article: https://kb.sitecore.net/articles/576214
| "String was not recognized as a valid DateTime" error
Images do not appear in Select Media dialog when I click Browse button in Image field.
HTTP response from ItemWeb API that expected to return Images contains this error:
String was not recognized as a valid DateTime.
There is an associated entry in Log:
2724 10:59:23 ERROR [Item Web API] String was not recognized as a valid DateTime.
Exception: System.FormatException
Message: String was not recognized as a valid DateTime.
Source: mscorlib
at System.DateTimeParse.ParseExact(String s, String format, DateTimeFormatInfo dtfi, DateTimeStyles style)
at Sitecore.ItemWebApi.Facets.UpdatedFacetProvider.GetFacetValue(String value)
at Sitecore.ItemWebApi.Pipelines.Request.Search.GetFacets(IList`1 facetProviders, FacetResults facets)
at Sitecore.ItemWebApi.Pipelines.Request.Search.RunSearchPipeline(RequestArgs args, String searchText, String languageName, Boolean showHiddenItems)
at Sitecore.ItemWebApi.Pipelines.Request.Search.Process(RequestArgs args)
at (Object , Object[] )
at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
at Sitecore.ItemWebApi.Pipelines.HttpRequest.LaunchRequest.Process(HttpRequestArgs arguments)
We have Sitecore instances with the same site in different environments and issue is not reproducible there. One difference between this instance and others is lots of Media Items imported from Sitecore 6.5.
Any ideas how to fix this issue?
| |
Here is a prototype for you to test with in your non-production instance.
Sitecore PowerShell Extensions
$items = @(Get-Item -Path "master:\content\home") + @(Get-ChildItem -Path "master:\content\home")
$expression = "\d{8}[T]\d{6}"
foreach($item in $items) {
$item.BeginEdit() | Out-Null
if($item.Fields["__Created"].HasValue -and ($item.Fields["__Created"].Value -match $expression)) {
$item.Fields["__Created"].Value = $matches[0]
}
if($item.Fields["__Updated"].HasValue -and ($item.Fields["__Updated"].Value -match $expression)) {
$item.Fields["__Updated"].Value = $matches[0]
}
$item.EndEdit() | Out-Null
}
The code finds the home item and the immediate children, then looks for dates that have values and matches the pattern you specified. I'm accessing the value directly on the field since it gives the raw value (rather than a datetime).
| How to clean up date field values migrated from old Sitecore versions
After migrating content from Sitecore 6.5 I see dates staying not in canonical 8+ Sitecore format.
Some samples (raw values) from my current project:
20140329T120917 - no Z at the end
20140329T123823:635316935030258782 - no need for so many digits
All dates created in Sitecore 8 (I checked Created and Updated fields) follow the same yyyyMMddTHHmmssZ pattern.
What is the best way to change dates format when content is moved from old Sitecore version to a new one?
| |
So it's took me all of yesterday and most of today to figure this out. In the end it was nothing to do with my code or configuration at all. The log files showing some errors were a Red-Herring and leading me in the wrong direction.
It is a Sitecore bug with 8.1 Update-2 (public reference: 108023).
This blog post was really useful for identifying it:
http://www.sitecorecoffee.com/2016/06/issue-with-final-layout-and-experience.html
You can download the Sitecore Hotfix from here: http://54.86.191.98/Sitecore108023-RenderingsHotfix.zip
provided by Thomas Eldblom on Github who got it from Sitecore.
Once I did this my pages saved fine and updated as expected in Experience Editor.
To apply the hotfix just include the dll in the zip folder in your solution and drop the config file in /app_config/ which patches the pipeline in from the dll.
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:set="http://www.sitecore.net/xmlconfig/set">
<sitecore>
<sitecore.experienceeditor.speak.requests>
<request name="ExperienceEditor.Save.CallServerSavePipeline" type="Sitecore.ExperienceEditor.Speak.Ribbon.Requests.SaveItem.CallServerSavePipeline, Sitecore.ExperienceEditor.Speak.Ribbon">
<patch:attribute name="type">Sitecore.Support.ExperienceEditor.Speak.Ribbon.Requests.SaveItem.CallServerSavePipeline, Sitecore.Support.108023</patch:attribute>
</request>
</sitecore.experienceeditor.speak.requests>
</sitecore>
</configuration>
Other errors people may search for are:
layout for the requested document was not found
and:
Final renderings lost/erased when saving in Experience Editor
There is further information on this here also:
https://github.com/Sitecore/Habitat/issues/136
Hopefully this will help anyone else coming across this issue.
| Item not found when saving page in Experience Editor
I have a strange situation where I get a 'Item not found' on postback in Experience Editor when I edit an page.
The culprit is a controller rendering which has a line of code in to get the current page item using Glass:
ContentBase pageHeading = GetDataSourceItem<ContentBase>();
On initial load of the page in Experience Editor the Page Heading item is resolved correctly and populated. However after editing the title of the page and saving, if I debug I can see pageHeading has resolved to our custom 404 page - set in:
<setting name="ItemNotFoundUrl" value="page-not-found.aspx"/>
The controller therefore returns the page not found at the bottom of the controller and instead of reloading my current page (with the updated heading) in Experience Editor it loads the page not found page, as pageHeading below has resolved to the page-not-found page:
return PartialView("~/Views/GoAhead/Partials/_PageHeading.cshtml", pageHeading);
The other result of this is that the Final Renderings on the page I was editing get blitzed. I have to go and reset the layout on my page to get them back.
I can't figure out what is causing it and annoyingly if I copy the controller rending in Sitecore and point it at the same controller code it works fine. It's just this PageHeading controller rendering that causes this. This suggests the issue is somehow related to the PageHeading controller rendering item and not the code. I've compared it with my copy of the controller rendering item and it seems the same and that works fine.
Further info: Sitecore 8.1 Update 2, Sitecore MVC, Glass
| |
It is completely safe to just delete the folder /App_data/MediaCache without causing disruption. The minute an image gets called up again, it will be cached again, so no worries about the functionality of your website. We make sure it get's cleaned up every week.
In addition you can set up a clean up job to do the work for you. Unfortunately the usage of /sitecore/admin/cache.aspx does not clear the mediacache for you.
If you have an high performance on your website and do not want to cache your media items at all, you can always set this up in the sitecore.config file
<!-- MEDIA - CACHE FOLDER
The folder under which media files are cached by the system.
Default value: /App_Data/MediaCache
-->
<setting name="Media.CacheFolder" value="/App_Data/MediaCache" />
<!-- MEDIA - CACHING ENABLED
Indicates if caching of media files is enabled.
Default value: true
-->
<setting name="Media.CachingEnabled" value="false" />
In addition, you can use an orchestration tool like puppet to periodically clean up your cache folder based on the timestamp of the files, this way, you don't have to worry about your cached items as they will be cleaned up automatically.
| How can I safely clear the media cache on a production sitecore CD instance?
I would like to manually clear the media cache on a production CD instance. Is there a way to clear the cache without causing disruption to the site?
| |
Sitecore is using link database in order to speed-up resolving of relationships between items (referers/references).
It allows to increase performance of Sitecore client and shouldn't impact site performance on the content delivery. It can impact content delivery performance only if you're using link database in your custom code.
If RebuildLinkDatabase dialog is finished successfully - everything is fine. There are no additional ways to check whether rebuilding was successful. However, rebuilding the link database will produce some load on database, so we would recommend to plan this operation at the time when site load is minimal.
| What is the impact to a Sitecore instance while rebuilding the links database?
I am referring specifically the Links database, stored in the "Links" table, as defined here:
<!-- LINK DATABASE -->
<LinkDatabase type="Sitecore.Data.$(database).$(database)LinkDatabase,
Sitecore.Kernel">
<param connectionStringName="core" />
</LinkDatabase>
Does the site experience performance degradation? Does the site go down? Does nothing interesting happen? What about rebuilding core vs. master vs. web links database?
| |
I will recommend these specific settings for Sitecore in IIS:
Ensure that Maximum Worker Processes for the Application Pool is set to 1 (under advanced settings)
Ensure that Load User Profile settings of the Application Pool is set to "true" (under advanced settings)
Ensure anonymous access is denied for:
/App_Config
/sitecore/admin
/sitecore/debug
/sitecore/webservice
Enable HTTP keep alive
Enable static content compression
On the CMS server, enable dynamic content compression
Disable execute permissions on the upload folder
Enable content expiration using HTTP response headers, especially for the /sitecore folder (optional)
For a multisite solution it is recommended to have just one application pool for all websites.
| Are there specific IIS setting recommendations for Sitecore?
Are there any specific setting changes for IIS specific to Sitecore? Or are general ASP.NET IIS best practices fully applicable to Sitecore?
| |
Have you read the documentation of robots detection on the Sitecore doc-Portal?
https://doc.sitecore.net/sitecore_experience_platform/setting_up__maintaining/xdb/robot_detection/visitor_identification_using_robot_detection
Please check the SC_ANALYTICS_GLOBAL_COOKIE cookie. If your users have the IsClassificationGuessed key set to true, they would be classified as a robot and the session timeout would be reduced to your Analytics.Robots.SessionTimeout value (default = 1min)
A user could be identified as a robot in following cases:
the timeout setting comparison javascript would be executed fastet than 30 seconds after document-load (see the doc link above for more details),
the user agent is in your "blacklist",
the IP-Address of your user is in your "blacklist". Robots blacklists are stored under Sitecore.Analytics.ExcludeRobots.config
The system can identify your users as a malicious robot (code = 930), as a autodetected robot (code = 925) or as a other robot type (any code value greater than 900).
If you are able to reproduce/debugging the issue, you can watch the value of Sitecore.Analytics.Tracker.Current.Session.Contact.System.Classification to see the actual classification of the current user (or made a processor to log the value to your log-system).
| Sitecore xdb robot detection?
Actually we were facing some intermittent session timeout and someone has mentioned about Analytics.Robots.SessionTimeout . We fixed our session timeout issue by increasing the above analytics robots session timeout to 30 mins in sync with what we have for normal users session time frame. I want to understand bit more about this analytics robots and how it helps in overall user interaction.
| |
This is because the user is not flushed to MongoDB before SessionEnd. There are various reasons for this1, one being that you want to minimize the writes to MongoDB.
If you need to do something immediately you can manually flush the user session, but keep in mind that it can have side effects, so consider if it's absolutely required.
You can abandon the session like this:
Sitecore.Analytics.Tracker.Current.EndTracking();
HttpContext.Current.Session.Abandon();
1 There's a bit more to it than just performance. Once you have a user session that contact is locked (to that specific web cluster) for the duration of the session. This mean other server roles will not be able to modify the contact during this period. Consider this scenario: You have a job running on your CM server which synchronises contact information from your CRM system. At the same time the user is browsing the website (on the CD server) and updates her contact info. Sitecore knows how to merge your changes upon flushing the user session, but you have to be aware of this yourself if you create a job which needs to modify the user.
| Engagement Plans: Why is a user not added to an engagement plan until the session of a user is timed out?
In short my question is: Why is a user not added to an engagement plan until the session of a user is timed out?
My setup:
I am running Sitecore 8.1.3 and I have created a simple engagement plan, which simply sends a confirmation mail to a user stating that he has subscribed to a newsletter. It consists of 3 elements:
Initial state with a timeout of 1 minute
Condition which is always evaluated to true
Action which sends a campaign (EXM) mail to the user
I add the user to the engagement via a rule action on a goal.
The waiting game: When the user submits to a newsletter I trigger the goal and from the logs, I can see that the user is added to the engagement plan, however I can't see the user in the Engagement Plan supervisor and no mails are send. Only when the session of the user times out (20 minutes after the last page view), the user is added to the engagement plan, which i can verify by looking at the xDB and using the EA supervisor. Only after I can see that the user is indeed added to the engagement plan, he is process through the plan.
Have I misunderstood something, or are engagement plans not suitable for sending notifications to users immediately? I know that i could simply add an action to the goal that sends an email, but my customer plans to do more elaborate things as part of the sign-up process.
Edit: I know that Sitecore provides a module called "Live session agent", but I am unsure if that would solve my questions, based on the documentation that Sitecore provided (https://dev.sitecore.net/Downloads/Engagement_Automation_Live_Session_Agent.aspx)
| |
Automation worker running interval
The automation worker is the agent that processes automation state changes with a certain interval.
The first thing you should check is whether the automation worker is executed frequently enough. The default is to run it every 10 seconds, which is a good value for your needs. The setting is located in the configuration file Sitecore.EngagementAutomation.TimeoutProcessing.config, under configuration/sitecore/automationWorker/Interval:
<automationWorker type="Sitecore.Analytics.Automation.AutomationWorker, Sitecore.Analytics.Automation" singleInstance="true">
<ThreadsCount>1</ThreadsCount>
<Interval>00:00:10</Interval>
<ContactRepository ref="contactRepository"/>
</automationWorker>
Make sure you haven't patched this value to use a longer interval.
Contact locking
Even though the automation worker runs every 10 seconds, it will only process automation states of unlocked contacts. This may become an issue if a user has a live session on your site—in that case, the corresponding contact's automation states will not be processed until the web session ends.
In your particular case, I suspect that a user's session ended and he started a new session with after a short pause of 1 minute or less. This means that, even though the contact was saved to the Collection database and may have been briefly unlocked, the automation worker didn't have a large enough time window to get an exclusive lock. As a result, the contact's engagement plan actions were executed with more than 20 minutes of delay.
Please also note that the contact will remain locked as long as there is at least one live web session of the contact, and then for one extra minute. xDB supports multiple simultaneous contact sessions.
https://doc.sitecore.net/sitecore_experience_platform/setting_up__maintaining/xdb/session_state/session_state#_Toc396298780
| Engagement plans: Progressing from one state to another is taking significantly longer than the specified timeout
In short my question is: Why does it usually take significantly longer than the specified timeout time to progress from one state to another in an engagement plan?
Detailed issue: A user has been added to an engagement flow and after the session has ended I can verify it in the EA supervisor and in the xDB. I have a simple engagement plan in which the first step has a timeout of 1 minute. I would expect that this timeout is more or less precise but I usually see that it takes somewhere between 10 and 20 minutes to actually progress to the next state. It eventually progresses which I have verified by using a simple action that sends be a basic mail, but it takes a very long time to do so.
Note: I am using Sitecore 8.1.3
(This question is a follow up question to Engagement Plans: Why is a user not added to an engagement plan until the session of a user is timed out? which is concerned with why users are not added to engagement plans until session ends)
| |
The issue you reported was fixed in Sitecore Experience Platform 8.0 rev. 150621 (8.0 Update-4) and you can upgrade your solution to address the problem.
Please take a look at the reference number 416281 in Sitecore CMS release notes on for additional details on the fix: https://dev.sitecore.net/Downloads/Sitecore%20Experience%20Platform/8%200/Sitecore%20Experience%20Platform%2080%20Update4/Release%20notes
If upgrade is not an option for you, we suggest you implement the following workaround to resolve the issue on your current solution:
Place the attached Sitecore.Support.416281 assembly to the \bin folder of your solution;
Open /sitecore/system/Field types/Link Types/General Link item in the Core database;
Clean up its Control field;
Put Sitecore.Support.416281 in the Assembly field and Sitecore.Support.Link in the Class field;
Save changes.
Please download the assembly : https://www.dropbox.com/s/hl7ho6wmnca8u2y/Sitecore.Support.416281.dll?dl=0
| Exception thrown when trying to set General Link value
I am working on a template that has a General Link field. When I am trying to set the Insert link with the Sitecore Content Editor I am getting the following error:
I am working on Sitecore 8.0 (rev.150121)
The other General link options are working fine:
Insert media link
Insert external link
Insert anchor
Insert email
Insert JavaScript
I added a new field to the same template containing the general link field as well, and it is working fine - even for the Insert link option.
When viewing the raw values for the item, I have found that the link had a default value set to "". When I removed it and saved it, everything is working fine, the other testing link that I added does not have this default value, and the field on the template itself does not have such a value or any default value.
| |
You can set the "Hidden" file attribute. Sitecore will not patch in any hidden files, even if they have the .config extension. The same is also true for folders, setting the "Hidden" attribute will mean the folder is not processed and the files contained within will not be loaded either.
You can find the exact code in LoadAutoIncludeFiles() method in Sitecore.Configuration.ConfigReader class:
protected virtual void LoadAutoIncludeFiles(ConfigPatcher patcher, string folder)
{
if (!Directory.Exists(folder))
return;
foreach (string file in Directory.GetFiles(folder, "*.config"))
{
if ((File.GetAttributes(file) & FileAttributes.Hidden) == (FileAttributes) 0)
patcher.ApplyPatch(file);
}
foreach (string directory in Directory.GetDirectories(folder))
{
if ((File.GetAttributes(directory) & FileAttributes.Hidden) == (FileAttributes) 0)
this.LoadAutoIncludeFiles(patcher, directory);
}
}
NOTE: The above is decompiled code and I have modified it for berevity.
| Is there a way to disable a config patch file without renaming or deleting it?
Let's say you want to temporarily exclude a .config file from being applied as a patch by Sitecore. Normally, you would either:
Delete the file;
Or rename it to have an extension different from .config.
Is there any other way of disabling a .config file? I don't want to change the file name or its contents (due to deployment process intricacies).
| |
Nick Hills started a project to enable Redis session state. You can find the details here:
http://blog.boro2g.co.uk/sitecore-redis-sessionstate-provider/
https://github.com/boro2g/Sitecore-Redis-Session-Provider
It comes with a warning though: it is not supported by Sitecore!
Context from links above:
Out the box Sitecore offers 3 options for how to handle session when you setup xDB. One option is to keep things in process (inProc). This is ok for testing in dev but isn’t suitable when you have > 1 front end content delivery nodes as each box wouldn’t be able to share the same information. The other two options are: Sql Server or Mongo. See the docs site for more information on how to configure these 2 approaches.
I’ve uploaded an early version of a Sitecore Redis SessionProvider to github: https://github.com/boro2g/Sitecore-Redis-Session-Provider
Conceptually the implementation of Session_End is easy to get your head around – when keys expire you raise up the corresponding events and Sitecore handles the rest. Redis makes this tricky as when keys timeout they don’t raise events and also the data is then gone, so how could it get flushed to xDB?
To work around this I’ve combined the logic in the SitecoreSessionStateStoreProvider which gives you the ability to poll the repository, along with some custom keys to manage the concept of expiration.
By default the asp.net redis implementation creates 3 types of keys:
DataKey e.g. “{” + applicationName + “_” + id + “}_Data”
LockKey e.g. “{” + applicationName + “_” + id + “}_Write_Lock”;
InternalKey e.g. “{” + applicationName + “_” + id + “}_Internal”;
The new entries will also be:
_log: this is a sorted set that keeps a record of all the marker sets
TimeoutKey e.g. “{” + applicationName + “_” + id + “}_Timeout” MarkerKey e.g. yyyy MM dd HH:mm:ss_Marker
Note, this will contain sets of items (i.e. everything that expires at that time)
These new keys are used to store when items are added and updated. They are also then referenced in the callback to validate whether specific entries should expire.
In the solution there are the implementation details for the provider along with a console app for monitoring a solution.
console app
Do let us know how you get on! It’s worth noting this is currently an alpha release that’s undergone basic testing – any feedback / pull-requests would be greatly appreciated.
FYI If you want to get Redis running locally you can install via chocolatey: https://chocolatey.org/packages/redis-64
| Redis Session Manager
I am looking to replace the SQL Session Manager that is provided by Sitecore and I wondered if anyone else had worked on Redis session provider for Sitecore?
| |
It turned out that I just need to clear my browser cache. Once I did that then the dashboard loaded properly.
| Why is my Experience Analytics dashboard blank in Sitecore 8.1 Update-3?
Anyone know why my Experience Analytics dashboard in Sitecore 8.1 Update-3 would be blank like this?
EDIT: in the network console for my browser I am seeing the following error:
| |
To make the save action run on CD, check the Client Action box on the Save Action.
| Identify Contact in WFFM action
I need to call Tracker.Current.Session.Identify(emailAddress) on my Contact in a save action in a WFFM form. However the onSave action is triggered on the CM, where Tracker.Current is null.
Is there a pipeline where I could do this on the CD?
| |
Not quite. But here's what I would do.
Serialize your item
Delete the original item, instructing Sitecore to delete all references
Deserialize your item
Requires access to the Developer Tab, but is completely OOTB.
EDIT: updated to include a few additional ways to go about it
Packager
Doesn't require access to serialization tools.
Package your item
Delete the original item, instructing Sitecore to delete all references
Install your item package
Content Editor
Works, but will give your item a new ID.
Duplicate your item via Content Editor
Delete the original item, instructing Sitecore to delete all references
Rename your duplicated item back to original name
Publish/Transfer
For super users.
Publish your item
Delete the original item, instructing Sitecore to delete all references
Transfer your item back to master via Content Editor
| Removing all references to an item using OOTB tools
Is there a way, in one fell swoop, to remove all references to a item?
I know that it's possible to view a list of referring items from the report but is there anything out-of-box to handle the removal of its attachments in bulk or am I forced to go through the list removing references one at a time? I don't want to delete the item, just its association to other items.
| |
I think you may be missing type matches within your field map.
Try adding this section before your <fieldNames> section
<typeMatches hint="raw:AddTypeMatch">
<typeMatch typeName="string" type="System.String" fieldNameFormat="{0}_s" settingType="Sitecore.ContentSearch.SolrProvider.SolrSearchFieldConfiguration, Sitecore.ContentSearch.SolrProvider" />
</typeMatches>
I grabbed that from the example Sitecore.ContentSearch.Solr.DefaultIndexConfiguration.config file
Alternatively, you can try referencing the default field map like this:
<fieldMap ref="contentSearch/indexConfigurations/defaultSolrIndexConfiguration/fieldMap">
| Adding a field to a custom SOLR index configuration
I am moving indexes from Lucene to Solr. Almost everything is working again, except a few custom indexes that have their own index configuration and had some field added to the fieldMap. Other custom indexes are working. The error I get when starting the site is:
[KeyNotFoundException: The given key was not present in the
dictionary.] System.Collections.Generic.Dictionary`2.get_Item(TKey
key) +13763335
Sitecore.ContentSearch.SolrProvider.SolrFieldMap.AddFieldByFieldName(XmlNode
configNode) +618
[TargetInvocationException: Exception has been thrown by the target of
an invocation.] X.X.Web.Global.Application_Error(Object
sender, EventArgs e) in
...\Global.asax.cs:76
System.Web.HttpApplication.RaiseOnError() +211
[HttpException (0x80004005): Exception has been thrown by the target
of an invocation.]
System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext
context, HttpApplication app) +544
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr
appContext, HttpContext context, MethodInfo[] handlers) +186
System.Web.HttpApplication.InitSpecial(HttpApplicationState state,
MethodInfo[] handlers, IntPtr appContext, HttpContext context) +172
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr
appContext, HttpContext context) +402
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr
appContext) +343
[HttpException (0x80004005): Exception has been thrown by the target
of an invocation.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +579
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context)
+112 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest
wr, HttpContext context) +716
The index config now:
<indexConfigurations>
<CustomIndexConfiguration ref="contentSearch/indexConfigurations/defaultSolrIndexConfiguration">
<fieldMap type="Sitecore.ContentSearch.SolrProvider.SolrFieldMap, Sitecore.ContentSearch.SolrProvider">
<fieldNames hint="raw:AddFieldByFieldName">
<field fieldName="text" returnType="string" />
<field fieldName="webshops" returnType="string" />
<field fieldName="attributes" returnType="string" />
</fieldNames>
</fieldMap>
<documentOptions type="Sitecore.ContentSearch.SolrProvider.SolrDocumentBuilderOptions, Sitecore.ContentSearch.SolrProvider">
...
</documentOptions>
</CustomIndexConfiguration>
</indexConfigurations>
My old Lucene config had a fieldMap like this:
<fieldNames hint="raw:AddFieldByFieldName">
<field fieldName="text" storageType="YES" indexType="UNTOKENIZED" vectorType="NO" boost="1f" type="System.String" settingType="Sitecore.ContentSearch.LuceneProvider.LuceneSearchFieldConfiguration, Sitecore.ContentSearch.LuceneProvider"/>
<field fieldName="webshops" storageType="YES" indexType="TOKENIZED" vectorType="NO" boost="1f" type="System.String" settingType="Sitecore.ContentSearch.LuceneProvider.LuceneSearchFieldConfiguration, Sitecore.ContentSearch.LuceneProvider"/>
<field fieldName="attributes" storageType="YES" indexType="TOKENIZED" vectorType="NO" boost="1f" type="System.String" settingType="Sitecore.ContentSearch.LuceneProvider.LuceneSearchFieldConfiguration, Sitecore.ContentSearch.LuceneProvider">
</fieldNames>
I am definitely missing something (otherwise I wouldn't get an error). Buy what?
Using Sitecore 8.1-upd3, Solr 4.10.3, Autofac 4.1, ...
| |
Yes there is. Depends on your Sitecore version but you can use: /sitecore/admin/pipelines.aspx
Sitecore Pipeline Profiler page
The Sitecore Pipeline Profiler page has been in from Sitecore 7 but is disabled by default.
You enable by renaming the /App_Config/Include/Sitecore.PipelineProfiling.config.disabled to remove the .disabled extension and setting the Pipelines.Profiling.Enabled setting in the file to true.
You can also set Pipelines.Profiling.MeasureCpuTime setting to true, this gives you additional information.
| Sitecore administration page to view all pipeline processors
Is there an administration page to view all pipeline processors that are configured in Sitecore and the order in which they will execute? I'm trying to verify that my custom processor is being inserted into the right place in the Sitecore pipeline but I don't see anything in the Sitecore control panel or the start menu on the Sitecore desktop to facilitate this.
| |
Remove all data from your shared session database and the errors will go away.
Your custom types have changed, but at the same time, old facet objects remain binary-serialized in your shared session database (as a part of Contact objects). And so your session store provider cannot deserialize them anymore.
.NET binary serialization doesn't throw exceptions when an object cannot be deserialized. Instead, it replaces the object with a TypeLoadExceptionHolder instance.
| TypeLoadExceptionHolder cannot be converted to type Sitecore.Analytics.Model.Framework.IFacet
So, I refactored some code related to my custom facets.
I pushed it to the stage and it doesn't throw any errors (of course).
I push it to production and it starts throwing this error over and over -- to the point that the Fail protection of IIS kicks in and restarts the app pool.
> 4876 10:35:40 WARN Overriding expired contact session lock for
> contact id: a13624a7-bcd0-41ca-93c2-9ba815419464 4876 10:35:40 ERROR
> Cannot create tracker. Exception: System.ArgumentException Message:
> Object of type 'System.Runtime.Serialization.TypeLoadExceptionHolder'
> cannot be converted to type
> 'Sitecore.Analytics.Model.Framework.IFacet'. Source: mscorlib at
> System.RuntimeType.TryChangeType(Object value, Binder binder,
> CultureInfo culture, Boolean needsSpecialCast) at
> System.RuntimeType.CheckValue(Object value, Binder binder, CultureInfo
> culture, BindingFlags invokeAttr) at
> System.Reflection.RtFieldInfo.UnsafeSetValue(Object obj, Object value,
> BindingFlags invokeAttr, Binder binder, CultureInfo culture) at
> System.Runtime.Serialization.FormatterServices.SerializationSetValue(MemberInfo
> fi, Object target, Object value) at
> System.Runtime.Serialization.ObjectManager.DoValueTypeFixup(FieldInfo
> memberToFix, ObjectHolder holder, Object value) at
> System.Runtime.Serialization.ObjectManager.CompleteObject(ObjectHolder
> holder, Boolean bObjectFullyComplete) at
> System.Runtime.Serialization.ObjectManager.DoNewlyRegisteredObjectFixups(ObjectHolder
> holder) at
> System.Runtime.Serialization.ObjectManager.RegisterObject(Object obj,
> Int64 objectID, SerializationInfo info, Int64 idOfContainingObj,
> MemberInfo member, Int32[] arrayIndex) at
> System.Runtime.Serialization.Formatters.Binary.ObjectReader.RegisterObject(Object
> obj, ParseRecord pr, ParseRecord objectPr, Boolean bIsString) at
> System.Runtime.Serialization.Formatters.Binary.ObjectReader.ParseObjectEnd(ParseRecord
> pr) at
> System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()
> at
> System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler
> handler, __BinaryParser serParser, Boolean fCheck, Boolean
> isCrossAppDomain, IMethodCallMessage methodCallMessage) at
> System.Web.Util.AltSerialization.ReadValueFromStream(BinaryReader
> reader) at
> System.Web.SessionState.SessionStateItemCollection.ReadValueFromStreamWithAssert()
> at
> System.Web.SessionState.SessionStateItemCollection.DeserializeItem(String
> name, Boolean check) at
> System.Web.SessionState.SessionStateItemCollection.get_Item(String
> name) at
> Sitecore.Analytics.Tracking.SharedSessionState.SharedSessionStateManager.LockAndLoadContact(Guid
> contactId) at
> Sitecore.Analytics.Tracking.ContactManager.TryLoadContact(Guid
> contactId, Int32 lockDurationMinutes) at
> Sitecore.Analytics.Pipelines.EnsureSessionContext.LoadContact.Process(InitializeTrackerArgs
> args) at (Object , Object[] ) at
> Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) at
> Sitecore.Analytics.Pipelines.EnsureSessionContext.EnsureSessionContextPipeline.Run(InitializeTrackerArgs
> args) at Sitecore.Analytics.DefaultTracker.EnsureSessionContext()
> at
> Sitecore.Analytics.Pipelines.CreateTracker.GetTracker.Process(CreateTrackerArgs
> args) at (Object , Object[] ) at
> Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) at
> Sitecore.Analytics.Tracker.Initialize()
>
> 4876 10:35:40 ERROR Application error. Exception:
> System.InvalidOperationException Message: Tracker.Current is not
> initialized Source: Sitecore.Analytics at
> Sitecore.Analytics.Pipelines.StartAnalytics.StartTracking.Process(PipelineArgs
> args) at (Object , Object[] ) at
> Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) at
> Sitecore.Analytics.Pipelines.StartAnalytics.StartAnalyticsPipeline.Run()
> at
> Sitecore.Mvc.Analytics.Pipelines.MvcEvents.RequestBegin.StartTracking.Process(RequestBeginArgs
> args) at (Object , Object[] ) at
> Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) at
> Sitecore.Mvc.Pipelines.PipelineService.RunPipeline[TArgs](String
> pipelineName, TArgs args) at
> Sitecore.Mvc.Routing.RouteHttpHandler.BeginProcessRequest(HttpContext
> context, AsyncCallback cb, Object extraData) at
> System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
> at System.Web.HttpApplication.ExecuteStep(IExecutionStep step,
> Boolean& completedSynchronously)
Any ideas?
I am running Sitecore 8.1 Update 2.
| |
Whenever dialogs stop working after Sitecore Upgrades, there are two things you should check:
Did you clear your browser cache (& cookies) as requested during the upgrade?
Does your deployment process overwrite any files in the /sitecore folder?
It is extremely common for an upgrade to go smoothly, but for some upgraded files to not make it back into your preferred deployment method. Go to http://dev.sitecore.net and grab the zipped web root of your target installation version. Compare the files in the zip with your installation folder. Guaranteed you have an incorrect file in /sitecore or you're overwriting a new /bin file with an older one from your deployment project.
| Why do I get an error when trying to open the Rebuild Reporting Database page in Sitecore 8.1?
I am simply trying to open up the page used for rebuilding the reporting server in Sitecore 8.1 - /sitecore/admin/rebuildreportingdb.aspx.
When I do that I get the following error:
>Could not resolve type name: Sitecore.ExperienceAnalytics.Client.Deployment.SegmentStorageProvider, Sitecore.ExperienceAnalytics.Client (method: Sitecore.Configuration.Factory.CreateFromTypeName(XmlNode configNode, String[] parameters, Boolean assert))
From what I can gather that means that either my Sitecore.ExperienceAnalytics.Client DLL is the wrong version or perhaps the ASPX page itself is not the most up to date version or something. The file version of my DLL is 1.2.1.5488. Any ideas on how to fix this?
| |
This is due to the Sitecore.Analytics.config. In the config file, you have the handler
<handler type="Sitecore.Analytics.Data.Items.ItemEventHandler, Sitecore.Analytics" method="OnItemSaved"/>
This is triggered when the item is being saved. So, the event item:renamed will trigger the event item:saved, hence executing the above handler.
So, in order to fix the issue, you need to make sure that mongoDB service is running.
If you are not using the xDB, you need to disable it in the Sitecore.Xdb.config as shown below:
Change
<setting name="Xdb.Enabled" value="true" />
to
<setting name="Xdb.Enabled" value="false" />
And change
<setting name="Xdb.Tracking.Enabled" value="true" />
to
<setting name="Xdb.Tracking.Enabled" value="false" />
| Error installing a content package on a fresh install of Sitecore 8.1 Update 3
I am installing content under \sitecore\content\home on a fresh install and I am getting the following error. I made sure all the templates needed are in place.
ManagedPoolThread #9 10:57:28 ERROR Installation failed: System.AggregateException: One or more exceptions occurred while processing the subscribers to the 'item:renamed' event.
at Sitecore.Events.Event.EventSubscribers.RaiseEvent(String eventName, Object[] parameters, EventResult result)
at Sitecore.Events.Event.RaiseEvent(String eventName, Object[] parameters)
at Sitecore.Events.Event.RaiseItemSaved(Object sender, ItemSavedEventArgs args)
at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
at Sitecore.Data.Engines.EngineCommand`2.RaiseEvent[TArgs](EventHandler`1 handlers, Func`2 argsCreator)
at Sitecore.Data.Engines.EngineCommand`2.Execute()
at Sitecore.Data.Engines.DataEngine.SaveItem(Item item)
at Sitecore.Data.Managers.ItemProvider.SaveItem(Item item)
at Sitecore.Data.Managers.PipelineBasedItemProvider.ExecuteAndReturnResult[TArgs,TResult](String pipelineName, String pipelineDomain, Func`1 pipelineArgsCreator, Func`1 fallbackResult)
at Sitecore.Data.Managers.PipelineBasedItemProvider.SaveItem(Item item)
at Sitecore.Data.Items.ItemEditing.AcceptChanges(Boolean updateStatistics, Boolean silent)
at Sitecore.Install.Items.ItemInstaller.UpdateItemDefinition(Item targetItem, XmlVersionParser parser)
at Sitecore.Install.Items.ItemInstaller.GetVersionInstallMode(PackageEntry entry, ItemReference reference, XmlVersionParser parser, ItemInstallerContext context, Boolean& removeVersions)
at Sitecore.Install.Items.ItemInstaller.InstallEntry(PackageEntry entry)
at Sitecore.Install.Items.ItemInstaller.Flush()
at Sitecore.Install.Framework.SinkDispatcher.Flush()
at Sitecore.Install.Utils.EntrySorter.Flush()
at Sitecore.Install.Zip.PackageReader.Populate(ISink`1 sink)
at Sitecore.Install.Utils.EntrySorter.Populate(ISink`1 sink)
at Sitecore.Install.Installer.InstallPackage(String path, Boolean registerInstallation, ISource`1 source, IProcessingContext context)
at Sitecore.Install.Installer.InstallPackage(String path, IProcessingContext context)
at Sitecore.Shell.Applications.Install.Dialogs.InstallPackage.InstallPackageForm.AsyncHelper.<Install>b__4()
at Sitecore.Shell.Applications.Install.Dialogs.InstallPackage.InstallPackageForm.AsyncHelper.CatchExceptions(ThreadStart start)
| |
Is you want to use the database represented by Sitecore.Context.Database then you should use SitecoreContext.
The service SitecoreContentContext is a wrapper for the database Sitecore.Context.ContentDatabase.
If the internal database used by the Glass service is null, you should check the appropriate static property.
If you want to wrap a specific database you should use SitecoreService e.g: new SitecoreService("master").
If you want to just grab a Sitecore Item, as in this code:
var item = context.GetItem<Sitecore.Data.Items.Item>("/sitecore/content/home");
Then you are probably better just using the Sitecore Database itself. Use Glass when you are working with models and not raw Sitecore items.
| Glass SitecoreContentContext has Database property null
I'm trying to get the Sitecore context using:
var context = new SitecoreContentContext();
var item = context.GetItem<Sitecore.Data.Items.Item>("/sitecore/content/home");
But the item assignment throws a Null Exception Error. When I debug the context variable, the property Database is null. If I set that property to "master" on debug mode, it works. But I don't know why that property null.
Does any one have any advice?
Thanks
| |
In your AdditionalInfoFacet constructor, change this line:
EnsureAttribute<string>(FIELD_OPT_IN);
To this:
EnsureAttribute<bool>(FIELD_OPT_IN);
You need to register your boolean attribute with the correct type.
| How to store booleans in a custom facet?
Does Sitecore support store booleans in a custom facet?
I have the following interfaces:
using Sitecore.Analytics.Model.Framework;
using System;
namespace MySite.Models.Facets
{
public interface IAdditionalInfoCommunicationElement : IElement
{
DateTime Sent { get; set; }
string ContactType { get; set; }
string Message { get; set; }
}
}
using Sitecore.Analytics.Model.Framework;
namespace MySite.Models.Facets
{
public interface IAdditionalInfoFacet : IFacet
{
string Company { get; set; }
string RevenueRange { get; set; }
string Industry { get; set; }
string SubIndustry { get; set; }
IElementCollection<IAdditionalInfoCommunicationElement> Communications { get; }
bool OptIn { get; set; }
}
}
and the following classes:
using Sitecore.Analytics.Model.Framework;
using System;
namespace MySite.Models.Facets
{
[Serializable]
public class AdditionalInfoCommunicationElement: Element, IAdditionalInfoCommunicationElement
{
private const string FIELD_SENT = "Sent";
private const string FIELD_CONTACT_TYPE = "Contact Type";
private const string FIELD_MESSAGE = "Message";
public AdditionalInfoCommunicationElement()
{
EnsureAttribute<DateTime>(FIELD_SENT);
EnsureAttribute<string>(FIELD_CONTACT_TYPE);
EnsureAttribute<string>(FIELD_MESSAGE);
}
public DateTime Sent
{
get { return GetAttribute<DateTime>(FIELD_SENT); }
set { SetAttribute(FIELD_SENT, value); }
}
public string ContactType
{
get { return GetAttribute<string>(FIELD_CONTACT_TYPE); }
set { SetAttribute(FIELD_CONTACT_TYPE, value); }
}
public string Message
{
get { return GetAttribute<string>(FIELD_MESSAGE); }
set { SetAttribute(FIELD_MESSAGE, value); }
}
}
}
using Sitecore.Analytics.Model.Framework;
using System;
namespace MySite.Models.Facets
{
[Serializable]
public class AdditionalInfoFacet : Facet, IAdditionalInfoFacet
{
public const string FACET_NAME = "Company Info";
private const string FIELD_COMPANY = "Company";
private const string FIELD_INDUSTRY = "Industry";
private const string FIELD_SUB_INDUSTRY = "SubIndustry";
private const string FIELD_REVENUE_RANGE = "RevenueRange";
private const string FIELD_OPT_IN = "OptIn";
public AdditionalInfoFacet()
{
EnsureAttribute<string>(FIELD_COMPANY);
EnsureAttribute<string>(FIELD_INDUSTRY);
EnsureAttribute<string>(FIELD_SUB_INDUSTRY);
EnsureAttribute<string>(FIELD_REVENUE_RANGE);
EnsureAttribute<string>(FIELD_OPT_IN);
EnsureCollection<IAdditionalInfoCommunicationElement>(FACET_NAME);
}
public string Company
{
get { return GetAttribute<string>(FIELD_COMPANY); }
set { SetAttribute(FIELD_COMPANY, value); }
}
public string Industry
{
get { return GetAttribute<string>(FIELD_INDUSTRY); }
set { SetAttribute(FIELD_INDUSTRY, value); }
}
public string SubIndustry
{
get { return GetAttribute<string>(FIELD_SUB_INDUSTRY); }
set { SetAttribute(FIELD_SUB_INDUSTRY, value); }
}
public string RevenueRange
{
get { return GetAttribute<string>(FIELD_REVENUE_RANGE); }
set { SetAttribute(FIELD_REVENUE_RANGE, value); }
}
public IElementCollection<IAdditionalInfoCommunicationElement> Communications
{
get
{
return GetCollection<IAdditionalInfoCommunicationElement>(FACET_NAME);
}
}
public bool OptIn
{
get { return GetAttribute<bool>(FIELD_OPT_IN); }
set { SetAttribute(FIELD_OPT_IN, value); }
}
}
}
But the following code snippet:
if (registration.ForceOptIn == true || registration.ShowOptIn == false || (registration.ShowOptIn == true && !string.IsNullOrWhiteSpace(registration.OptIn)))
{
additionalInfo.OptIn = true;
}
else
{
additionalInfo.OptIn = false;
}
Throws the following error:
> Exception: System.InvalidCastException Message: Unable to cast object
> of type
> 'Sitecore.Analytics.Model.Framework.ModelAttributeMember`1[System.String]'
> to type
> 'Sitecore.Analytics.Model.Framework.IModelAttributeMember`1[System.Boolean]'.
> Source: Sitecore.Analytics.Model at
> Sitecore.Analytics.Model.Framework.Element.SetAttribute[TValue](String
> name, TValue value) at
> MySite.Analytics.ContactManagement.RegisterContact(Registration
> registration) in
> C:\SRC\Main\Sitecore\MySite.Analytics\ContactManagement.cs:line 127
To me it look like everywhere I reference OptIn I am using a bool, but this error seems to indicate I am using a string somewhere?
I am running Sitecore 8.1 Update 2
| |
No, it doesn't work this way.
You can use the identification API to tell Sitecore: the current user is this contact. You would normally use this API when the user logs in.
Once you implement this, the users will log in and thus identify themselves to xDB.
Now, the user can log in to your site from multiple devices, or in several browsers on the same machine. Later on, even if he's not logged in anymore, xDB will still remember the last associated contact using a custom cookie.
If the user opens browser sessions from two or more devices, all simultaneous user sessions will have a common, shared, session. What this allows you to do is modify the contact in one session and access that changed state in another session simultaneously.
So there is no magical way for Sitecore to know who the user is if there are no identifying cookies in his browser, or e.g. a custom URL argument containing a contact ID. Shared session is about sharing state between multiple parallel sessions. Read more here:
https://doc.sitecore.net/sitecore_experience_platform/setting_up__maintaining/xdb/session_state/session_state
| Sitecore shared session across browsers
I have seen that the sitecore xDB allows a user to be identified across browsers. For example, if the user has logged in on Firefox and when he opens Chrome, he is already identified.
I want to know if the shared session can be tested locally. That is on my laptop, trying to reproduce the above example. I have a sitecore v8.1 instance running. I searched almost everywhere on the net but could not find any information. Even the Sitecore documentation it is not so clear.
| |
I would check to ensure that your CD and CM servers system time are all in sync. I've seen a difference of just a few seconds cause issues with remote events/event queue.
| Issue with CD index not being updated after updating CM for Sitecore 8.1
I have the following setup
1 CM server
1 CD server
Sitecore 8.1
We have a custom Lucene index that is updating with no problem on our CM server but not on our CD server. I checked the logs and it doesn't seem to show anything that would be related to this issue. I also checked that the index was added to the EventQueue table and it is added to this table to run. The instance names for the StabilitySettings.config are the same. This was working fine yesterday and suddenly stopped working today and no new code changes were added. When I check the Crawling log on the CD server I only see the following text
IndexCustodian. FullRebuild triggered on index {MyIndexName}
I don't see where it is adding the items or starting and stopping the crawl.
Any one have any ideas where I can look at to see what might be happening?
I am thinking about copying the index from CM to CD as a temp solution for now.
Update: We applied SwitchMasterToWeb script and cannot login into CD now.
| |
TDS 5.1 added the ability to manage roles within TDS. You have to enable management of roles in TDS in the project. This is done by opening the TDS project properties and, on the General Property tab, enabling the "Manage Sitecore Roles in TDS" check box:
Once you've enabled this, a folder item called "Sitecore Roles" will appear. From there, you can manage roles in much the same way as you can manage items.
Hedgehog has documented this functionality here: https://hedgehogdevelopment.github.io/tds/chapter4.html#sync-sitecore-roles.
| How can I copy roles between environments using TDS?
Normally I use TDS to move Sitecore items from one environment to the next (e.g. dev to QA to stage to prod). For many sites, being able to move items is sufficient. However, some sites have specific roles that need to be moved from environment to environment.
I have been serializing and unserializing users and roles and moving those files, but that's an error-prone process.
Is there a method/tool/process to automate moving roles and users between environments?
| |
These are hardly hidden, but maybe lesser known?
F9 in Content Editor brings up the Site Publish dialog.
Sitecore Rocks
There are so many incredible pages in the Admin folder that can help you debug stuff. ShowConfig.aspx for your compiled Web.Config. Cache.aspx for cache tuning...
Developer Center is still in Sitecore 8.x. You can get there by appending "/sitecore/shell/default.aspx?xmlcontrol=IDE" to your Sitecore path.
| Hidden Features of Sitecore CMS?
This came to my mind after I saw the following question https://stackoverflow.com/q/9033/468718 and also https://stackoverflow.com/questions/tagged/hidden-features
We, Sitecore developers know the basics.
Some even mastered the areas like EXM, WFFM, Workflow, Powershell Extensions, etc.
But what are the most hidden features or tricks of Sitecore that people barely know it exists in Sitecore?
| |
You will need to have only one database. In other words, if you have 3 CM Servers, all of them should be connected to the same database.
For running of tasks, that is, scheduled jobs, you can setup one of your CM server as the job server. All the jobs will be performed only on one server (job server). If you are using the same database, all the CM will have the same content, hence enabling your CM Servers to be in sync.
Moreover, you will need to make use of event queue. So you need to make sure that the event queue setting is set to true in the Sitecore.config file found in the App_Config folder if you are using Sitecore 8 or check in the web.config if you are using Sitecore 6.x to 7.x. You also need to configure your Scalability Setting since you have have one CM Server which will act as the job server. More information on how to setup the Scalability setting can be found at my blogpost here
| Setting up multiple CM servers
We are setting up multiple Sitecore CM servers.
Do we need to do anything more then what is covered in this documentation for setting up CMs. The documentation covers just giving each instance of CM a unique name.
sc8CM1
If you have multiple CM servers, give each a unique name, such as:
sc8CM2
sc8CM3
So what else is there to be aware of, I would particularly be keen to know about:-
Will the CM systems conflict in anyway?
I would like to know if it is preferred to run Tasks from one CM and not both.
How do we manage syncing content between the two?
I would appreciate any other advice, if I have missed something make me aware.
| |
We had exactly this problem to solve on the current project that I'm working on.
I wanted to use something like this for Umbraco which allows you to set a focus point:
https://our.umbraco.org/documentation/getting-started/backoffice/property-editors/built-in-property-editors/image-cropper
However unfortunately despite looking extensively I couldn't find anything that had been built already.
There are a couple of modules such as this:
https://marketplace.sitecore.net/en/Modules/Image_Cropper.aspx
And this:
https://marketplace.sitecore.net/en/Modules/ImageProcessor_Module.aspx
Which I looked at but they don't support setting a focus point unfortunately.
So in the end we implemented our own getMediaStream pipeline processor using code similar to this excellent post by Anders Laub to center crop the images:
https://laubplusco.net/make-sitecore-deliver-images-fits-screen-part-2/
As part of this we also implemented support for responsive images with picture element and srcset + similar support for background images too. This means for smaller devices (such as iPhone & iPads) we call the custom media handler with a request for a medium, small image which means smaller file size and a faster experience for the user on smaller screens. We also handle Retina images in this way too.
It outputs markup similar to the following:
<picture>
<source data-srcset="https://mysite.com/-/media/group-image.jpg?mw=374&amp;mh=238&amp;as=1&amp;centercrop=1, https://mysite.com/-/media/group-image.jpg?mw=561&amp;mh=357&amp;as=1&amp;centercrop=1 2x" media="(min-width: 800px)"
srcset="https://mysite.com/-/media/group-image.jpg?mw=374&amp;mh=238&amp;as=1&amp;centercrop=1, https://mysite.com/-/media/group-image.jpg?mw=561&amp;mh=357&amp;as=1&amp;centercrop=1 2x">
</picture>
I also created a focus point setting tool for the content editor, but haven't yet fully tested it so we are using centre crop on it's own currently. Once I complete it, if there is enough demand to do so I'll try and package it up as a module if I can.
--Update--
This is what the focus point selector looks like currently, it's built using SPEAK UI and allows the user to click on the image and stores the x/y of the focus point. This can then be picked up by the image processor and used instead of the centre of the image:
Anyway hopefully this will get you started with things and give you ideas to consider.
Further Update
I wasn't allowed to open source this but Saad Khan built something similar which you can find a blog post on here:
https://inverseproportion.wordpress.com/2017/04/12/image-field-with-focus-cropper-in-sitecore/
This Module can be found on the marketplace here (and on Github):
https://marketplace.sitecore.net/en/Modules/A/Advance_Image_Field.aspx
There is a video on how it works here too: https://www.youtube.com/watch?v=JxqHYoASUx0&feature=youtu.be
I think it works in Sitecore 8 but I'm not sure about Sitecore 9. You may find the code is more up to date on Github.
Another Interesting Article
This blog post is in Dutch but if you use Google Translate it is a good read and might give you some ideas on how to approach this using SPEAK 3 instead:
https://blog.comspace.de/automatisierter-zuschnitt-von-bildern-in-sitecore-mit-ki/
BrainJocks also have support for this in their BrainJocks SCORE™ 3.0 product for Sitecore:
https://jockstothecore.com/finally-support-for-responsive-images-in-sitecore/
| Better editorial image manipulation tools in Sitecore CMS
I often have issues with sites that have multiple aspect-ratios in renderings which reference a single media item.
For example: On a listing page a 1:1 aspect ratio (square) thumbnail is used to list several images, yet on an article detail page that same media item is displayed in a 16:9 (widescreen) aspect ratio across the top of the page.
The causes issues with content editors who don't carefully crop their source image before upload. Instead they upload a single image which may work for one aspect ratio well, but would be less-than ideal for the square thumbnails.
How have you solved this problem in Sitecore?
Ideally you'd have a tool in the Media Library which allowed graphical selection of a focal point in the image and a dynamic image resizing library which attempts to keep that focal point as close to the center of the image throughout all resizes and aspect ratio changes. Bonus points if this tool can automatically make focal point suggestions based on machine learning ;)
Are you using a community module? A third party product? Or do you just rely on consistent aspect ratios and avoid the issue?
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.