output
stringlengths
34
25.7k
instruction
stringlengths
81
31k
input
stringclasses
1 value
Use reflector to look into OnLoad implementation of SelectStandardMessage Action Dialog (Sitecore.Modules.EmailCampaign.UI.Dialogs.ActionDialogs, SelectStandardMessage, Sitecore.EmailCampaign). I am not sure what code is inside your version(could differs from one revision to another). Mine is only for example: protected override void OnLoad(System.EventArgs e) { if (!Context.ClientPage.IsEvent) { this.MessageTree.RootItems = ( from managerRoot in Factory.Instance.GetManagerRoots() select managerRoot.InnerItem.ID.ToString()).ToList<string>(); this.MessageTree.ExcludeTemplatesForProcess.AddRange(new string[] { "{EFC3A4B6-6C05-45F4-8220-2D0291359DD5}", "{FE8D604D-26F6-426D-A3E2-E4EDFF091B47}" }); this.MessageTree.ItemFilterForProcess = new System.Func<Item, bool>(SelectStandardMessage.CheckMessageType); this.MessageTree.ExcludeTemplatesForDisplay.AddRange(new string[] { "{D8AD4B81-9269-4868-949F-37D1C28687E5}", "{69474581-3668-4FED-B0F0-0B88C2532CAE}", TemplateIDs.Folder.ToString() }); this.MessageTree.IncludeTemplatesForSelection.Add("{A0EA9681-5C86-43AB-80F7-C522DADF6F12}"); this.MessageTree.StopTemplates.Add("{A0EA9681-5C86-43AB-80F7-C522DADF6F12}"); this.MessageTree.InitTree(); string text = this.IsAutomationRequest ? base.GetParameterValueByKey("StandardMessageId", null) : WebUtil.GetQueryString("selItem"); if (!string.IsNullOrEmpty(text)) { this.SetSelectedMessageNode(text); } } base.OnLoad(e); } When you will review OnLoad implementation you will get answer what templates are included, what templates are excluded.
Cannot send emails as an Engagement Action When selecting the action Send Email Campaign Message for an engagement plan in design phase, the dialog box opened up, contains all Email Campaign managers for all sites, but does not include emails created under it. It only shows redirects in email campaign manager. Not sure why this is not working in Sitecore 8.1 How do I set the data I see here? The Engagement Automation Action: Send Email Campaign message has a Editor Url that gets its dialog with options the value is as shown below http://sitecore/shell/default.aspx?xmlcontrol=EmailCampaign.SelectStandardMessage I was not able to find the control. Don't know how to solve this. Not able to send any emails as an engagement action.
This is expected behaviour. The Sitecore Powershell Console is designed, so that it can operate and "reconnect" to sessions that have otherwise timed out. It is not directly linked to your Sitecore Desktop session. (I'm not a guru when it comes to SPE, but that's how I read it). Reference: http://blog.najmanowicz.com/2014/10/26/sitecore-powershell-extensions-persistent-sessions/ Where it states: This is because the Console enables you to keep continuity between the commands you execute and in fact is handled completely differently than the other interactions – through a web service.
Session Timeout in sitecore powershell [![Ideal Session Timeout in Powershell console][1]][1] I have noticed this few times before &amp; I have intentionally recreated today to confirm on how console would respond when there is a session timeout. Other dialogs, windows or applications/modules in Sitecore would redirect to login page when we have session timeout case &amp; I was expecting similar behavior with PowerShell console. Please correct me if I am missing or misconception on this? FYI: I have explicitly set SessionState timeout to 1 min :( *Does this behavior applies to Powershell ISE ?
This is a known defect. You should request hotfix 434449 from Sitecore Support. Or just follow these steps: Download the hotfix DLL: a) For Sitecore 8.0: Sitecore.Support.434449.dll b) For Sitecore 8.1 Update 2 or later: Sitecore.Support.434449.81.dll Put the DLL to your website's bin folder. Create a .config patch under App_Config/Include/zzz. a) If you have Sitecore 8.0, put the following content in the patch file: <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:x="http://www.sitecore.net/xmlconfig/"> <sitecore> <pipelines> <initialize> <processor type="Sitecore.Support.Forms.Mvc.Pipelines.AddCustomMetadataProvider, Sitecore.Support.434449" patch:instead="*[@type='Sitecore.Forms.Mvc.Pipelines.AddCustomMetadataProvider, Sitecore.Forms.Mvc']" /> </initialize> </sitecore> </configuration> b) For Sitecore 8.1 Update 2 or later: <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:x="http://www.sitecore.net/xmlconfig/"> <sitecore> <pipelines> <initialize> <processor type="Sitecore.Support.Forms.Mvc.Pipelines.Initialize.AddCustomMetadataProvider, Sitecore.Support.434449.81" patch:instead="*[@type='Sitecore.Forms.Mvc.Pipelines.Initialize.AddCustomMetadataProvider, Sitecore.Forms.Mvc']"> <param name="perRequestStorage" ref="/sitecore/wffm/data/perRequestStorage" /> <param name="corePipeline" ref="/sitecore/wffm/corePipelineWrapper" /> </processor> </initialize> </sitecore> </configuration> Source: https://sitecorelogy.com/2016/07/19/fixed-sitecore-wffm-creates-a-duplicate-field-section-upon-submission-when-exceeded-to-10-sections/
Are sections inside Sitecore Webforms for Marketers restricted to 10? I am using Sitecore.NET 8.1 (rev. 160519) + Web Forms for Marketers 8.1.rev. 160523. I created a sample form with 12 sections and 1 single-line text field in each section (total: 12 text-box fields). When I am debugging the list of field/value in a custom Save Action in "AdaptedResultList", the field value of second Section's field + field value of eleventh section's field is getting replaced with value of 12th section's field. If I keep sections upto only 10 then I am perfectly getting the value . Is Sitecore WFFM restricted up to 10 sections? Not Working If :- Working If :- Sec 1 :- Field 1 Sec 1 :- Field 1 Sec 2 :- Field 2 Sec 2 :- Field 2 Sec 3 :- Field 3 Sec 3 :- Field 3 Sec 4 :- Field 4 Sec 4 :- Field 4 Sec 5 :- Field 5 Sec 5 :- Field 5 Sec 6 :- Field 6 Sec 6 :- Field 6 Sec 7 :- Field 7 Sec 7 :- Field 7 Sec 8 :- Field 8 Sec 8 :- Field 8 Sec 9 :- Field 9 Sec 9 :- Field 9 Sec 10:- Field 10 Sec 10:- Field 10,Field 11,Field 12 Sec 11 :- Field 11 Sec 12 :- Field 12
The custom Save Action code is calling Execute method but the CD servers are actually not able to read the Uploaded File. I checked in the CM server and the uploaded file is actually saved in the Master Database, but the CD servers are unable to process the request since the files are not getting saved in the Web database. Make sure of two things: 1) Media is stored in database (not as files) 2) You publish the file from master to web after upload OR save it to both databases
Sitecore - WFFM - File Upload not working in CD enviornment We have a multi server environment with 2 CM and 4 CD servers. We are working on Sitecore 8.1 Update3 and WFFM for 8.1 update 3. The issue we are facing is related to the WFFM File Upload control not working on the CD servers. The custom Save Action code is calling Execute method but the CD servers are actually not able to read the Uploaded File. I checked in the CM server and the uploaded file is actually saved in the Master Database, but the CD servers are unable to process the request since the files are not getting saved in the Web database. Currently, we are receiving error message stating – 6024 15:07:07 INFO AUDIT (extranet\Anonymous): [WFFM] Form {604586CC-BA15-4B08-9C09-599E6F61EA77} is saving to db 6024 15:07:07 WARN [WFFM] Index was outside the bounds of the array. Exception: System.IndexOutOfRangeException Message: Index was outside the bounds of the array. Source: TW.Web at TW.Web.WffmForm.SupplierContact.Execute(ID formId, AdaptedResultList adaptedFields, ActionCallContext actionCallContext, Object[] data) at Sitecore.Forms.Core.Dependencies.DefaultImplActionExecutor.ExecuteSaving(ID formID, ControlResult[] fields, IActionDefinition[] actionDefinitions, Boolean simpleAdapt, ID sessionID) Can any one please help me in making the config updates that is responsible for the CD servers to read the Uploaded WFFM Files. I have already made all the updates available on the WFFM installtion guide for multi server setup.
I solved this in two ways. Depending on your needs, one may be more suitable. The Simpler Way As was pointed out to me by Mark Cassidy's comment, replacing the standard Item Rendering behavior would meet the requirement, and not require a controller rendering or any of my original code. See the solution here: https://www.cmsbestpractices.com/sitecore-item-rendering-best-practice/ For More Customization The disadvantage of the first approach is that it exposes the Experience Editor features of all the controls on the Form Block, too, which we don't want; we want to prevent people from editing Form Blocks when they've been added to another page. To solve this issue, I updated my controller method as follows. The pertinent code was found by decompiling Sitecore DLLs. // FormBlock controller rendering action public ActionResult FormBlock() { var dataSource = this.GetDataSourceItem<IFormBlock>(); var dataSourceItem = SitecoreContext.ResolveItem(dataSource); var currentDevice = Sitecore.Context.Device; XmlNode deviceNode = new LayoutField(dataSourceItem).GetDeviceNode(currentDevice); var stringBuilder = new StringBuilder(); if (deviceNode != null &amp;&amp; deviceNode.HasChildNodes) { SiteContext siteContext = SiteContext.GetSite(Sitecore.Context.Site.Name); siteContext.SetDisplayMode(DisplayMode.Normal, DisplayModeDuration.Temporary); using (new SiteContextSwitcher(siteContext)) { var parser = new XmlBasedRenderingParser(); foreach (XmlNode renderingNode in deviceNode.ChildNodes) { Sitecore.Mvc.Presentation.Rendering rendering = parser.Parse(XElement.Parse(renderingNode.OuterXml), false); var renderingArgs = new RenderRenderingArgs(rendering, new StringWriter(stringBuilder)); CorePipeline.Run("mvc.renderRendering", renderingArgs); } } } return Content(stringBuilder.ToString()); }
How to render an MVC rendering in code I have two renderings. Let's call them Form Block and Complete Form. Complete Form has a placeholder on it that can contain Form Blocks. Form Blocks have a placeholder that can contain other components that make up the form. But here's the complicated part I want content editors to add components to Form Blocks using the Experience Editor, directly on the Form Block (in other words, not on the page that contains the Form Block). For this reason, there are presentation details set on the Form Block. When I render the Complete Form (with its list of Form Blocks), I want to get the rendered output of the Form Block using its presentation details, not the presentation details set on the Complete Form for it. Let me try to explain with some code When we render a Complete Form, one or more Form Blocks may get rendered. For each one, the FormBlock controller action gets called: // FormBlock controller rendering action public ActionResult FormBlock() { var dataSource = this.GetDataSourceItem<IFormBlock>(); var dataSourceItem = SitecoreContext.ResolveItem(dataSource); var currentDevice = Sitecore.Context.Device; var renderings = dataSourceItem.Visualization.GetRenderings(currentDevice, false); var stringBuilder = new StringBuilder(); foreach (var rendering in renderings) { // TODO: Render the rendering } return View("RawOutput", stringBuilder.ToString()); }
Here's how I would approach this: Define a rendering that shows an overlay on any page it's included in. When a user selects a country via this rendering: Send an AJAX request to the server; Take any actions needed based on the user's selection; Add a cookie to the user's browser indicating that a country has been chosen; Hide the overlay. Include this component as a part of every layout. Only render it in case the cookie is not set. This way, you don't need a separate page and redirection logic. Country selection will be (conditionally) shown on every page. An additional benefit of this approach is that you can use the same component to allow users to change their country, if that ever becomes a requirement.
Country selection page implementation I want to design a page where a user is taken to once they land on the site for the first time and they can select their country/language there, which gets stored as a cookie. After, the user is redirected back to the site. What are some possible approaches to handling this? I thought about setting the "country selection" page as the default page in configuration file, and check whether the cookie is there before everything is loaded -> redirect to regular "home" if yes, but this does not cover the case where the user comes from google/gets link from outside (would it maybe make sense to create an item renderer for this?) Thanks.
This is a known bug in Sitecore. Use this fix to solve the issue. To track the status of this bug with Sitecore Support, you can use the reference number 95735. Explanation The ModelFactory class uses a static dictionary under the cover. It stores a mapping of model interfaces to their implementation types, as defined in the configuration (see Sitecore.Analytics.Model.config). This dictionary is purely an optimization—it helps not to read the configuration every time. public static class ModelFactory { private static readonly IDictionary<Type, Type> typeMap = new Dictionary<Type, Type>(); // ... } Since this dictionary is static, it can be accessed by several threads simultaneously. The Dictionary class is not meant to be used concurrently, which is why its Insert method throws the obscure error you're seeing. This happens when two threads insert a new entry at the same time. This should be fixed by either respecting concurrency in the ModelFactory class (e.g. apply locks), or by using a ConcurrentDictionary instead. The fix I linked at the top substitutes the dictionary with a concurrent dictionary.
"Cannot create tracker" exception thrown from ModelFactory I am facing the following error: ERROR Cannot create tracker. Exception: System.IndexOutOfRangeException Message: Index was outside the bounds of the array. Source: mscorlib at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) at Sitecore.Analytics.Model.Framework.ModelFactory.GetConcreteType(Type elementType) at Sitecore.Analytics.Model.Framework.ModelFactory.CreateElement(Type elementType) at Sitecore.Analytics.Model.Framework.ModelFactory.CreateFacet(Type facetType) at Sitecore.Analytics.Model.Framework.Faceted.AddFacet(String name, Type type) at Sitecore.Analytics.Model.Framework.ModelFactory.CreateContact(ID id, IReadOnlyDictionary`2 facets) at Sitecore.Analytics.Data.ContactFactory.Create(ID id) at Sitecore.Analytics.Data.ContactRepository.CreateContact(ID id) 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() Per this post I verified that we have those config values present in our solution. Still, randomly I get this error on one of the CD servers and not on all. Any idea why?
Pages are "Created" when a user requests that page, but that doesn't mean that the content is new each time. You can setup caching on your renderings to limit the load on the server each time a page is requested. For the Google Search Appliance it is probably looking for last updated and cache control headers to check if the page has been modified and needs to be reindexed. For this you will need to decide what content on the page you want the crawler to care about and then make sure that when it changes, you update the last modified date. Also you should make sure that any cache control headers sent in the response have an appropriate expiry date/time on them. If your response is set to not cache, then everytime the crawler hits the page, it could see it as "updated" and re-index it.
When are Sitecore Pages created? Our Google Search Appliance is going crazy, reindexing each of our pages several times a day. The Google support specialist asked us if our pages were being generated dynamically or not. I know that each page in Sitecore is created dynamically from a template. However, what I don't know is when that page is created. Is each content page created at publish time, or is it created when a visitor requests the page?
After copying /sitecore/system/Field types/List Types/Multilist from List Type to the /sitecore/system/Field types/User Defined and renaming, I went over to Master, updated the template to the newly copied Multilist field type. It still did not work, only showing a basic textbox, no error on screen or in the logs. That then led me to check the /sitecore/system/Field types/User Defined folder, only to find it was not a Common/Folder template type at all, but instead a /sitecore/templates/System/Node template type. I then changed the template type in the Configure tab on User Defined to Common/Folder in Core, went back over to Master and the field started working immediately. I can only assume at this point that User Defined item was cast as a Node due to some template type mismatch when I imported it from an 8.1 Sitecore instance. I am somewhat curious as to why it failed so silently, and why the field type did indeed show up in the list, but the control rendering did not as much as even hit a breakpoint. Summary: After verifying your custom field is indeed set up correctly (Assembly/Class or controlPrefix:ControlClass) and are still having issues with it rendering at all, verify that the parent Folder type is indeed a Common/Folder.
Issue with Custom Field Type not rendering in Shell I created a custom Field in /sitecore/system/Field types/User Defined, called Role Selector. It inherits from a class called MultilistExBase (which I have brought into the project thanks to this post) which itself extends Sitecore.Shell.Applications.ContentEditor.MultilistEx. As soon as I create the field in the Core, that new field shows up in the list of available fields. But when I go to actually set the field on an instance of said template, it displays a textbox instead of a Multilist, with no errors. I have tried both defining the Assembly/Class for the field type and controlPrefix:RoleSelector with no success. I have also combed through the logs and found nothing as well. This project instance is Sitecore 8.0 (rev. 151127).
I don't have a definitive list anywhere, and without actually attempting to remove each service one at a time until it breaks, here is the list of role services we use on a "locked down" Content Delivery environment (no Sitecore shell): [X] Web Server (IIS) Web-Server [X] Web Server Web-WebServer [X] Common HTTP Features Web-Common-Http [X] Default Document Web-Default-Doc [ ] Directory Browsing Web-Dir-Browsing [X] HTTP Errors Web-Http-Errors [X] Static Content Web-Static-Content [X] HTTP Redirection Web-Http-Redirect [ ] WebDAV Publishing Web-DAV-Publishing [X] Health and Diagnostics Web-Health [X] HTTP Logging Web-Http-Logging [ ] Custom Logging Web-Custom-Logging [X] Logging Tools Web-Log-Libraries [ ] ODBC Logging Web-ODBC-Logging [X] Request Monitor Web-Request-Monitor [X] Tracing Web-Http-Tracing [X] Performance Web-Performance [X] Static Content Compression Web-Stat-Compression [X] Dynamic Content Compression Web-Dyn-Compression [X] Security Web-Security [X] Request Filtering Web-Filtering [X] Basic Authentication Web-Basic-Auth [ ] Centralized SSL Certificate Support Web-CertProvider [ ] Client Certificate Mapping Authentic... Web-Client-Auth [ ] Digest Authentication Web-Digest-Auth [ ] IIS Client Certificate Mapping Authe... Web-Cert-Auth [ ] IP and Domain Restrictions Web-IP-Security [ ] URL Authorization Web-Url-Auth [ ] Windows Authentication Web-Windows-Auth [X] Application Development Web-App-Dev [ ] .NET Extensibility 3.5 Web-Net-Ext [X] .NET Extensibility 4.5 Web-Net-Ext45 [X] Application Initialization Web-AppInit [ ] ASP Web-ASP [ ] ASP.NET 3.5 Web-Asp-Net [X] ASP.NET 4.5 Web-Asp-Net45 [ ] CGI Web-CGI [X] ISAPI Extensions Web-ISAPI-Ext [X] ISAPI Filters Web-ISAPI-Filter [X] Server Side Includes Web-Includes [X] WebSocket Protocol Web-WebSockets [ ] FTP Server Web-Ftp-Server [ ] FTP Service Web-Ftp-Service [ ] FTP Extensibility Web-Ftp-Ext [X] Management Tools Web-Mgmt-Tools [X] IIS Management Console Web-Mgmt-Console [ ] IIS 6 Management Compatibility Web-Mgmt-Compat [ ] IIS 6 Metabase Compatibility Web-Metabase [ ] IIS 6 Management Console Web-Lgcy-Mgmt-Console [ ] IIS 6 Scripting Tools Web-Lgcy-Scripting [ ] IIS 6 WMI Compatibility Web-WMI [ ] IIS Management Scripts and Tools Web-Scripting-Tools [ ] Management Service Web-Mgmt-Service Obviously your requirements will vary depending on your setup. If I had to guess at a minimum, I would go for the following: [X] Web Server (IIS) Web-Server [X] Web Server Web-WebServer [X] Common HTTP Features Web-Common-Http [X] Default Document Web-Default-Doc [ ] Directory Browsing Web-Dir-Browsing [X] HTTP Errors Web-Http-Errors [X] Static Content Web-Static-Content [ ] HTTP Redirection Web-Http-Redirect [ ] WebDAV Publishing Web-DAV-Publishing [X] Health and Diagnostics Web-Health [X] HTTP Logging Web-Http-Logging [ ] Custom Logging Web-Custom-Logging [X] Logging Tools Web-Log-Libraries [ ] ODBC Logging Web-ODBC-Logging [ ] Request Monitor Web-Request-Monitor [ ] Tracing Web-Http-Tracing [ ] Performance Web-Performance [ ] Static Content Compression Web-Stat-Compression [ ] Dynamic Content Compression Web-Dyn-Compression [ ] Security Web-Security [ ] Request Filtering Web-Filtering [ ] Basic Authentication Web-Basic-Auth [ ] Centralized SSL Certificate Support Web-CertProvider [ ] Client Certificate Mapping Authentic... Web-Client-Auth [ ] Digest Authentication Web-Digest-Auth [ ] IIS Client Certificate Mapping Authe... Web-Cert-Auth [ ] IP and Domain Restrictions Web-IP-Security [ ] URL Authorization Web-Url-Auth [ ] Windows Authentication Web-Windows-Auth [X] Application Development Web-App-Dev [ ] .NET Extensibility 3.5 Web-Net-Ext [X] .NET Extensibility 4.5 Web-Net-Ext45 [ ] Application Initialization Web-AppInit [ ] ASP Web-ASP [ ] ASP.NET 3.5 Web-Asp-Net [X] ASP.NET 4.5 Web-Asp-Net45 [ ] CGI Web-CGI [ ] ISAPI Extensions Web-ISAPI-Ext [ ] ISAPI Filters Web-ISAPI-Filter [ ] Server Side Includes Web-Includes [ ] WebSocket Protocol Web-WebSockets [ ] FTP Server Web-Ftp-Server [ ] FTP Service Web-Ftp-Service [ ] FTP Extensibility Web-Ftp-Ext [X] Management Tools Web-Mgmt-Tools [X] IIS Management Console Web-Mgmt-Console [ ] IIS 6 Management Compatibility Web-Mgmt-Compat [ ] IIS 6 Metabase Compatibility Web-Metabase [ ] IIS 6 Management Console Web-Lgcy-Mgmt-Console [ ] IIS 6 Scripting Tools Web-Lgcy-Scripting [ ] IIS 6 WMI Compatibility Web-WMI [ ] IIS Management Scripts and Tools Web-Scripting-Tools [ ] Management Service Web-Mgmt-Service PS. You can get/set these through the Get-WindowsFeature and Add-WindowsFeature PowerShell commands from an elevated prompt.
Which IIS role services are required for Sitecore? I'm working on a new Sitecore 8.1 dev/uat/production infrastructure. We would like to reduce our possible attack surface and have a hardened installation from the start. One of the Sitecore requirements is obviously IIS and the Web Server role! However I can't find any details about the features required for IIS. This either means that the defaults are necessary or perhaps it hasn't been deeply considered. Which role services are necessary for Sitecore to operate correctly?
"Administrator" users cannot be denied anything. They have access to everything by design. If you want to restrict access you'll need to add your user(s) to a custom role: define your own role (how-to here) and set the desired security on that role (by adding it to other roles and by denying access to items - preferably by breaking the inheritance). An overview of the available security roles is available here. You can use those to get the base of your custom role.
Restricting access for Sitecore Administrator We are having one problem to hide access to Template Manager, security editor and access Viewer option for a user with sitecore Administrator Role. To do this we denied read access for only select user with Administrator Role for to hide. But it is not working.
You are correct that the Translate button is what you are looking for. Since you are not seeing it when logged in with your user with the new role, your new role likely does not have the necessary sitecore/Sitecore Client Translating role that is required in order to see the button. Quick Fix Try logging in as an administrator and see if the button will display for you. If so, temporarily add the sitecore/Sitecore Client Translating role to the user that is experiencing the issue, then log in with the user with the new role, navigate to the Content Editor and click the Translate button to disable the duplicate display. Further Investigation If the above quick-fix doesn't do the trick, try the below to further investigate the issue. Note that for each of the below, you will (at the very least) need some familiarity with the Access Viewer (see official docs) and with how Sitecore calculates access rights for a security account on an item (see official docs). Investigating the Translate Chunk of the Ribbon In your screenshot, you are missing the entire Translate chunk of the ribbon, not just the Translate button itself. As such, we start by first investigating the Translate chunk of the ribbon. Log into Sitecore as an administrator, switch to the Core database, navigate to the Content Editor and traverse the tree until you find the /sitecore/content/Applications/Content Editor/Ribbons/Chunks/Translate item. This item represents the Translate chunk that (should) display in your Ribbon. Click on the Security tab, then click the Details button in the Security chunk of the ribbon (see the screenshot below). In the resulting window, note the security permissions that have been assigned for this item (see the sceenshot, below). Note that the security permissions that have been assigned reflect the security permissions assigned directly (not accounting for inherited security settings) to the entire Translate chunk in the ribbon. The security settings above are the OOTB settings for Sitecore 8.1 (I checked each version). If your security settings are different, either change them by clicking on the Assign button (next to the Details button in Security tab's ribbon) or use information gained to help you figure out which security account you should assign (even temporarily, if necessary) to your test user or new role in order to fix the issue. Investigating the Translate Button If you are unable to find any differences on the Translate chunk's item, try looking at the security settings for the Translate button's item, /sitecore/content/Applications/Content Editor/Ribbons/Chunks/Translate/Translate. If you are still unable to find the source of your issue, try opening up the Access Viewer (while still in the Core database) and looking there. You will want to select the role or test user experiencing the issue via the Account button or Roles and users quick selection box at the top left, and then drill down to the /sitecore/content/Applications/Content Editor/Ribbons/Chunks/Translate/Translate item (see screenshot, below). Be sure to look at the security settings along the way, or click on the Read access right of the desired item to see which security settings in the ancestry impacted the final result (see screenshot, below). Sitecore Support Whether or not the above helps you, this issue is worthy of a Sitecore Support ticket, since the duplicated field view really shouldn't display for users without the sitecore/Sitecore Client Translating role. If the above does not work for you, I would definitely file a Sitecore Support ticket and let them know the issue, what you did to try to investigate and resolve it, and work with them to investigate the issue further. Additional References Built-in Sitecore Security Roles (Official Documentation) Assigning Access Rights and How Access is Calculated (Official Documentation) Security Tools (Official Documentation) Access Rights (Official Documentation) Inheritance Access Right (Official Documentation)
Content Author sees compare mode of the item fields always On our Sitecore 8.1 site, we had a new content author role setup for the French-Canada culture. The problem is that if I log in as a user with this role and navigate to the Content Editor, I see all fields in compare/translate mode (see the screenshot, below). I checked the versions tab, in an attempt to disable the compare/translate mode, but I do not see the Translate button there (see the screenshot, below). Can you please let me know how to fix this? Note that we are using Claytablet integration for translations.
According to your requirement, you should look into creating a custom computed index field. This community article by John West describes the process of adding a custom computed field in details: https://community.sitecore.net/technical_blogs/b/sitecorejohn_blog/posts/sitecore-7-computed-index-fields Basically, all you have to do is to define a computed index field, with your custom logic in the ComputeFieldValue method (in your case -> iterate through item's children and collect all you need, e.g. names, etc.) The above article gives an example for Sitecore 7+, but in Sitecore 8+ the process is not very different
Custom Lucene Index Field with Children I want to create a custom field to be indexed in Lucene that has the children of the item being indexed. Is there an easy way to do this that I am overlooking?
You can use the [SitecoreParent] attribute for that: [SitecoreParent] public virtual BasePage Parent { get; set; } It is also mentioned in the Tutorial 17 (http://www.glass.lu/mapper/sc/tutorials/tutorial17)
GlassMapper Parent Item In my GlassMapper model I'm getting the children of the current page using the following declaration: public IEnumerable<BasePage> Subpages => GetChildren<BasePage>(TemplateId); Is there a similar method I could use to get the properties of the parent of the current page into a BasePage model? I can use the template ID of this item to get the Sitecore.Data.Items.Item parent of the page, but when I have this item I've been unable to convert it back into the BasePage model.
There are several reasons why this could happen. Since you do not see it in the web database, we can rule out auto-publish. Check these just to make sure they are not the root cause You could be referencing the master database directly Sitecore.Data.Database master = Sitecore.Configuration.Factory.GetDatabase("master") Unlikely since you stated the item is not published. Sitecore could be in Live Mode There is an patch file included in App_Config/Include named LiveMode.config.example Make sure it is not enabled Make sure that the master database was selected and not the web database Multi-Site Configuration Edits To properly configure multi-sites please on the SDN https://sdn.sitecore.net/Articles/Administration/Configuring%20Multiple%20Sites.aspx. You don't have access to the SDN. Also read John Wests blog https://community.sitecore.net/technical_blogs/b/sitecorejohn_blog/posts/sitecore-multisite-part-1-iis-challenges.
How content changed in ContentEditor is being displayed in website even item not published I changed content in one field in ContentEditor and then shifted to web database. Here I could see content change is not available which is fine because I haven't yet published but when I browsed the website that content change is being displayed. How is it possible even I didn't publish that item. Is there any way to debug this behavior? UPDATE 01/01/17 Following is multisite configuration at my laptop Sitecore.config <site name="SitecoreStaging" database="master" hostname="staging.sitecorewebsite.com" rootPath="/sitecore/content" startItem="/home" ... <site name="SitecoreLive" database="web" hostname="www.sitecorewebsite.com" rootPath="/sitecore/content" startItem="/home" ... <site name="website" database="web" rootPath="/sitecore/content" startItem="/home" ... Binding hosts entry 127.0.0.1 sitecorewebsite 127.0.0.1 www.sitecorewebsite.com 127.0.0.1 staging.sitecorewebsite.com Now in this case If I browse all these mentioned URLs content only displayed from master DB even if for two website database attribute is set to "master" But If I remove other and keep only "sitecorewebsite" configuration then I can see web content i.e. not from master which is correct. Looks like I am missing something.
From a architectural point of view there is no reason not to have everything in a single project. This will certainly make load and build times quicker - if that is the aim. The reason for splitting up modules into projects is to clearly define boundaries for modules so that dependencies are as visible as possible, which increases productivity, reduces cost of maintenance and simplifies extensibility. In other words: if you are comfortable with having your development team managing cross-module dependencies within a single Visual Studio project there is no reason to split up into several projects. There are even tools which can help you control the module dependencies in solutions with fewer projects. Projects Define Boundaries However, you should keep in mind that your project lives beyond the initial development phase - and most often beyond your and the initial development team's involvement. In a typical application lifecycle, the technical debt, dependency creep and other productivity decreasing factors happens in the delivery and maintenance phases. The ambitions of clean code and architecture often crumbles with deadlines, team handovers and quick patches. Solution structure is there to define the architecture - both in the short and long run. Defining boundaries as clearly as possible is very helpful in making sure your architecture stays clean. I recommend watching Anders Laubs talk from the Helix workshop at Symposium 2016 which covers boundaries and why we need them: https://youtu.be/C1OvZOVYous?t=14m38s.
Sitecore Helix/Habitat and Visual Studio structure The general trend these days is to limit the number of projects in a visual studio solution: The two project solution Project antipattern Multiple projects considered harmful Evolutionary project structure The helix documentation and Habitat are implemented with many many projects in the solution. This to me seems like a serious code smell. If I were to implement a Helix solution with a limited number of projects, how minimal could I go? I think I would start with 4: Project, Foundation, Features and Tests. What would I lose by not having 65 different projects? Or what do I gain by having them? If it's only organizational, then easy peasy. What dependency control is achieved with many projects? Maybe I'm missing something, but at this point, the pain seems to far outweigh the benefits.
Sitecore.Marketing.config file was missing in the include folder of the content delivery server..when i added it, everything worked fine!
WFFM sitecore 8.2 initial release on Content Delivery Server I upgraded WFFM to 8.2 initial release. After applying all changes, when I open the form I get the following error: Server Error in '/' Application. Could not create instance of the Sitecore.Forms.Core.Handlers.FormDataHandler class. 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.Exception: Could not create instance of the Sitecore.Forms.Core.Handlers.FormDataHandler class. 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: [Exception: Could not create instance of the Sitecore.Forms.Core.Handlers.FormDataHandler class.] Sitecore.WFFM.Abstractions.Dependencies.DependenciesManager.Resolve(String path) +263 Sitecore.Form.Core.Ascx.Controls.SimpleForm..ctor() +26 Sitecore.Form.Web.UI.Controls.SitecoreSimpleForm..ctor(Item item) +21 Sitecore.Form.Core.Renderings.FormRender.OnInit(EventArgs e) +349 System.Web.UI.Control.InitRecursive(Control namingContainer) +166 System.Web.UI.Control.InitRecursive(Control namingContainer) +379 System.Web.UI.Control.InitRecursive(Control namingContainer) +379 System.Web.UI.Control.InitRecursive(Control namingContainer) +379 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1839 Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1087.0 Any idea what would be the issue or is something missing? Thanks,
Regarding to the following blogpost (https://citizensitecore.com/2016/05/11/wffm-and-cms-only-mode-in-sitecore-8-1/) by default Sitecore saves the WFFM form values in MongoDB after Sitecore 8.0 version. The default connectionStringName is wfm. To make this work on CMS-Only instance you need to overwrite the connectionStringName in the sqlFormsDataProvider in Sitecore.WFFM.Dependencies.config file. Solution step by step First, you need to take the empty Sitecore_Wffm SQL database that was placed in the %webroot%/Data folder and attach it to your SQL Server. Next, you must add a new connection string in App_Config/ConnectionStrings.config for this database. <add name="wfm" connectionString="insert connection string here" /> Yes, the name of this connection string should be wfm. In Sitecore.Forms.config, there is a WFM.ConnectionString setting that specifies the name of the connection string to use. It is wfm out of the box. **For the record, while this step isn’t in the installation guide for 8.1-compliant versions of WFFM, I have seen it in official documentation somewhere, I just can’t seem to recall where. And if it’s that difficult to find, it’s a problem. Finally, in Sitecore.WFFM.Dependencies.config, in the /sitecore/wffm/analytics node, there is an element called <formsDataProvider>. Update this connection string name to match what is in Sitecore.Forms.config and you should be golden!
WFFM Connection String name I'm trying to save some information into SQL through WFFm's Save action &amp; couldnt get it right :( i have configured wffm connection string as May i know what is the default connectiostring name for WFFM ? is it 'wffm' or 'wfm' Some analysis from my end: Sitecore.WFFM.Dependencies.config Sitecore.Forms.config
One possible way of checking off both these items is to look at the MongoDB database tracking_live which has a collection called ProcessingPool. When sessions are ended, or various other activities encountered, Sitecore uses this collection to specify work for the processing server to do. When the processing server is running it will poll this collection and remove work items as they are completed. If you monitor the state of this collection over the course of 30s by requesting all the data every 5s, you should be able see items being added and removed. Ideally the 'natural state' of this collection is zero items (as Sitecore Processing server has processed all the items). If there are a large number of items, your processing server isn't processing. If nothing goes in, your Sitecore CDs are probably not closing sessions out properly.
Sitecore 8.1 update 2 production health check Sitecore healthcheck.aspx checks connection to all DBs mentioned in connectionString.config. I want to test If analytics data being captured or not in MongoDB replication set Processing Server working properly by testing MongoDB data being pushed to SQL Analytics DB or not. I dont want to test those by altering timeout in configuration file as it is Live environment. What is the best possible way to test above scenarios in Sitecore 8.1 Update 2
Actually; Reserialize means "Delete local files and take whatever is in Sitecore and serialize that to local files". Sounds to me like you may have been getting the terms mixed up. If you want to set Sitecore back to where it was; checkout the branch at the commit you want to roll back to and issue a Sync (not Reserialize).
Re-serializing on unicorn is not undoing changes Here is my scenario: I have made a few changes to a Sitecore template and I decided those changes are no longer needed. I need to restore it to its previous state(fields have been deleted and new ones added). So I have undone the changes to the YML using the repository(git showed the new changes so I undid them). If I check the YML file on the file system it is correct as it should. But when I sync or reserialize the changes I did are still there. I know that re-serializing should take whatever is on the file system and update the content tree according to the file system correct? What am I missing here? why does reserializing unicorn is not getting rid of the changes I did? Thanks UPDATE 1 - I removed then unnecessary configuration entries. Leaving just the one with the path to the one I'm trying to make it work. BUT I noticed one thing. When I sync I'm not seeing that path on the list of processed items that explains it. But when I reserialize it does process it. any ideas why the sync is not processing but reserializing is? <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> <sitecore> <!--Create a patch file on your local to update this setting--> <sc.variable name="sourceFolder" value="C:\myprojectfolder\serialization" /> <unicorn> <configurations> <configuration name="My Project" description="My Project" > <targetDataStore physicalRootPath="$(sourceFolder)\foundation" type="Rainbow.Storage.SerializationFileSystemDataStore, Rainbow" useDataCache="false" singleInstance="true" /> <predicate type="Unicorn.Predicates.SerializationPresetPredicate, Unicorn" singleInstance="true"> <include name="MyProject.Templates.UserDefined" database="master" path="/sitecore/templates/User Defined" /> </predicate> </configuration> </configurations> </unicorn> </sitecore> </configuration>
The best way to fix this would be to move to SOLR - really its the safest way to ensure that the index is the same for all delivery servers. On top of that you get additional things like the query cache, better language indexing and better scalability with Solr Cloud. If you absolutely must stay with Lucene, you could setup the CM server to build the sitecore_web_index on publish end, and then run a job/process to copy the index files from the CM server to the CD servers. This would make sure that all the CD servers had the updated index at the same time. Obviously, you would want to set all the indexes to manual updates on the delivery servers.
Lucene search in load balance environment is not showing proper results I'm using Lucene for Search in Load balanced environment. Indexes are working fine, but sometimes index is updating in only one of the servers. If we rebuild the index manually then its showing proper results. I'm using PublishEnd strategy and Sitecore is configured to use SwitchOnRebuildLuceneIndex index type. I have 1 CM, 2 CD servers. Please suggest best approach to deal with Lucene in Multi-server environment.
We faced the same issue about a month ago. You can use the following rewrite rule. <?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?> <configuration> <system.webServer> <rewrite> <rules> <rule name=&quot;Blog rewrite&quot; enabled=&quot;true&quot; > <match url=&quot;^blog/(.*)$&quot; /> <action type=&quot;Rewrite&quot; url=&quot;http://your.other.domain/{R:0}&quot; /> </rule> </rules> </rewrite> </system.webServer> </configuration> We also had to ignore the route for the blog because of MVC route resolving. using System.Web.Routing; using Sitecore.Mvc.Pipelines.Loader; using Sitecore.Pipelines; namespace MyProject { public class RegisterRoutes : InitializeRoutes { public override void Process(PipelineArgs args) { RouteTable.Routes.Ignore(&quot;blog/{*pathInfo}&quot;); } } } Related config: <configuration xmlns:patch=&quot;http://www.sitecore.net/xmlconfig/&quot;> <sitecore> <pipelines> <initialize> <processor type=&quot;MyProject.RegisterRoutes, MyProject&quot; patch:before=&quot;processor[@type='Sitecore.Mvc.Pipelines.Loader.InitializeRoutes, Sitecore.Mvc']&quot; /> </initialize> </pipelines> </sitecore> </configuration>
How to setup a Reverse proxy with Sitecore? Is there a way that for certain URLs (like /blog/*) to load the content from other server, i.e implementing a reverse proxy? We were able to do this with a normal site (non Sitecore) but when Sitecore is present it seems that the URL rules from our web.config or http://www.helicontech.com/isapi_rewrite/ are ignored and the rules from Sitecore take precedence and when accessing the URL instead of getting the content from the other site (i.e. reverse proxy working) we get the Sitecore 404 page. Is there a way to do this with Sitecore? Maybe set thing up in a way that for certain URL patterns Sitecore is bypassed and the web.config and/or Helicon module rules are executed instead (which have support for reverse proxy)?
You're going about it wrong. Or - I should say - not in accordance with Helix principles. First and foremost, your idea of a common base template to be used on all websites is not recommended practice. What Helix Documentation States The architecture does not have the concept of a single common base template across all templates – which is a practice that is commonly discouraged as it will often lead to bloated items with unnecessary fields. Source: http://helix.sitecore.net/principles/templates/inheritance.html#inheritance What you should be doing instead, is something like the following: Set up your "Favicon" as a Feature or Foundation. You have it as a Foundation module, which will be fine. That will, in turn, give you a "Favicon" template. In Helix terminology, this is an Interface Template. Defines an interface for solution logic to work against, for example by defining the fields that are used by a module’s logic or by simply being a template in the template inheritance hierarchy of an item. Can also be referred to as a base template. Source: http://helix.sitecore.net/principles/templates/template-types.html#template-types Now, for your individual websites - these are Projects in Helix terms. Projects hold Page Templates (and only Projects do this). So you can define a Home Page Template for each of your sites, have it inherit from your Favicon Foundation Interface Template and define a separate source on the Page Template. Helix documentation describes this as: To add editor managed settings to the site, modules should define templates which can be added as base templates to the site root item for the project layer module, or add settings items inside the site hierarchy. Source: http://helix.sitecore.net/principles/multi-site/sites.html#sites Summary Make your Favicon Foundation module. Use the Interface Template you defined, and inherit from it on your individual Project Home Page templates. Alternatively, create a settings folder for each site, and place an item (Favicon Settings, for example) for each of the sites in the settings folder. Since you need to override the field on the template level (not just a default value), the option with the settings folder is best suited for your particular scenario.
How to use a Helix feature for multiple sites with specific template source settings per site? We're thinking of following the Helix guidelines accordingly: 1 Foundation module called "Favicon" that will be used in multiple websites in the same Sitecore instance This feature is a field on the Home item, and is defined in a template that will be inherited by all websites Each website would need to set (override) it's source separately (to the right folder in the Media Library) so that in the content editor the right folder is shown to select the image How should we do this, without having to duplicate the "Favicon" feature for each site (essentially the Template that will be inherited)? This is currently on Sitecore 7.0 (but with a planned upgrade to 8.2 in the near future, unfortunately after the go live of this specific website).
This error happens because there are no pattern and profile cards. It is fixed in the 8.2 Initial release (release notes): Experience Profile The error: "There is no row at position 0" appears in the Experience Profile for contacts with personal info and when there are no pattern cards. https://dev.sitecore.net/Downloads/Sitecore%20Experience%20Platform/82/Sitecore%20Experience%20Platform%2082%20Initial%20Release/Release%20Notes As a workaround, you can just add one pattern and profile card
In Experience Profile - there is no row at position 0 error In Sitecore 8.1-3 whenever I go in to the Experience Profile and select a contact and view either the Overview tab or the Profiling tab I see the following error on the screen: "There is no row at position 0". What does this mean? I found this posting - https://stackoverflow.com/questions/28783328/sitecore-8-revision-150121-analytics-mongodb-error-there-is-no-row-at-pos - but that is not really helpful. It seems to say that this is just a coding bug. Does that mean it can safely be ignored? EDIT: adding log info When I look in the Sitecore logs I see the following: 3836 14:13:51 INFO Experience Profile view profile-pattern-matches called 3836 14:13:51 ERROR There is no row at position 0. Exception: System.IndexOutOfRangeException Message: There is no row at position 0. Source: System.Data at System.Data.RBTree`1.GetNodeByIndex(Int32 userIndex) at System.Data.DataRowCollection.get_Item(Int32 index) at Sitecore.Cintel.Reporting.Contact.ProfileInfo.Processors.FindBestPatternMatchAndApplyToProfileInfo.ApplyPatternToOneProfile(ReportProcessorArgs args, DataRow profileRow) at Sitecore.Cintel.Reporting.Contact.ProfileInfo.Processors.FindBestPatternMatchAndApplyToProfileInfo.ApplyPatternsToResultTable(ReportProcessorArgs args, DataTable resultTable) at (Object , Object[] ) at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) at Sitecore.Cintel.Reporting.PipelineViewProvider.GenerateContactView(ViewParameters viewParameters) at Sitecore.Cintel.Endpoint.IntelController.Get(ViewParameters viewParams, Guid contactId, String viewId, String id)
The Profiling tab displays data connected to the user profiles / pattern cards / personas, which you should define in the CMS. Please, refer to the "Profiling" section of the documentation: https://doc.sitecore.net/sitecore_experience_platform/digital_marketing/personalization/insession_personalization/content_profiles
What data is supposed to be displayed on the Experience Profile - Profiling tab? We have a Sitecore 8.1-3 instance. We have it running in production and it is recording visit information in Mongo. We have set up Profiles and Profile Keys in the Marketing Control Panel. However whenever we go to Experience Profile and click on a contact and then click on the Profiling tab we never see any data. All we see is "No profile data available" - for all contacts. Shouldn't there be data showing on this tab? I can't seem to find any Sitecore documentation that explains what should be showing up on this tab and also how to configure Sitecore properly so that data shows up here.
Turned out that by working with Ahmed Okour on this issue, I was missing this one line of code: <configuration ref="contentSearch/indexConfigurations/spatialLuceneIndexConfiguration"> to replace this line of code: <configuration ref="contentSearch/indexConfigurations/defaultLuceneIndexConfiguration"> Basically, the wrong index configuration was being called upon. This is the correct index configuration: <indexConfigurations> <spatialLuceneIndexConfiguration ref="contentSearch/indexConfigurations/defaultLuceneIndexConfiguration" type="Sitecore.ContentSearch.LuceneProvider.LuceneIndexConfiguration, Sitecore.ContentSearch.LuceneProvider"> <documentBuilderType>Sitecore.ContentSearch.Spatial.Indexing.LuceneSpatialDocumentBuilder, Sitecore.ContentSearch.Spatial</documentBuilderType> </spatialLuceneIndexConfiguration> </indexConfigurations> Now, it's working and I am getting correct results back. Happy coding!
Lucene Spatial Search Support Module Not Working with 8.1 I need your help! Has anyone gotten the Lucene Spatial Search Support module to work in 8.1 that can provide me a tip or hint. From my research, and what I have done to this point, it should be working but it's not bringing back any results. Here is what I have done: I brought down the code from GitHub to my local, and upgraded the .dlls for 8.1 rev. 160302. Got it building and then took those .dll's and brought them over to my solution. Now when I publish they are going over just fine to my Website folder. I then modified my "locations" index to include the and sections along with this change to the index assembly: <index id="locations" type="Sitecore.ContentSearch.Spatial.Provider.Lucene.LuceneIndexWithSpatial, Sitecore.ContentSearch.Spatial"> It seems that I have it all in place and working correctly, and there are no errors even when debugging through the code but still no results. Does anyone have a working solution for this in 8.1 that can guide me on where something might be misconfigured or not setup properly? I have followed all the directions and steps below to get to this point. Any help is appreciated! Lucene spatial search with sitecore 8.2 http://www.sitecorecoding.com/2014/11/Sitecore-ContentSearch-With-Spatial-Search.html
The cache is typically cleared when publishing, which would happen frequent enough for you to not enable this agent. Imagine a case where you don't want the cache to be cleared, perhaps due to the fact there is a ton of content getting published and you don't want it to refresh every single time an item changes. You could then use this to refresh it once a night to limit the impact to the users.
When should the HtmlCacheClearAgent be enabled? Html caches in Sitecore are cleared on publish however there is a HtmlCacheClearAgent which you can run to periodically clear the caches as well. This agent is disabled by default. When is it appropriate/advisable to enable the HtmlCacheClearAgent?
I have experienced both of the errors that you mention in an 8.1.2 instance - sometimes together and other times separately. The below are the most common causes and solutions for these issues, in my experience. Note that it is possible for you to have more than one of these issues at a time. Tracking and xDB Disabled... The Tracker.Current is not initialized error most commonly occurs when you have xDB or Tracking disabled. Open your ShowConfig and verify that the Xdb.Enabled setting and the Xdb.Tracking.Enabled are set to true, and ensure the enableTracking="true" on your <site> configuration node. Note that I am including this information as it may help others, but is most likely not the cause of your issue, since you also have session is not initialized error. However, if you do not get the session is not initialized error on your CM, this could be the cause of the issue on that instance and a different issue may exist on your CDs. Initialize Pipeline Errors or Aborts... Make sure that you don't have any errors or aborts in your initialize pipeline processors. If you do, this could be preventing the pipeline from reaching the Sitecore.Analytics... processors that initialize your Tracker. Session State Configuration is incorrect... This issue is sometimes caused by a error in Session State configuration, causing Session to be null and/or keeping it from being initialized. If this issue is happening on your CDs only, make sure that your CDs are correctly configured to use Shared Session State, and that there are no issues with your configuration (the most common issue I see is pointing your session provider at the wrong connection string name). If you are using xDB Cloud... If you are using xDB Cloud, reach out to Sitecore support and make sure that everything is associated properly with the license that you are using. I have seen this error occur when an instance is configured to use xDB Cloud but the license on the server is not the one authorized for the xDB Cloud account. In other words, if your client purchased xDB Cloud but you have your Partner License up on the site or if there is a problem with your client's license then this error can occur. You can sometimes identify this error by looking in your logs and checking for the "Valid xDB license present" message on initialize. However, if your license has an xDB Cloud license associated with it (which all up-to-date partner licenses should) then you will see this message, whether or not your license is associated with the same xDB Cloud account as you are connecting to. If you are not using xDB Cloud... If you are not using xDB Cloud but you are using a separate Reporting instance, be sure that you are able to connect to it as expected.
ERROR: Cannot create tracker (Message:session is not initialized) Sitecore 8.1 update 2 I am getting below error in logs and none of the interaction data is collected in mongoDB also. Verified with Post looks everything Ok in my solution. ERROR Cannot create tracker. Exception: System.InvalidOperationException Message: session is not initialized Source: Sitecore.Analytics at Sitecore.Analytics.Data.HttpSessionContextManager.GetSession() at Sitecore.Analytics.Pipelines.EnsureSessionContext.EnsureContext.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() [1]: https://stackoverflow.com/questions/34083886/xdb-not-storing-any-interactions/34085142 Another error in log related to analytics I can see is below 3608 07:08:13 ERROR Media request analytics failed 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.Analytics.Media.MediaRequestEventHandler.StartTracking() at Sitecore.Analytics.Media.MediaRequestEventHandler.OnMediaRequest(Object sender, EventArgs args)
Main Issue This issue here is because of a negative offset in your Timezone. If you are based on a timezone that is negative offset to GMT (AKA all of the North and South Americas) then this is a bug that affects you. To test this issue yourself, change your timezone to a POSITIVE offset (Like +4 HOURS GMT) and then rerun your Search in Experience Profile. Solution The solution is found in Sitecore Support Public Reference Number 74085. Put the attached Sitecore.Support.74085.dll assembly into the \bin folder. Put the attached Sitecore.Support.74085.config file into the \App_Config\Include\ExperienceProfile folder. The Sitecore Support Github page for this fix, including the download zip can be found here: https://github.com/sitecoresupport/Sitecore.Support.74085/releases Alternatively, download the fix files directly here: Sitecore.Support.74085.dll Sitecore.Support.74085.config
Experience Profile search - System.ArgumentOutOfRangeException errir In Sitecore 8.1-3 when we go to Experience Profile and do a simple search sometimes (not all the time) we get zero results when we know that there are entries in the index and we see a message that just says "An error has occurred". I have looked in all of the log files and I don't see any error messages anywhere. Any ideas? Below is a screen shot. EDIT: adding more info. We are using SOLR 4.10. I looked in the browser console and I do see an error. It says that there is a 500 Internal Server Error when I attempt this search. And the URL that it shows is this: /sitecore/api/ao/v1/contacts/search?&amp;pageNumber=1&amp;sort=visitCount%20desc&amp;match=don. I looked in Event Viewer and I can't seem to find any error that matches this. So I'm not sure why it is having issues. UPDATE: The very strange thing here is that I only get this error for certain queries. As an example, if I search for "day" then I don't get any errors and the results return normally. However if I search for "don" then I get an error. UPDATE2: I was able to look in my browser console and find more information about the exception. Here is the full exception information: { "Message": "An error has occurred.", "ExceptionMessage": "The added or subtracted value results in an un-representable DateTime.\r\nParameter name: value", "ExceptionType": "System.ArgumentOutOfRangeException", "StackTrace": " at System.DateTime.AddTicks(Int64 value)\r\n at Sitecore.Cintel.Client.Transformers.TimeConverter.FormatDateTime(DateTime time, String format)\r\n at Sitecore.Cintel.Client.Transformers.Contact.ContactSearchResultTransformer.ExtendResult(IContactSearchResult result, DateTime nowTime)\r\n at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()\r\n at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)\r\n at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)\r\n at Sitecore.Cintel.Client.Transformers.Contact.ContactSearchResultTransformer.Transform(ResultSet`1 resultSet)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, 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.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()\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.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\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.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext()\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.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\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.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext()\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.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()\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.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__2.MoveNext()\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.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__2.MoveNext()\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.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__0.MoveNext()\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.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()" }
After spending sometime I have noticed that I made a mistake(tags were not closed properly) while updating "TimeToClearStorage" setting in Sitecore.Analytics.Processing.Aggregation.config which broke the config so "RebuildReportingDB.aspx" was throwing above error. For rebuilding reporting database Sitecore recommends to create a fresh analytic DB (reporting.secondary) and copy few tables from existing analytic DB to fresh DB during the rebuilding process. Also recommends to increase "TimeToClearStorage" to ensure that you allow more time for the clear storage process while these tables are being copied. Find more information here https://doc.sitecore.net/sitecore_experience_platform/setting_up__maintaining/xdb/server_considerations/walkthrough_rebuilding_the_reporting_database So while updating the setting I added TimeToClearStorage>0.00:01:00</TimeToClearStorage instead of <TimeToClearStorage>0.00:01:00</TimeToClearStorage> Notice missing '<' and '>' for tag.
RequiredObjectIsNullException while rebuilding the reporting database - RebuildTaskDataProvider I have setup secondary analytics db and trying to rebuild reporting database by going to "sitecore/admin/RebuildReportingDB.aspx". However when I open "RebuildReportingDB.aspx" I am getting below error. Using Sitecore8.1 update3 [RequiredObjectIsNullException: RebuildTaskDataProvider] Sitecore.Analytics.Aggregation.History.ReportingStorageManager.GetRebuildStatus() +98 ASP.sitecore_admin_rebuildreportingdb_aspx.OnPreLoad(EventArgs e) +77 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2982
As jammykam has said above I'm not aware of any OOTB way of doing this, despite dictionaries being part of Sitecore for quite some time. I spoke to a friend who has implemented this and I thought they wrote something from scratch, but apparently they based it on the blogpost above mentioned by Sitecore Climber: http://jockstothecore.com/editable-dictionary-items-2/. I am not sure of the changes that were made to the code for the project they used it on (or if they will be able to share it) but reading over that blog post it is definitively a good start. A few things to consider here though: This blog post is a prototype solution and so will need some refactoring and testing. The dictionary item returned to the Experience Editor may be a fallback dictionary instead of a domain dictionary if you have fall-back enabled (this may cause you permissions problems or editors some confusion) You may need to do some work around clearing the dictionary cache after saving and publishing to see dictionary changes. Other Options: There is another idea here from Murali Tiruppathi that is less complex. It came from the original SDN forum post that lead to the jockstothecore blog post above being written (https://sdn.sitecore.net/Forum/ShowPost.aspx?PostID=71225): Normally you do a sitecore translate for example: @Sitecore.Globalization.Translate.Text("EmailForm.Validation.CCBCC") You can encapsulate the Translate to a custom class which might look like: public static class CustomTranslate { public static string Text(string key) { if (Sitecore.Context.PageMode.IsPageEditorEditing) { Item currentItem = Context.Database.GetItem(ResourcesController.ItemLookUp()[key]); if (currentItem != null) { return FieldRenderer.Render(currentItem, "Phrase"); } } return Sitecore.Globalization.Translate.Text(key); } } The CustomTranslate.Text returns a FieldRenderer in PageEdit mode else returns the Sitecore.Globalization.Translate.Text Then in your code you can refer the translations as: @CustomTranslate.Text("EmailForm.Validation.CCBCC") The Lookup can be a dictionary of Key and Item ID: public static class ResourceController { public static Dictionary ItemLookUp() { ///get dictionary path..etc.. code not included Sitecore.Data.Items.Item[] items = Sitecore.Context.Database.SelectItems("fast:" + dictionaryPath + "//*[@@templateid='{6D1CD897-1936-4A3A-A511-289A94C2A7B1}']"); items.All(y => { resourceDictionary.Add(y["Key"], y.ID.Guid.ToString()); return true;} return resourceDictionary; } } Again this code will likely need some refactoring, for example: Sitecore.Context.PageMode.IsPageEditorEditing Should now be this in 8+: Sitecore.Context.PageMode.IsExperienceEditorEditing Doing this via Pipelines is probably a nicer and cleaner way of doing this though. If I get chance to use this on the current project I'm on i'll try and share the production ready code. We already have a custom translate class in place to handle empty or missing dictionary items gracefully so Murali's approach would be easier for us to implement.
Dictionary items editable in experience editor? Anyone know if there is any easy way of making a dictionary item editable in experience editor could be using glass or not? I've seen some examples where custom pipelines have been built but wondering if there is any easier way. thanks
The documentation for this table can be found here https://doc.sitecore.net/sitecore_experience_platform/setting_up__maintaining/xdb/platform/reporting_database_reference It's not totally clear from the descriptions but: Views The total number of times the page was viewed. Visits The number of interactions which included a view of the page. I would presume that the interaction refers to a registered xDB interaction. See: https://doc.sitecore.net/sitecore_experience_platform/developing/marketing_operations/interactions/register_interactions_using_the_interaction_registry An interaction is the exchange of communication and commitment between a contact and an organization that takes place through one or more channels. The interaction registry is a service that enables you to register or create an interaction that you have tracked in Sitecore or in a non-Sitecore environment in the Experience Database (xDB). So I deduce that you can record "something happening" which leads to a View being recorded. So if you're not capturing all of the possible interactions that can trigger a View - you'd expect these values to be different. I think you're correct in your assumption for question 3 - Views is what you're after here. Question 4 is also answered in the doc: Value The amount of engagement value accumulated for interactions which included a view of this page. The "LanguageId" and "SiteNameId" refer to other tables in the reporting database (check the foreign keys to see the link). Languages and SiteNames respectfully. Both have an ID and a varchar name column. Check the values you're recording in these tables and that should help answer your final question.
Fact_PageViewsByLanguage table information We have Sitecore 8.2. In the Sitecore_reporting database in SQL server, there is this Fact_PageViewsByLanguage table with these columns: SiteNameId LanguageId Views Visits Value Is there a document where I can find information about these columns. I am looking for the following info: 1. What is the difference between the Views &amp; the Visits column. 2. For few records, the value for Visits is 0, but there are some Views for it. How come? 3. If I need to get the popular pages, I need to be looking at SUM(Views)&amp; not Visits. Am I right? 4. What does the Value column contain. 5. The SiteNameId and LanguageId has values which are not GUIDs like - (-1811310475, -1743424285). How can I map them to the required Sitename or language. Thank you.
As language fallback is enabled, I assume you have a multilingual solution. Please read this to set multilingual error messages. As you will read, error messages are cached indeed and maybe you get an empty value when someone fills the form first in a language that has no error message set. Setting the language fallback on the error message fields (located in /sitecore/system/Modules/Web Forms for Marketers/Settings/Meta data/Mvc Validation Error Messages) should fix it as well as that would lead to a version of your error messages is all languages.
WFFM error :Empty strings are not allowed.Parameter name: errorMessage I am facing a weird issue with WFFM. I have used WFFM module for contact us page in website. In the form i have few required fields which i marked as required using WFFM. Most of the time form validation works.But after few hours same page gives exception. This issue comes in some regular intervals( like 1-2 day) The immediate fix which i am doing is the reset IIS or recycle app pool. sometimes reset IIS not works in that case i have to do a reset IIS+ web.config modification(any kind of modification). Is there any permanent Fix for this? I am using Sitecore 8.1(update 1) + supported WFFM also, Language fallback is enabled. I am sensing this issue is related to Cache. Below is the exception details. Please let me know if anyone has solution for this. Thanks
You can see it 2 different ways : If it is pagebased goal then goto that item in sitecore and then click analyze panel and then click on reports and select page - goals and events By going to the analytics dashboard --> Conversions --> goals (below screenshot) and then browse the individual goal by click on that goal (blue bar in graph) (so under exp analytics it should read something like Dashboard --> Goals --> Goal)
How to view triggered goals The instance name is mysite.org and I have used the Facebook share button. The site is not a public URL yet. The goal points to the related goal is set to 10. Here are the issues: In preview mode, the facebook button is visible, clicking on which the login dialog appears. But when I publish the page, this button is not rendered. In preview mode, when I click on share and log in with facebook credentials, the Likes number increased to 1 from 0. But nothing came up on my facebook page. Is it because mysite.org is not a public URL? I want to check the goals/points achieved, but in Content Editor - Analyze > reports, the value is 0. Should this not be 10 or more (as I have been trying more than once.) How Can I check the triggered goals (in Mongo or SQL) . Using Sitecore 8.2
This error appears because you have not filled the below setting: <setting name="Analytics.EMailFromAddress" value="" /> in Sitecore.Analytics.config. Also, check if in the web.config file the "MailServer" setting is filled in with an address of your SMTP server as well as the "MailServerUserName", "MailServerPassword" and "MailServerPort". In the ProcessSubscriptions processor you have next code that use Analytics.EMailFromAddress setting : public class ProcessSubscriptions : CommitSessionProcessor { public override void Process(CommitSessionPipelineArgs args) { try { Assert.IsNotNull(args.Session, "Tracker.Current.Session is not initialized"); ISmtpClient smtpClient = (Factory.CreateObject("emailprovider", false) as ISmtpClient) ?? new SmtpClientWrapper(); Session session = args.Session; CurrentInteraction interaction = session.Interaction; Assert.IsNotNull(interaction, "visit"); interaction.UpdateLocationReference(); if (!interaction.LocationId.HasValue) { Log.Debug("[Analytics]: The CommitSession pipeline, ProcessSubscriptions - Location id IS NUll, the processing is terminated", this); } else { LocationData locationData = Tracker.Dictionaries.Locations.Get(interaction.LocationId.Value, LookupStrategy.Default); if (locationData == null || !locationData.Subscriptions.Any<string>()) { Log.Debug("[Analytics]: The CommitSession pipeline, ProcessSubscriptions is skipped - there is no subscriptions for location id: " + interaction.LocationId.Value, this); } else { HtmlTextWriter htmlTextWriter = new HtmlTextWriter(new System.IO.StringWriter()); htmlTextWriter.Write("<html>"); htmlTextWriter.Write("<head></head>"); htmlTextWriter.Write("<body>"); ProcessSubscriptions.RenderSummary(htmlTextWriter, session); ProcessSubscriptions.RenderSessionTrail(htmlTextWriter, interaction); ProcessSubscriptions.RenderSessionLink(htmlTextWriter, interaction); ProcessSubscriptions.RenderUnsubscribeLink(htmlTextWriter, interaction); htmlTextWriter.Write("</body>"); htmlTextWriter.Write("</html>"); MailAddress from = new MailAddress(AnalyticsSettings.EmailFromAddress); MailMessage mailMessage = new MailMessage { From = from, Subject = string.Concat(new object[] { "[Sitecore Analytics] ", interaction.GeoData.BusinessName, " visited the site at ", DateUtil.ToServerTime(interaction.StartDateTime), "." }), Body = htmlTextWriter.InnerWriter.ToString(), BodyEncoding = System.Text.Encoding.UTF8, IsBodyHtml = true }; foreach (string current in locationData.Subscriptions) { mailMessage.Bcc.Add(current); } try { smtpClient.Send(mailMessage); } catch (System.Exception exception) { Log.Error("Failed to send subscription notification", exception, typeof(ProcessSubscriptions)); } Log.Info("SubscriptionTask done.", this); } } } catch (System.Exception exception2) { Log.Error("Cannot process 'ProcessSubscriptions' processor because of internal error", exception2, this); } }
Cannot process 'ProcessSubscriptions' processor because of internal error This error is showing up in my Sitecore error logs 5,611 times a day. Any thoughts on how to fix it? Sitecore 7.5 464 2017:01:05 00:00:00 ERROR Cannot process 'ProcessSubscriptions' processor because of internal error Exception: System.ArgumentException Message: The parameter 'address' cannot be an empty string. Parameter name: address Source: System at System.Net.Mail.MailAddress..ctor(String address, String displayName, Encoding displayNameEncoding) at Sitecore.Analytics.Pipelines.CommitSession.ProcessSubscriptions.Process(CommitSessionPipelineArgs args)
Code which you have used, it works only for "old" indexes, but not for the Sitecore 7 indexes. I am sure you must be using old one. You should try to disable/enable indexing as follows Sitecore.ContentSearch.Maintenance.IndexCustodian.PauseIndexing(); // Add code to create item IndexCustodian.ResumeIndexing(); Also add check whether indexing is currently paused or not with the use of the following: IndexCustodian.IsIndexingPaused(ISearchIndex index )
Programmatically stopping Solr Indexing We are programmatically creating items and using Solr indexes so we want to disable solr indexing whenever we create an item. We tried following code to disable during item creation Item.Add() Sitecore.Configuration.Settings.Indexing.Enabled = false; But it does not stop indexing and still happen in Solr. What can be the possible reason?
If there is not already a Sitecore Module that handles the specific OAuth provider, you can manually setup it up by: Redirect the user to the oAuth2 authentication screen Have the ID provider (IDP) validate and authenticate the user The ID provider will return back to Sitecore an authorization token, most likely containing a list of claims In code (potentially in a custom HttpBeginRequest pipeline processor) log the user in as a Virtual User, then assign predefined Sitecore roles to the virtual user based on mapping the claims provided from the IDP to the user
How to use the Stormpath (or similar) OAuth provider to authenticate external users? How can we replace the existing membership provider in Sitecore with an OAuth- based provider (like stormpath.com)? Further details: We are designing a solution in which the external users are stored in an external system instead of the build-in membership database. The authentication is to be handled via stormpath (stormpath.com) using the OAuth token-based authentication they provide, but we are unsure how to change the default membership provider in Sitecore to use the OAuth methods provided by Stormpath (or similar OAuth-provider). Any suggestions on how to solve this issue? We have played around with the VirtualLogin feature of Sitecore, which in combination with custom login/logout methods could be used to some extend. However, this introduces an additional authentication cookie instead of the JWT-token issued by the OAuth provider (as far as we can see).
So after spending quite a bit of time double-checking my configs (and opening up a Sitecore Support Ticket), I found out that there were 3 things that had messed me up. Hopefully, one of these things will be helpful to others! Double/Triple check that your configs on your Reporting server are correct (not just your Content Management Server). It turns out that I had neglected to enable the Sitecore.Xdb.Remote.Server.config file on the reporting server. As many times as I had checked, I had simply missed that step. Make sure that your reporting server is actually up and running. It also turns out that I had mis-typed the port number for my SOLR instance on my reporting server, and so my reporting server wasn't actually running. Although the JavaScript errors were coming back from my CM Server's address, the problem was actually on my reporting server. I hope this will help someone else when they are trying to diagnose issues.
404 errors in Experience Profile after upgrading to 8.2 I had a functioning copy of Sitecore 8.1 Original release and I've been able to upgrade my CM, CD, Reporting, and Processing/Aggregation servers so that I don't get any obvious errors. However, now that I'm playing around a little bit in the CM instance, I'm getting some errors that I didn't see before. Right now whenever I try to view details of one of my anonymous users, I get a screen with a few errors. The screen looks like this: Being the clever person that I am, I decided to investigate the sitecore logs, which give me this very helpful information: 8468 16:46:24 ERROR The remote server returned an error: (404) Not Found. Exception: System.Net.WebException Message: The remote server returned an error: (404) Not Found. Source: System at System.Net.HttpWebRequest.GetResponse() at Sitecore.Analytics.Reporting.Datasources.Remote.RemoteReportDataSourceProxy.GetData(ReportDataQuery query) at Sitecore.Analytics.Reporting.ReportDataProvider.ExecuteQueryWithCache(ReportDataQuery query, ReportDataSource dataSource, CachingPolicy cachingPolicy) at Sitecore.Analytics.Reporting.ReportDataProvider.GetData(String dataSourceName, ReportDataQuery query, CachingPolicy cachingPolicy) at Sitecore.Cintel.Reporting.Processors.ExecuteReportingServerDatasourceQuery.CollectReportingServerData(ViewParameters viewParameters) at Sitecore.Cintel.Reporting.Processors.ExecuteReportingServerDatasourceQuery.Process(ReportProcessorArgs args) at (Object , Object[] ) at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) at Sitecore.Cintel.Reporting.PipelineViewProvider.GenerateContactView(ViewParameters viewParameters) at Sitecore.Cintel.Endpoint.IntelController.Get(ViewParameters viewParams, Guid contactId, String viewId, String id) I decide to try to figure out what the URLs are that are being asked for, and so I investigate the JavaScript Console and find that these requests are being made using AJAX: http://MyCMServerURL/sitecore/api/ao/v1/contacts/b8a06f4c-a784-48cb-9d86-b6a2e0133974/intel/best-pattern-matches?&amp;pageSize=3&amp;pageNumber=1 http://MyCMServerURL/sitecore/api/ao/v1/contacts/b8a06f4c-a784-48cb-9d86-b6a2e0133974/intel/latest-events?&amp;pageSize=1000000&amp;pageNumber=1 http://MyCMServerURL/sitecore/api/ao/v1/contacts/b8a06f4c-a784-48cb-9d86-b6a2e0133974/intel/recent-campaigns?&amp;pageSize=3&amp;pageNumber=1 http://MyCMServerURL/sitecore/api/ao/v1/contacts/b8a06f4c-a784-48cb-9d86-b6a2e0133974/intel/journey?&amp;pageSize=2000 http://MyCMServerURL/sitecore/api/ao/v1/contacts/b8a06f4c-a784-48cb-9d86-b6a2e0133974/intel/latest-statistics?&amp;pageSize=1&amp;pageNumber=1 I have no idea what these URLs are supposed to point to, so I'm not sure how to proceed. The stack trace isn't very helpful for helping to figure out what my next steps should be. The URLs look properly formed, but the links don't lead to anywhere. How do I start figuring out what the problem is? UPDATE: Using the hints from the comments, I double-checked my settings in the Sitecore.Xedb.Remote.Client.config file and that was pointing to my Reporting server. Just for fun, I changed the IP address to a non-existent server, and got the same results. I also tried to navigate to this URL http://MyReportingServerURL/sitecore/api/ao/v1/contacts/b8a06f4c-a784-48cb-9d86-b6a2e0133974/intel/latest-statistics?&amp;pageSize=1&amp;pageNumber=1 instead of http://MyCMServerURL/sitecore/api/ao/v1/contacts/b8a06f4c-a784-48cb-9d86-b6a2e0133974/intel/latest-statistics?&amp;pageSize=1&amp;pageNumber=1 and I was able to get valid information back from the browser. It would appear that everything is almost configured correctly, but maybe there is a new/changed setting that I've missed. I'd love to get some additional insight into what I might be missing. Thank you!
Sometimes the simple answers are the best. I changed the authentication method in the web.config from "None" to "Forms" - this apparently no longer keeps you out of the shell like it used to. Then I put an authorization for the site in general, and another for the location to protect: <!--Switching to Forms authentication to enable blocking subfolders--> <authentication mode="Forms" xdt:Transform="SetAttributes"> <forms timeout="120" slidingExpiration="true" xdt:Transform="SetAttributes" /> </authentication> <!-- This allows all users onto the site but is needed for the location setting to deny subfolder access; Sitecore authentication still prevents users from accessing the members site without a login --> <authorization xdt:Transform="Insert"> <allow users="*"/> </authorization> <location path="Attachments" xdt:Transform="Insert"> <system.web> <authorization> <deny users="?"/> </authorization> </system.web> </location>
Using Sitecore authentication on external folders in IIS We're using Sitecore authentication with a custom membership/roles database that's hooked into Sitecore with its own domain. We imported a ton of legacy data, and due to the number of documents, we put what normally would go in the media library into a folder in the Windows tree for the site, so they're accessible. We need to secure these now. Is there a way to do this without having to import the lot into Sitecore? Like, using impersonation somehow to do it? Or is it better to bite the bullet and bring them all into Sitecore?
I figured this out. I made the update to change the value of LinkDatabase.MaximumBatchSize to 1000 as suggested and it didn't work. <sitecore> <settings> <setting name="LinkDatabase.MaximumBatchSize"> <patch:attribute name="value">1000</patch:attribute> </setting> </settings> </sitecore> I then looked at the console in more detail in Chrome and saw this error: "Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property." After some Googling I found I can update this via the web.config like so: <system.web.extensions xdt:Transform="Insert"> <scripting> <webServices> <jsonSerialization maxJsonLength="2147483647"/> </webServices> </scripting> </system.web.extensions> Again this didn't work :-(. I think the Json Serialization code ignores this setting. Then I came across this Blog Post by Dirk Schäfauer: https://seitenkern.com/2014/03/28/sitecore-7-mvc-json-serialization-and-maxjsonlength/ This post says I need A custom JsonSerializer, a PreprocessRequest Pipeline and .config to patch in my pipeline. This code is outdated for 8.1 though so I've updated it below: JsonSerializer: namespace SitecoreContrib.Serialization { public class LargeJsonSerializer : ISerializer { public string SerializedDataMediaType { get { return "application/json"; } } public string Serialize(object value) { Assert.ArgumentNotNull(value, "value"); var scriptSerializer = new JavaScriptSerializer { MaxJsonLength = 2097152 }; var setting = Settings.GetSetting("JsonSerialization.MaxLength"); int result; if (!string.IsNullOrEmpty(setting) &amp;&amp; !scriptSerializer.MaxJsonLength.ToString(CultureInfo.InvariantCulture).Equals(setting, StringComparison.InvariantCultureIgnoreCase) &amp;&amp; int.TryParse(setting, out result)) { scriptSerializer.MaxJsonLength = result; } return scriptSerializer.Serialize(value); } } } Pipeline: namespace SitecoreContrib.Serialization.Pipelines.PreprocessRequest { public class RewriteUrlForLargeJsonResponse : RewriteUrl { public override void Process(PreprocessRequestArgs arguments) { Assert.ArgumentNotNull((object)arguments, "arguments"); try { string localPath = arguments.Context.Request.Url.LocalPath; if (!localPath.StartsWith("/-/item/")) return; Sc.ItemWebApi.Context.Current = new Sc.ItemWebApi.Context { Serializer = (ISerializer)new LargeJsonSerializer(), Version = GetVersion(localPath), ResponseOutputBuilder = new ResponseOutputBuilder() }; Rewrite(arguments.Context); } catch (Exception ex) { Logger.Error(ex); } } private static int GetVersion(string path) { Assert.ArgumentNotNull((object)path, "path"); string str = path.TrimStart('/').Split('/')[2]; Assert.IsTrue(str.StartsWith("v"), "Version token is wrong."); int result; Assert.IsTrue(int.TryParse(str.Replace("v", string.Empty), out result), "Version not recognized."); return result; } private static void Rewrite(HttpContext context) { Assert.ArgumentNotNull((object)context, "context"); Uri url = context.Request.Url; string[] strArray1 = url.LocalPath.TrimStart('/').Split('/'); int length = strArray1.Length - 3; string[] strArray2 = new string[length]; Array.Copy((Array)strArray1, 3, (Array)strArray2, 0, length); string str1 = string.Format("/{0}", (object)string.Join("/", strArray2)); string str2 = url.Query.TrimStart('?'); WebUtil.RewriteUrl(new UrlString { Path = str1, Query = str2 }.ToString()); } } } Config: <sitecore> <pipelines> <preprocessRequest> <processor type="SitecoreContrib.Serialization.Pipelines.PreprocessRequest.RewriteUrlForLargeJsonResponse, SitecoreContrib.Serialization" patch:instead="*[@type='Sitecore.ItemWebApi.Pipelines.PreprocessRequest.RewriteUrl, Sitecore.ItemWebApi']" /> </preprocessRequest> </pipelines> <settings> <!-- JsonSerialization.MaxLength Specifies the maximum length of JSON strings which can be serialized by the JsonSerializer. Value is specified in bytes. Default value: 2097152 (2 MB) --> <setting name="JsonSerialization.MaxLength" value="2147483647" /> </settings> </sitecore> Thats it, this should work well and load large json datasets for you when you have lots of sub-items.
Link Browser doesn't show all child items from Tree? We're using Sitecore 8.1 Update 2 and have an issue where there is an instance where we have are a few hundred items under a single Parent item in our site. These child items show fine in the Content Editor Treeview, if a little slow to load them. I know best practice is to limit this to 100-200 items, it is however usable without converting the parent item to a Bucket. Re-architecting the structure at this stage isn't really an option. However when using the Link Browser it shows the parent item but won't let me browse the child items. I get this error: ERROR: No data from server Update - here is a screenshot showing the parent item high-lighted with a red circle and the children failing to load. Is there a hard limit on the number of items that the Link Browser support? Eventually I want to convert these to a bucket but I'm looking for an interim solution in the short term.
It's been confirmed. Ticking the Is Ajax MVC Form check box on the form itself gets rid of the extraneous reload upon submitting the form. However the delay between submitting and getting a response might still be an issue and would need to be addressed separately.
WFFM form reloads form page upon successAction before redirecting to success page Working with multi-site single instance Sitecore 8.1 U3 solution and WFFM of the same version, I have a page at https://site//contact-us/ which contains an enquiry form configured to redirect to a success page upon submitting. The success page is located underneath the form page. i.e: Form page location: sitecore/content/site/home/contactus Success page location: sitecore/content/site/home/contactus/thankyou Form location: sitecore/system/modules/Web Forms for Marketers/site/form However the current behaviour is when the submit button is clicked the form page reloads, there is a delay for a good few seconds, then the success page is loaded. Below is the log of the browser console upon submitting the form: Navigated to https://site//contact-us/ Navigated to https://site//Contact-us/Thank-You Any idea what's the reason behind this reload?
Jeff Darchuk wrote a blog post describing how to render a Sitecore item to a string. The blog post provides all relevant copy-paste ready code. With this approach, you can retrieve the PageSlide item from the rendering data source, and render the item directly in your parent view: @Html.Raw(PageSlideItem.Render()) His solution is to create a new temporary item context, extract the layout details, and utilize Sitecores standard pipelines to render the item into a string. First step is to create a new temporary ItemDefinitionContext: public class PageRenderItemDefinitionContext { public static PageRenderItemDefinitionContext Current => ContextService.Get().GetCurrent<PageRenderItemDefinitionContext>(); public static PageRenderItemDefinitionContext CurrentOrNull => ContextService.Get().GetCurrentOrDefault<PageRenderItemDefinitionContext>(); public PageDefinition Definition { get; private set; } public Item Item { get; private set; } public DisplayMode PageMode { get; set; } public PageRenderItemDefinitionContext(PageDefinition pageDefinition, Item item, DisplayMode exteriorDisplayMode) { Assert.ArgumentNotNull(pageDefinition, nameof(pageDefinition)); Assert.ArgumentNotNull(item, nameof(item)); Definition = pageDefinition; Item = item; PageMode = exteriorDisplayMode; } public static IDisposable Enter(PageRenderItemDefinitionContext context) { Assert.ArgumentNotNull(context, "context"); return ContextService.Get().Push(context); } } Next, override the PerformRendering pipeline processor to use the new PageRenderItemDefinitionContext: public class PerformItemRendering : PerformRendering { public static readonly string ItemRenderingKey = Guid.NewGuid().ToString(); /// <summary> /// Render step, except it temporarily abandons the placeholder context to render a seperate item, after which it puts the context back /// </summary> /// <param name="placeholderName">Placeholder to render</param> /// <param name="writer">writer to render to</param> /// <param name="args"></param> protected override void Render(string placeholderName, TextWriter writer, RenderPlaceholderArgs args) { if (PageRenderItemDefinitionContext.CurrentOrNull != null) args.PageContext.PageDefinition = PageRenderItemDefinitionContext.Current.Definition; if (placeholderName != ItemRenderingKey) { base.Render(placeholderName, writer, args); return; } Stack<PlaceholderContext> previousContext = new Stack<PlaceholderContext>(); while (PlaceholderContext.CurrentOrNull != null) { previousContext.Push(PlaceholderContext.Current); PlaceholderContext.Exit(); } try { PipelineService.Get().RunPipeline("mvc.renderRendering", new RenderRenderingArgs(args.PageContext.PageDefinition.Renderings.First(x => x.Placeholder.IsWhiteSpaceOrNull()), writer)); } finally { while (PlaceholderContext.CurrentOrNull != null) PlaceholderContext.Exit(); while (previousContext.Any()) { PlaceholderContext.Enter(previousContext.Pop()); } } } } Patch in the pipeline processor: <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> <sitecore> <pipelines> <mvc.renderPlaceholder> <processor patch:instead="processor[@type='Sitecore.Mvc.Pipelines.Response.RenderPlaceholder.PerformRendering, Sitecore.Mvc']" type="Namespace.Pipelines.Mvc.RenderPlaceholder.PerformRendering, Assembly" /> </mvc.renderPlaceholder> </pipelines> </sitecore> </configuration> Finally, wire it all up as a new ItemRenderer: /// <summary> /// Renders an item's layout to a string or TextWriter. /// </summary> public class ItemRenderer { public Item Item { get; set; } public ItemRenderer(Item item) { Item = item; } /// <summary> /// Renders an item with a layout defined to a string for MVC /// </summary> /// <returns>HTML of item</returns> public virtual string Render() { using (TextWriter tw = new StringWriter()) { Render(tw); return tw.ToString(); } } /// <summary> /// Renders an item with a layout defined to a string for MVC /// </summary> /// <returns>HTML of item</returns> public virtual void Render(TextWriter writer) { var originalDisplayMode = Context.Site.DisplayMode; // keep a copy of the renderings we start with. // running the renderPlaceholder pipeline (which runs renderRendering) will overwrite these // and we need to set them back how they were when we're done rendering the xBlock var originalRenderingDefinitionContext = RenderingContext.CurrentOrNull?.PageContext?.PageDefinition; try { // prevents editing the snippet in context, so you cannot mistakenly change something shared by mistake if (Context.PageMode.IsExperienceEditorEditing || Context.PageMode.IsPreview) { Context.Site.SetDisplayMode(DisplayMode.Normal, DisplayModeDuration.Temporary); } var pageDef = new PageDefinition { Renderings = new List<Rendering>() }; //Extracts the item's layout XML, then parses all of the renderings out of it. pageDef.Renderings.AddRange(GetRenderings(GetLayoutFromItem())); // Uncovers the main layout rendering var pageRenderingArgs = new GetPageRenderingArgs(pageDef); PipelineService.Get().RunPipeline("mvc.getPageRendering", pageRenderingArgs); //Renders all placeholders for the layout rendering, which would be the entire page var renderPlaceholderArgs = new RenderPlaceholderArgs(PerformItemRendering.ItemRenderingKey, writer, pageRenderingArgs.Result) { PageContext = new PageContext { PageDefinition = pageDef } }; using (PageRenderItemDefinitionContext.Enter(new PageRenderItemDefinitionContext(pageDef, Item, originalDisplayMode))) { PipelineService.Get().RunPipeline("mvc.renderPlaceholder", renderPlaceholderArgs); } } catch (Exception e) { Log.Error("There was a problem rendering an item to string", e, this); if (originalDisplayMode == DisplayMode.Edit || originalDisplayMode == DisplayMode.Preview) { writer.Write($"<p class=\"edit-only\">Error occurred while rendering {Item.Paths.FullPath}: {e.Message}<br>For error details, <a href=\"{LinkManager.GetItemUrl(Item)}\" onclick=\"window.open(this.href); return false;\">visit the target page</a></p>"); } } finally { // replace the renderings in the current context with the ones that existed before we ran our sideline renderPlaceholder // because they have been overwritten with the xBlock's renderings at this point if (originalRenderingDefinitionContext != null) { RenderingContext.CurrentOrNull.PageContext.PageDefinition = originalRenderingDefinitionContext; } Context.Site.SetDisplayMode(originalDisplayMode, DisplayModeDuration.Temporary); } } /// <summary> /// Gets the layout XML from the item /// </summary> /// <returns>xml of the layout definition</returns> protected virtual XElement GetLayoutFromItem() { Field innerField = new LayoutField(Item).InnerField; if (innerField == null) return null; string fieldValue = LayoutField.GetFieldValue(innerField); if (fieldValue.IsWhiteSpaceOrNull()) return null; return XDocument.Parse(fieldValue).Root; } /// <summary> /// Gets the rendering out of the xml node and injects some values in /// </summary> /// <param name="renderingNode"></param> /// <param name="deviceId"></param> /// <param name="layoutId"></param> /// <param name="renderingType"></param> /// <param name="parser"></param> /// <returns>MVC rendering</returns> protected virtual Rendering GetRendering(XElement renderingNode, Guid deviceId, Guid layoutId, string renderingType, XmlBasedRenderingParser parser) { Rendering rendering = parser.Parse(renderingNode, false); rendering.DeviceId = deviceId; rendering.LayoutId = layoutId; if (renderingType != null) rendering.RenderingType = renderingType; // if the xBlock is rendering in the context of another page, renderings with no data source should be repointed to the xBlock page item // as opposed to the context page item if (string.IsNullOrWhiteSpace(rendering.DataSource)) rendering.DataSource = Item.ID.ToString(); return rendering; } /// <summary> /// Get all renderings out of the layout definition /// </summary> /// <param name="layoutDefinition">xml of the layout definition</param> /// <returns>list of renderings</returns> protected virtual IEnumerable<Rendering> GetRenderings(XElement layoutDefinition) { XmlBasedRenderingParser parser = MvcSettings.GetRegisteredObject<XmlBasedRenderingParser>(); foreach (XElement xelement in layoutDefinition.Elements("d")) { Guid deviceId = xelement.GetAttributeValueOrEmpty("id").ToGuid(); Guid layoutId = xelement.GetAttributeValueOrEmpty("l").ToGuid(); yield return GetRendering(xelement, deviceId, layoutId, "Layout", parser); foreach (XElement renderingNode in xelement.Elements("r")) yield return GetRendering(renderingNode, deviceId, layoutId, renderingNode.Name.LocalName, parser); } } } Now, using the ItemRenderer, you can render the item to a string. To ease the usage, you can add an extension method to Item /// <summary> /// Renders an item with a layout definition to a string /// </summary> /// <param name="item"></param> /// <returns>Rendered output for the item</returns> public static string Render(this Item item) { return new ItemRenderer(item).Render(); } Note that this approach requires the rendered item to have a stripped down layout assigned, so that only the actual content is rendered (i.e. without html, head, body tags). @Html.Sitecore().Placeholder("content") To add Experience Editor support, switch on PageMode to add containing HTML-tags: @if (Sitecore.Context.PageMode.IsExperienceEditor || Sitecore.Context.PageMode.IsPreview) { <!DOCTYPE html> <html lang="da"> <head> <!-- Header content here --> </head> <body> @Html.Sitecore().Placeholder("content") </body> </html> } else { @Html.Sitecore().Placeholder("content") }
How do I display a child's presentation details? (Nested presentation details) I have a Sitecore item that has presentation details ("MainPage"). Within those details is a component that also has presentation details ("PageSlide"). I cannot get Sitecore to display the presentation details from PageSlide. The idea is that the page can have multiple slides. Each of the slides has its own unique presentation details, and some items are part of a placeholder inside of PageSlide but not in MainPage. Here are the details for MainPage. (The layout is set, as are the necessary placeholders. I will eventually add more slides.) And here are the details for PageSlide. FlexColumn is a DIV with a placeholder inside. I have tried: Assigning each slide to a singular placeholder in MainPage. This only renders the slide, but not the slide's presentation details. Assigning each slide to it's own placeholder in MainPage. Using Item Renderings, add code to loop through the renderings in PageSlide and render them manually. (Note, this works to display the items as long as they are independent and consecutive. FlexColumn is completely rendered, and the RichTextContent items are placed on the page after the FlexColumn's div has closed. ) @foreach (RenderingReference rendering in context.GetItem<Item>(Model.Id).Visualization.GetRenderings(Sitecore.Context.Device, true) { if (!string.IsNullOrWhiteSpace(rendering.Settings.DataSource)) { @Html.Sitecore().ItemRendering(rendering.Settings.DataSource); } else { @Html.Sitecore().Rendering(rendering.RenderingID.ToString(), new { DataSource = rendering.Settings.DataSource }); } } (Note: I am using Glass Mapper, but it's not a requirement.) Looping through the presentation details of MainPage and assigning the slides to a partial view with a content item as the model. (This does not work, because the presentation details are not pulled in.) @{ IEnumerable<RenderingReference> renderings = Sitecore.Context.Item.Visualization.GetRenderings(Sitecore.Context.Device, true).Where(x => x.RenderingItem.Name == IPageSlideConstants.TemplateName); foreach (RenderingReference reference in renderings) { PageSlide confSlide = context.GetItem<PageSlide>(reference.Settings.DataSource); @Html.Partial("~/Views/renderings/Components/PageSlide.cshtml", confSlide) } } Two things I haven't looked into yet: Altering the pipelines. AJAX to display each slide as it's needed, into it's own DIV. Is there another way to do this? Edit: It appears there is a Html.Sitecore().ChildRenderings() method in the developer's reference guide, but I can't find any information on how to use it. I have added it to the view for the main page as well as in the slide, but nothing has changed.
Presentation-preview is designed for Content Editor Users, Publish-preview - for Page Editor users. This is the main concept difference, in my opinion. Technically they use different engines: the presentation-preview uses the one inherited from old 5.3/6.0-6.3 versions, and the publish-preview uses Page Editor Engine invented in 6.4 versions. Publish -> Preview also provides other options such as allowing you to choose the device while previewing. On the other hand, Presentation -> Preview uses the first device that has "Default" field checked under the /sitecore/layout/devices item So my suggestion is to forget to use Presententation -> Preview , recommended practice in Sitecore is to use Experience Editor not Content Editor for editing pages.
How to check the preview mode I have a page whose menu bar loads fine when previewed by clicking Presentation > Preview. When previewed by clicking Publish > Preview, the site's menu bar is overlapped by Sitecore menu. To fix that, I want to add a margin-top css property for the menu bar when it is being previewed using Publish > Preview. How can I do that, as for both the methods, the page mode is Sitecore.Context.PageMode.IsPreview
I had an issue dealing with versions and cloning items when using language fallback. This article mentions that it isn't solely an issue with clones: We uncovered a bug - any time an item was created outside of the main Home item and using anything other than “Insert Item from Template” (eg. copy, clone, package installation) any item that was set as a Fallback would switch to an actual empty version of the item in all languages. http://www.xcentium.com/blog/2016/05/11/field-fallback-in-the-new-world-of-sitecore-81 The patch I got to fix my issue was Sitecore.Support.120002. The behavior I was focused on isn't exactly the same however the dll has a processor called RemoveExtraVersions. The code in that processor checks each language of the copied item and if the latest version of the item in that language is a fallback item is removes the version from the current language. This does get added in the uiCloneItems node so it might not be exactly what you want though.
Sitecore versioning appears incorrect after package install This is using 8.1 Update 2 with multi-lingual/fallback. I've been installing packages to make updates from our local environment to our QA server. Somewhere along the line, it started to create what I'd call phantom versions. For example, in one language the version dropdown looks like it's at version 5, but when you click on the version dropdown to look at them, it only shows version 1 (which is all there should be). The publishing viewer also doesn't show multiple versions. In addition, it's giving the "If you publish now, the selected version will not be visible on the Web site because it has been replaced by an older version." message, but when I look online, neither case suggested is happening...there's no workflow and the publish isn't set to never publish. It seems like somewhere in here, the version counting got completely messed up, but I'm at a total loss as to why or how to fix it. I tried deleting affected items and reinstalling them via package, but it goes back to the same version number it was at before. Any help would be greatly appreciated.
The version of the LightLDAP you have is likely not compatible. You'll need to make sure you upgrade your module to version 1.3 which is compatible with Sitecore 8.2. It can be downloaded here: https://dev.sitecore.net/Downloads/Active_Directory/1_3/Active_Directory_1_3.aspx
Sitecore LDAP Module Compatibility I have a Sitecore 6.4 website that has Sitecore LDAP Module "LightLDAP.dll", This website needs to be upgraded to Sitecore 8.2, My question is: Is the Sitecore LDAP Module compatible with Sitecore 8.2?
Rendering text Try using: helper.MakeText( string controlId, string parent, string text, TextType textType = TextType.Text, string isVisible = "True") TextType enum is defined as follows: enum TextType { Text, Label, HelpLabel, LargeLabel, Value, LargeValue, LargeTitle, Title, SmallTitle, Divider } You can play around with different types of text to create different labels/titles/etc. Rendering text box From Mohammed's comment: I managed to do it by the following code: string str = renderingId + "EventTopic"; this.Html.Sitecore().AddContentToPlaceholder(controlsRow + ".Content", this.Html.Sitecore().Controls().Rendering(this.Html, "{57F86E9A-1844-45CE-BF8A-62900AE17A92}", str, "", null) .ToHtmlString()) Generic helper If that doesn't fit your requirement you can always use a generic method: helper.CreateRenderingAt( string renderindItemId, string controlId, string parent, object parameters = null, string datasource = "", string contentPlaceholder = ".Content") The renderindItemId parameter is an ID of the actual rendering from the component library (from CORE database) that you want to be rendered. For example, if you want to render the text using the generic method, it would look like that: helper.CreateRenderingAt(Globals.Bcl.Renderings.Common.Text, controlId, parent, (object) new { TextType = textType, Text = text, IsVisible = isVisible }, "", ".Content"); In that method call the Globals.Bcl.Renderings.Common.Text constant value is {7717EB6C-9F90-4C58-826D-5E87722A0318}. More You can always decompile the Sitecore.ExperienceAnalytics.Client.dll to find more clues on how they render different components.
Extending Sitecore Experience Analytics Filters I'm trying to extend the experience analytics filters component by adding new custom filters that will be used for my custom reports, my question is: How I can create a textbox field using the following class?: Sitecore.ExperienceAnalytics.Client.RenderingHelper What I can find methods to create different controls but I can't find a method create a text field. Following is an example of creating combo box with two buttons: helper.MakeComboBox("EventTypeComboBox", controlsRow, options ?? new List<ComboBoxItem>() { new ComboBoxItem() }); helper.MakeButton("SubmitButton", controlsRow, Globals.System.Texts.Apply.Guid.ToString(), "Primary"); helper.MakeButton("ResetButton", controlsRow, Globals.System.Texts.RevertFiltersToStandard.Guid.ToString()); Any Ideas?
There is a strange thing that the Sitecore Update Installation Wizard does for Standard Values items when it installs them in a Sitecore Update Package. For __Renderings and __Final Renderings fields, if you have reset the value (made it null) of one of those fields in your Standard Values item in the package...the Installation Wizard still won't make your instance reflect this. Even with the field reset (so the raw value doesn't exist...i.e is null)...the Update Installation Wizard treats the Standard Values in a special way, and won't actually make your target Sitecore instance reflect that change. (Even with settings like TDS's 'AlwaysUpdate'). Instead, the installer checks if the Sitecore value is not null, and then it keeps THAT value....not the null value that your package contains. This is a frustrating feature of Sitecore's Installation Wizard, that I can only imagine is an attempt to prevent overwriting of content. Update: TDS Classic v5.7 comes with a fix for this. Essentially it runs it's own 'PostDeployStep' to force the proper value (null) into the field on the Standard Values item. If you're on earlier versions, you could just write your own to do the same thing. http://www.teamdevelopmentforsitecore.com/en/blog/creating-tds-custom-post-deploy-step
Update installation wizard package causing duplicate renderings in item? I generated an update installation wizard package from TDS containing my content, core db, and architecture (templates, etc). Syncing back and forth locally, I don't have any issues with how anything looks. However, this evening I deployed the UIW package to a server, and when I looked at some of the items, it was duplicating the rendering calls in the shared and/or final layouts. It definitely did not match up to what I had in source control or in my local environment. We're using multi-lingual with language fallback, but I don't know why that would be causing an issue. This is with Sitecore 8.1 Update 2 and TDS 5.0.15. UPDATE Let me clarify the issue, since the comments so far seem geared toward items with different IDs. The actual renderings aren't duplicating, but some of the entries in the Shared or Final Layouts for the page layout are duplicating. For example, we have a carousel container and two carousel slides locally, checked into TDS. We generate the update install package. When it's run on the server, there are now two carousel containers and four carousel slides. It's not consistently happening with every rendering listed in the layout, but they're exact duplicates down to placeholder and datasource.
Anonymous visitor xDB data is stored according to the cookie guid that was placed on the visitors computer as SC_ANALYTICS_GLOBLE_COOKIE. As long as the user doesn't clear his cookies, subsequent visits/interactions will be tracked to that anonymous visitor. In the event that the user does self identify in some capacity, running Tracker.Current.Session.Identify (identifier) will take the current anonymous visitor record and merge it into a Known visitor record that can be recalled using the Identify method. At any point cookies are cleared before the Identify method can be executed, the visitor will recieve a new guid, and thus the old interactions tracked by the old cookie guid will no longer be associated to the new visitor guid. This means that those old interactions will not be merged to the known visitor contact when Identify () is ran. While these interactions are still in xDB and can be used for analytics, they are lost to being able to be associated to a known contact.
Does an Anonymous xDB Contact facet data get restored for new sessions? Does data that is added to an unidentified contact (and therefore saved in xDB) get restored upon future visits? Currently working on a site that a) has no forms b) doesn't not currently have a need for identifying contacts. I would like to store some information about previous visits in the Contact record for use on later visits. Do I need to do anything different given I'm never going to identify this contact?
Your placeholder keys should not depend on your markup at all. They should be based on something more abstract like how the placeholder is intended to be used. You should also consider how you want to manage the placeholder settings. In the case of a bootstrap grid, you could use the concept column width to control which renderings are allowed in different placeholders. However, if all of your components are fluid, specifying a width might not have value for you. In that case, you could just use col-1, col-2, etc. This would decrease the number of placeholder setting items you need to maintain. You may also want the consider the usage of the parent rendering. For example, if you need to restrict certain renderings to a footer, you could use a key like footer-1.
How to name dynamic placeholders if they are based on bootstrap column widths I'm working on a Sitecore website where author should be able to add components based on rows and columns. (Just like in Habitat). If the markup was simple, like this: <div class="row"> <div class="col-md-6">...</div> <div class="col-md-6">...</div> </div> my rendering with dynamic placeholders will be : <div class="row"> <div class="col-md-6"> @Html.Sitecore().DynamicPlaceholder("col-wide-1") </div> <div class="col-md-6"> @Html.Sitecore().DynamicPlaceholder("col-wide-2") </div> </div> But what if the markup is : <div class="row"> <div class="col-lg-6 col-md-6 col-sm-6">...</div> <div class="col-lg-6 col-md-6 col-sm-6">...</div> </div> On what width should I base my placeholder naming on - md/lg/sm? Please also consider, different lg/sm/md widths for a div. For making it simple, I put the width as 6 for all devices. Thank you.
This is a fuzzy query where 0.5 is similarity index The similarity measurement is based on the Damerau-Levenshtein (optimal string alignment) algorithm. Sometimes you may get unexpected results in that case. In your case, I believe that you are getting unexpected results because ~0.5 similarity applies to both terms John and Doe.
Why does the search in Experience Profile return non-matches? I am trying a search in Experience Profile in Sitecore 8.1-3 with Solr 4.10 as the search provider. I am noticing that sometimes it returns results that don't seem to match the search query at all. For example - if I search for John Doe in the search bar, here is the query that I see in the search log file: ?q=(type_t:(contact) AND (contact.fullname_t:(John Doe~0.5) OR contact.emails_sm:(John Doe~0.5)))&amp;start=0&amp;rows=100&amp;fl=*,score&amp;fq=_indexname:(sitecore_analytics_index) And when I run that query manually through the Solr interface I get back results that don't seem to match at all. I'm not sure what the ~0.5 part of the query is. Is that some sort of fuzzy match or something?
Coveo should support .Boost() like Lucene as mentioned in the supported LINQ operators. I do not know if this applies to your use case, but it is worth noting that Coveo for Sitecore ships with a specific CoveoBoost extension that supports boosting results according to fields like so: queryable.CoveoBoost(item => item.Field == "value" || item.Field2 == "value2", 200) Note that your number should be high enough, we consider around 100 to be a "great boost", so you should probably try with higher numbers too.
How to apply query boost on certain fields I am using regular ContentSearch API in front of Coveo for Sitecore 3 (not using Coveo UI). I am trying to boost keywords in Title and Subtitle fields to have higher weights compared to page Content. Unfortunately my current approach does not seem to work. Ideally I would like to see results that has keywords match in Title field to show up on top of search results. Is there another way to weigh certain fields over others in Coveo and ContentSearch? private Expression<Func<T, bool>> GetPredicate<T>(string criteria, string location, string language) where T : SearchResultItem { var predicate = PredicateBuilder.True<T>(); predicate = predicate.And( x => x.Language == language); predicate = predicate.And( x => x.Path.Contains(location)); predicate = predicate.And( x => x.TemplateId == TemplateIds.ArticlePageTemplateId || x.TemplateId == TemplateIds.GroupPageTemplateId); var termPredicate = PredicateBuilder.True<T>(); foreach (var term in criteria.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)) { termPredicate = termPredicate.And(p => p.Content.Contains(term) || p["Title"].Contains(term).Boost(3f) || p["Subtitle"].Contains(term).Boost(2f)); } predicate = predicate.And(termPredicate); return predicate; }
There is no search operator to query the number of values in a multi value field in a Coveo index. If your query only contains one value for a given multi value field, it would be possible to achieve your goal with another field containing the same values but not configured as a multi value field. Exemple for a query @multivaluefield=="virginia" AND @normalfield=="virginia". If @multivaluefield and @normalfield values are "virginia", the document will be returned. However, if their values are "virginia;maryland", the query on @multivaluefield will return the document but the query on @normalfield will filter it out as the field doesn't contain only "virginia".
Coveo multi-list - find if field has only one value I'm using several multi-list fields in my searches, and they work great to say "field = value" and it finds a matching value in the list. What I need now, though, is to check if the value I'm looking for is the only one in the list. Example: a multi-list of states. In the usual scenario, I want to check if Virginia has been selected. In this new scenario, I want to check if the list contains Virginia ONLY...if Maryland is also selected, for example, then the result would not be returned. Is there a length value that could be checked to find out how many selections are in the field? Then it'd be easy to say "AND length = 1" in addition to my standard query.
Check if Version 2 of your item in "final" workflow state. This is not an error. This is a functionality of Sitecore. When the current item version you are working on does not satisfy the requirement to publish (ex: item version is not in the final workflow state, item version is set to never publish, item version have publish time set, etc), this warning will be displayed.
the selected version will not be visible on the Web site because it has been replaced by an older version We have a 2 step workflow i.e draft and final. We notice the warning message below on any item when trying to edit If you publish now, the selected version will not be visible on the Web site because it has been replaced by an older version. Version 1 will be published instead. Do we need to worry about this warning? is there any fix we could apply to stop this warning? Thanks.
It's not really an answer to your direct question, but it's a solution. I am using Fortis dynamic placeholder for MVC right now. Works out of the box. Zero problems with nesting. Site: http://fortis.ws/fortis-collection/dynamic-placeholders/ NuGet: https://www.nuget.org/packages/DynamicPlaceholders.Mvc/ <div class="container-fluid"> <div class="row"> <div class="col-xs-12 col-sm-12 col-md-3 col-lg-3"> <div class="box-row"> @Html.Sitecore().DynamicPlaceholder(Bonfire.Feature.Grid.Constants.Strings.ColNarrow1) </div> </div> <div class="col-xs-12 col-sm-12 col-md-9 col-lg-9"> <div class="box-row"> @Html.Sitecore().DynamicPlaceholder(Bonfire.Feature.Grid.Constants.Strings.ColWide1) </div> </div> </div> </div>
How to have nested placeholders when using dynamic placeholders I'm using dynamic placeholders in the views, and there are nested views. When giving the placeholder path for a rendering (in Presentation > Details), the path should be - main-placeholder/sub-placeholder. But it doesn't render anything in that way. When given only the sub-placeholder, it works. Using Sitecore 8.2 MVC Here are my class and views: HTMLHelperExtensions.cs: public static class HTMLHelperExtensions { public static HtmlString DynamicPlaceholder(this SitecoreHelper mySCHelper, string placeholderName) { string dynamicKey = GetDynamicKey(placeholderName); if (!string.IsNullOrWhiteSpace(dynamicKey)) placeholderName = dynamicKey; IDisposable disposable = PlaceholderContext.Enter(new PlaceholderContext(placeholderName)); return mySCHelper.Placeholder(placeholderName); } private static string GetDynamicKey(string placeHolderName) { bool needIncrement = false; int incrementStep = 0; IEnumerable<PlaceholderContext> myPlaceholders = ContextService.Get().GetInstances<PlaceholderContext>(); foreach (PlaceholderContext myPHContext in myPlaceholders) { if (myPHContext.PlaceholderName == placeHolderName || myPHContext.PlaceholderName.StartsWith(placeHolderName + "_")) { needIncrement = true; incrementStep++; } } if (needIncrement) placeHolderName += "_" + incrementStep.ToString(); return placeHolderName; } } default.cshtml <body> @Html.Sitecore.Placeholder("page-content") </body> Section Centered.cshtml <section> <div class="container"> @Html.Sitecore().DynamicPlaceholder("section-centered") </div> </section> 2 Column 6-6.cshtml //this should come inside "section-centered" <div class="row"> <div class="col-lg-6 col-md-6 col-sm-6"> @Html.Sitecore().DynamicPlaceholder("col-wide-1") </div> <div class="col-lg-6 col-md-6 col-sm-6"> @Html.Sitecore().DynamicPlaceholder("col-wide-2") </div> </div> The content is rendered, when I give the placeholders as this: When I give the placeholders like this: it only renders... <section> <div class="container"> ::before ::after </div> </section> As you see, the Article is not rendered. I would like to give the nested paths as it would make sense. Where am i going wrong.
I think you need to move the stuff in your WebApiApplication.Application_Start method to the initialize pipeline like you are doing with the RegisterRoutes class. In Sitecore 8.2 (or somewhere around there) they made Application_Start internal so you can't override it anymore. I've been told this has been marked as a bug at Sitecore and I supposed it will be fixed in a later release, but it hasn't as of 8.2 Update-2.
Sitecore 8.2 with Web API 2 Does anybody have any experience with Web API and Sitecore? I've got a custom database for data not managed by Sitecore, but will be presented alongside Sitecore data. The API calls work fine when called directly, but after publishing with the Sitecore site, the site won't load and gives an error saying: "The object has not yet been initialized. Ensure that HttpConfiguration.EnsureInitialized() is called in the application's startup code after all other initialization code." I've tried adding EnsureInitialized() to the startup code, like it says, but it gives the same error. My API is not calling any Sitecore data. I added a RegisterRoutes class to Sitecore.Pipelines and patched Sitecore with RegisterRoutes.config after Sitecore.Pipelines.Loader.EnsureAnonymousUsers My relevant files are as follows: WebApiConfig.cs using System; using System.Net.Http.Formatting; using System.Web.Http; namespace Feature.DataAPI { public static class WebApiConfig { public static void Register(HttpConfiguration config) { // Web API configuration and services // This block of code sets the application to emit json globally by default GlobalConfiguration.Configuration.Formatters.JsonFormatter.MediaTypeMappings.Add( new RequestHeaderMapping("Accept", "text/html", StringComparison.InvariantCultureIgnoreCase, true, "application/json")); } } } Global.asax.cs using System.Web.Http; namespace Feature.DataAPI { public class WebApiApplication : System.Web.HttpApplication { protected void Application_Start() { GlobalConfiguration.Configure(WebApiConfig.Register); // This block of code is to handle a circular reference error when serializing the json output GlobalConfiguration.Configuration.Formatters.JsonFormatter.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore; GlobalConfiguration.Configuration.EnsureInitialized(); } } } RegisterRoutes.cs using Sitecore.Pipelines; using System.Web.Http; using System.Web.Http.Routing; namespace Feature.DataAPI.Pipelines { public class RegisterRoutes { public void Process(PipelineArgs args) { GlobalConfiguration.Configure(Configure); } private static void Configure(HttpConfiguration configuration) { configuration.Routes.Add("API", new HttpRoute("sitecore/api/{controller}/{id}")); } } } RegisterRoutes.config <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> <sitecore> <pipelines> <initialize> <processor type="Feature.DataAPI.Pipelines.RegisterRoutes,Feature.DataAPI" patch:after="processor[@type='Sitecore.Pipelines.Loader.EnsureAnonymousUsers, Sitecore.Kernel']" /> </initialize> </pipelines> </sitecore> </configuration> Update: After following @Andrey's advice, I have made some progress and am now getting this error: The controller for path '/dataapi/Product/1' was not found or does not implement IController. So at least Sitecore is finding it now. I read in this blog here that Sitecore is throwing an error because it is expecting IController whereas Web API implements ApiController instead. It suggests modifying the order of registrations in the Application_Start, but I can no longer modify this file in Sitecore 8.2 as stated by Soren. So, do I have to alter where the processor is patched in the RegisterRoutes.config file? If so, where should it be placed instead?
If your solution relies on Sitecore’s content search and you want to use language fallback, you must set up the particular search index to handle item- or field-level fallback. You'll want to patch in the config updates to each index you need the functionality for then perform a full rebuild. <index id="sitecore_master_index" …> … <enableItemLanguageFallback>true</enableItemLanguageFallback> <enableFieldLanguageFallback>true</enableFieldLanguageFallback> … </index> For more information you can read the Sitecore documentation https://doc.sitecore.net/sitecore_experience_platform/setting_up__maintaining/language_fallback/setting_up/configure_language_fallback for the feature.
Perform multi-language search sitecore I have small issue with search results where its showing duplicate items because it has different version created and sometimes it only shows default language version. The code i have is as per below, Below method returns IQueryable<> return context.GetQueryable<SearchResult>().Where(item => item["Enable"] = "1"); After I get the results I can see different version of each item, later on i do filtering/sorting as per below, results.AddRange(query.Where(item => item.Title.Equals("keywordinput")) .OrderByDescending(item => item.SortOrder) .ThenBy(item => item.DateTime)); Soon as i use the linq, it's only showing default language not based on context language. I've tried applying language when running GetQueryable<> but then I only get item that has language but I would also like to display other items that don't have language i.e. the default language. Is there a way I can do this? for example suppose i have Item1 has two version en and us Item2 has only one version en So if someone search "item" then im expecting two results to be displayed Item1 - us version Item2 - en version
You can remove the rule validation on the Global Rules item /sitecore/system/Settings/Validation Rules/Global Rules You'll want to remove the rule from the Validate Button, and Validate Button fields of the item. Update There are field specific rule items that you can update to remove the Is XHtml if needed. The Rich Text field is located at /sitecore/system/Settings/Validation Rules/Field Types/Rich Text
Remove 'Is valid XHtml' validation rule for Rich Text field We have a Rich Text field where we are storing our email's html. When i try to save the item, i ended up with validation error like The field "EmailBody" contains (or lacks) some formatting attributes which can cause unexpected results in some browsers (such as Internet Explorer, Firefox, or Safari). For more information about the specific issue detected, use to the Validation command in the Proofing group on the Review tab. when i checked by clicking on validation button the error is: Field must be a valid XHtml document Error: The element 'div' in namespace 'http://www.w3.org/1999/xhtml' has invalid child element 'meta' in namespace 'http://www.w3.org/1999/xhtml'. List of possible elements expected: 'p, h1, h2, h3, h4, h5, h6, div, ul, ol, dl, pre, hr, blockquote, address, fieldset, table, form, a, br, span, bdo, map, object, img, tt, i, b, big, small, em, strong, dfn, code, q, samp, kbd, var, cite, abbr, acronym, sub, sup, input, select, textarea, label, button, noscript, ins, del, script' in namespace 'http://www.w3.org/1999/xhtml'. [2, 4] I want to suppress that error on specific field("EmailBody") not a global change for rich text field, how can i achieve this?
This answer is not an implementation of your requirement, but rather a direction of where to start from. I have disassembled the Sitecore.PathAnalyzer.Services.dll assembly and found that there are basically two services used in the PathsController for building the path: ITreeService _treeService; IPathSetBuilder _pathSetBuilder; And they are used as follows: public PathSet Get(PathRequest request) { NodeAdapter tree = this._treeService.GetTree((TreeRequest) request); return this._pathSetBuilder.Build(request.ItemId.Value, tree); } Below are the essential parts of the PathRequest parameters that you will require to pass to the TreeService and PathSetBuilder in order to build a path: new PathRequest { ItemId = this is an id of the context item for your query TreeDefinitionId = this is a map definition item, i.e. {68E713D8-A382-4378-8FB0-9D7F7AD14B25} is All Site Experience StartDate = Start date to aggregate data from EndDate = End date } This is just to give a basic idea of using the path analyzer's api You can study the parameters better by checking your chrome console for {root}/sitecore/api/PathAnalyzer/{Controller} calls while navigating through different paths. In order to get more clues on how everything is coupled together or answer more specific questions, I believe that you would need to decompile the above mentioned dll. Last but not the least. Make sure that you introduce some strong caching on this, because those queries might get too heavy.
Analytics information to leverage site behavior For one of our implementations we came up with the (relatively simple) following requirement: Let's show a 'Other people also viewed' kind of functional block on our content / product and other page (where relevant). This block should leverage the analytics information collected from previous users and visitors. As this is basically a part of the functionality that the Path Analyzer holds, worst case I need to dive into that code. I had hoped to find some actual examples, API information but seem to find very little to nothing on this topic. As XConnect will handle this type of requests against the Analytics reporting and MongoDB in my opinion, it might very well be that this information gets obsolete very quickly. So my questions: What is best used to retrieve information out of the Sitecore Analytics at this point? API or custom written queries? Anyone who can guide me to some good documentation anywhere? Actual examples or ideas to implement the requirement listed above would obviously be welcome. PS, Sitecore version 8 and onwards.
Sitecore 8.2u1 Previously InsertLinkButton values were populated with InsertLinkButtonRule (rule item id: {CEDD4633-193B-4D79-8DCC-C49B3C8D0F53}). Where TargetControl of this rule is InsertLinkButton and Trigger click Action ID is {D4BA15D6-263A-43E6-93DD-CE9E41C7D8E4} and it still exists in Sitecore 8.2u2 (/sitecore/client/Business Component Library/version 1/Layouts/Renderings/Resources/Rule/Rules/Actions/MakeInternalLinkFromTreeView) So you can use it if you want. I am not sure how your custom field works. Sitecore 8.2u2 Now there is no InsertLinkButtonRule rule which would populate button values. Instead, values are filled in JS. If you open the InsertLinkButton button definition you will notice that click property (previously empty) now has following value in it: javascript:app.insertInternalLinkResult() So you need to find a JS file. When you open PageCode rendering you will notice a path to the JS file. After you open this file with a text editor you can see that there is an additional function called insertInternalLinkResult. Code fragment: var itemLink = _.template(template, { displayText: htmlEncode(targetDisplayTextID.get("text")), alternateText: htmlEncode(targetAltTextID.get("text")), itemId: targetControlID.get("selectedItemId"), queryString: htmlEncode(targetQueryID.get("text")), target: targetWindowValue, styleClass: htmlEncode(targetStyleID.get("text")), path: path, anchor: htmlEncode(anchor.get("text")) }); return this.closeDialog(itemLink); Hope it helps. p.s. I used Sitecore Rocks to analyse the dialog structure.
General Link Dialog "InsertLinkViaTreeDialog" misses InsertLinkRules after Upgrade to 8.2u2 We recently upgraded from Sitecore 8.1u1 to Sitecore 8.2u2 and noticed that the general link field dialog "InsertLinkViaTreeDialog" has a different structure now. We had a custom field that was populated by the "InsertLinkButtonRuleDefinition" Rule. But now "InsertLinkButtonRuleDefinition" is missing and I can't figure out how the fields are populated. Can someone help please?
No, you don't want to make the connection string Read Only. The reason behind his is that the EventQueue table is actually written to by the CD server when doing tasks. There are a number of processes that occur on the CD server that perform writes to the web database. Yeah, we've tried to harden it to readonly in the past (not for version 8, but for an earlier version of Sitecore) and it worked, but we started noticing that content wouldn't get updated appropriately, and then the eventqueue/history table would grow really large and not be maintained appropriately. I wouldn't suggest it.
Read only CD server web DB connection string A coworker of mine just asked me if we should make the connection string read only to the web database, on the CD server. I have never seen it done before when hardening the CD servers, but its an interesting question. My first thought it that you couldn't because of the CD server being able to update the Event Queue information. But has anyone ever tried to harden the connection string for the web database on the CD server?
In order to ignore your custom ajax response you can cancel the request tracking in your controller action code: Tracker.Current.CurrentPage.Cancel() This is to be used when you need to cancel a single request tracking. Note: It will work for future paths/requests only. In order to remove the current irrelevant records, you will probably need to lookup mongodb for tracking history, remove unnecessary records and rebuild your reporting db. Update: check this post for different cancellation techniques as well: https://sitecore.stackexchange.com/a/1456/982
Why am I seeing a view model type name in Path Analyzer funnel My client is on a Sitecore 8.1.2 site in MVC and while reviewing the Path Analyzer I noticed a View Model type name was showing up in one of my funnels. Does anyone know why this might happen, whether this is an indication of an issue and if there is any way to prevent this from happening? UPDATE: I was looking through the code-base and found that there is an HttpPost action named BuildSearchResultsViewModel that I expect could be the culprit. This action (which should probably be renamed) is called via on search button click. While I know that action routes really are paths, this doesn't really have any meaning to the client. Is there a way to selectively hide these entries from the path analyzer or to create a more meaningful label for them (e.g. "Search Button Click")? We do not have any custom reporting/analytics code running on that page that would cause it to show up, as far as I know. If there is any specific configuration or code that would be relevant for this issue that I am not aware of then please let me know and I will update my post. Thanks!
You're going to need a more than 10 servers to do 2M hits per second. Assuming each page is 100 hits, you need to serve 20k pages each second. Caching strategies will be critical. MongoDB is going to log gigs each day. IIS logs will be 10's of gigs each day. Disk speed will be critical. Akamai will be needed for all static assets. You need to limit personalisation to the minimum, or use asynchronous strategies like FXM. We've seen 2CPU+14GB RAM machines do 50-60 pages per second with a lot of tuning and custom xDB VisitorIdentification tags. Maybe an 8-way gets 150/sec. You need probably 25x 8-way machines. Autoscale won't react fast enough but you can probably schedule in some scaling to save money. Put big Redis caches in too and share across all machines in the stack to reduce DB load as much as possible. Akamai is going to cost a bomb too. Dedicate a CM to a group of 20 authors. Load balancing CMs doesn't work that well.l Get SOLR Cloud onto maybe 6 machines and MongoDB on 6 for starters, SSDs, and set the Mongo primary to be an 8-way with a big SSD RAID and as many IOPS as you can get. Or... turf all synchronous personalisation and serve from cache/Akamai. This is my kinda problem!
Sitecore infrastructure question My client needs a site which can sustain load of 3 million views a day. We asked them if they know, what a spike per second would look like but they do not know the answer to that. They said from 3 million view in a day we can assume there would be a spike where they may get close to 2.5 million hit in a second. And we need to consider this threshold level. We currently load tested our site and it can sustain 200 request/second, so ofcourse this is huge request, but wanted to know or confirm few things? 1) if i add those many CD servers (my approx calculation says i may need to add 10 more CD servers at-least). Do i need to consider the CM to be load balanced or not? 2) I am already using akamai and SC caching. What other things i can do to improve performance? 3) Contents will be entered by 30-40 content authors every 15 minutes during that time frame, so what is the best strategy i need to consider? 4) I have load balanced SOLR and Mongo already, do i need to scale those too? 5) Can Sitecore really handle this much load? Apologies if this is not right forum to ask such question, i would be happy to ask somewhere else or reach out someone. I am trying to get in touch with Sitecore with same questions but thought to ask to community if someone were needed to implement support this type of request in past.
Solution Surround each of your expression part with "$(EXPRESSION_HERE)" Before: @{Label="Redirect To"; Expression={ Get-PathFromId($_.Fields["Target Page"]) + $_.Fields["Target Url"] + Get-PathFromId($_.Fields["Parent Item"]) } } After: @{Label="Redirect To"; Expression={ "$(Get-PathFromId($_.Fields["Target Page"]))" + "$($_.Fields["Target Url"])" + "$(Get-PathFromId($_.Fields["Parent Item"]))" } } Additional info This trick is very useful if you want to include some more complicated expression inside your string. See following example. $item = Get-Item . Write-Host "My path is $item.Paths.Path" Write-Host "My path is $($item.Paths.Path)" Output: My path is Sitecore.Data.Items.Item.Paths.Path My path is /sitecore/content/Home
Powershell Extensions - Concatenating Values in Show-ListView I'm working on an instance that has a custom redirect engine built in. I've been tasked to write a report that can show the redirect items' Sitecore path with the "redirect from" and "redirect to" fields. There are 4 flavors of these redirects and the "redirect to" field has 3 different names across those 4 templates. In my report, I am attempting to display those three field values in one column. The idea being that if I just concatenate those values together, 1 will have a value and 2 will be null. function Get-PathFromId($item) { $myItem = Get-Item master: -ID $item $itemPath = $myItem.Paths.Path $itemPath } function Get-TemplateName($template) { $templateItem = Get-Item master: -ID $template.id $templateName = $templateItem.DisplayName $templateName } #get all redirects of each type $items = Get-Item master: -Query "/sitecore/content//*[@@templatename='Internal Redirect Rule']" $items += Get-Item master: -Query "/sitecore/content//*[@@templatename='External Redirect Rule']" $items += Get-Item master: -Query "/sitecore/content//*[@@templatename='Redirect Rule']" $items += Get-Item master: -Query "/sitecore/content//*[@@templatename='Route Redirect Rule']" $props = @{ InfoTitle = "Redirects" InfoDescription = "Lists all redirects for each region." PageSize = 100 } $items | Show-ListView @props -Property @{Label="Path"; Expression={$_.ItemPath} }, @{Label="Redirect From"; Expression={$_.Fields["Source URL"]} }, @{Label="Redirect To"; Expression={ Get-PathFromId($_.Fields["Target Page"]) + $_.Fields["Target Url"] + Get-PathFromId($_.Fields["Parent Item"]) } }, @{Label="Internal Target"; Expression={ Get-PathFromId($_.Fields["Target Page"]) } }, @{Label="External Target"; Expression={ $_.Fields["Target Url"] } }, @{Label="Route Redirect"; Expression={ Get-PathFromId($_.Fields["Parent Item"]) } } What I'm seeing is that the column where I am expecting concatenated values : @{Label="Redirect To"; Expression={ Get-PathFromId($_.Fields["Target Page"]) + $_.Fields["Target Url"] + Get-PathFromId($_.Fields["Parent Item"]) } } only returns the value from the "Target Page" field. Any values present in the other two fields are never displayed. When I display the values individually (for now I've added them individually as the last three columns) they display values as expected. I'm pretty green with SPE - this has to be something I don't understand about concatenation and/or calling that internal Get-PathFromId function within my concatenation. Update After working through possible solutions from Michael West and Alan Płócieniak, it seems that my issue is caused by calling the Get-PathFromId method from within my expression. Using this expression without the method calls: @{Label="Redirect To"; Expression={ $_.Fields["Target Page"].Value, $_.Fields["Target Url"].Value, $_.Fields["Parent Item"].Value } } results in a fully populated column but the "Target Page" and "Parent Item" fields are drop links. Having the Sitecore Item Id in the report is not very useful for the intended audience. Maybe there is a different way to get the Paths.Path from that value? Update #2 Adam Płócieniak's solution ended up working great but I also had to fix the Get-PathFromId method to check null values. Some null values were wreaking havoc apparently but weren't throwing an error. I updated that method to: function Get-PathFromId($item) { $itemPath = "" if($item -ne $null) { $myItem = Get-Item master: -ID $item if ($myItem -ne $null) { $itemPath = $myItem.Paths.Path } } $itemPath }
You can do this by overriding Sitecore.Resources.Media.MediaProvider. In the GetMediaUrl you'll have access to the MediaItem to check the template or a field. You can then return either the base.GetMediaUrl (i.e. the Sitecore one) or build and return an Azure CDN link to the image/resource.
Custom Media Provider for Azure All the images/resources for only a given template (say X) are stored in azure. While all other images are still stored in Sitecore Media Library. When a user navigates to an item of template X in sitecore content tree, how can I tell sitecore to show the product image from Azure instead of Sql? Also, when the user is on an item of different template (not from template X) I still need the image from SQL. Is it possible to have multiple media providers(sql and azure) and tell sitecore to bring data from different providers based on template of current item? Or can we extend the default image type and add a new checkbox in the image type data type which says "Read from Azure" and use that to identify where to get the image from?
There two special access permissions for languages. Language Read and Language Write. To see them in the Security Editor/Access Viewer click Columns and then tick them in the list. Then you can set security permissions per language items (below /sitecore/system/languages/).
Language based roles We need to grant access to languages based on role (ex. the role for English and Spanish language) so that user with these roles will have access to specific languages.
After pulling out my non-existant hair, I decided to decompile the Sitecore.Forms.Core.dll. Lowe and behold, there is a check in FormsHandler.cs if the site is not in DisplayMode.Normal to ignore all save actions. In our particular case, the entire site is hidden behind the Sitecore login, therefore to test, it is our common practice to login to Sitecore, then preview the site. Previewing the site sets this flag to DisplayMode.Preview, thus causing all save actions to be ignored. Appending sc_mode=normal to the query string properly sets the flag to DisplayMode.Normal and allows all save actions to execute. I found no other posts about this anywhere, hopefully this helps someone some day.
Web Forms For Marketers Save Actions Not Executing In my instance of Sitecore 7.5, no Save Actions are being executed for WFFM. This is not related to custom save actions- no save actions are executing, even the default ones. I have tested by completely breaking the <successAction> pipeline in Sitecore.Forms.config. I added a processor with a namespace/assembly that is blatantly wrong, yet no matter what I do, I always receive the Success Message on the form. I have tried with numerous default actions. I've also gone so far as to brick the namespaces on those actions, and yet I still receive the success message- so clearly it is completely bypassing them. I reverted all code and configs to the native Sitecore install and a WFFM install. I pushed the required DLLs from my solution to get the site up and running- no other modules or 3rd party code is running.
This was resolved by adding the following config file to the App_Config\Include folder: Sitecore.Speak.Components.config. It was missing in my include folder.
Publishing Service Dashboard not showing correctly I have followed the steps to install the publishing service on my sitecore 8.2 initial release. I have checked the status of the publishing service and it gives me a 0 status which means that it has been installed correctly. However, after i installed the publishing service module and added the connection string to the include folder to override the url, when i open the publishing dashboard from the launchpad, it looks corrupted: and when i click on publish item from the content editor, it gives me the following popup: following are the errors showing in the developer tool: Any idea what did I miss?
Can you please check whether you have a "z.Habitat.DevSettings.config" in the App_Config/Include/Foundation folder? If not you should have a config file that contains the sourceFolder variable setting. The sitecore variable should be set like so: <sc.variable name="sourceFolder" value="C:\projects\Habitat\src" /> That variable is used in the serialization path. So you need to change the value to your own src location off course ;) The "sourceFolder" Sitecore variable should be visible in the http://yoursitename/sitecore/admin/ShowConfig.aspx
Helix Install Issue - Permissions on serialization folder Having a problem on a fresh Habitat setup... followed all steps, publish projects etc, but now I'm getting this error: Access to the path '$(sourceFolder)\feature\accounts\serialization' is denied. I've tried setting permissions on that folder, giving Everyone full access, but it doesn't make a difference. Using latest version as of yesterday. Sitecore was working fine before publishing foundation projects. Have not yet run Unicorn Sync. Any suggestions? Here's the full error: Access to the path '$(sourceFolder)\feature\accounts\serialization' is denied. 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.UnauthorizedAccessException: Access to the path '$(sourceFolder)\feature\accounts\serialization' is denied. ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6 and IIS 7, and the configured application pool identity on IIS 7.5) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user. To grant ASP.NET access to a file, right-click the file in File Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access. Source Error: Line 103: public Job StartRebuildAnalyticsIndexJob() Line 104: { Line 105: var options = new Sitecore.Jobs.JobOptions("Rebuild analytics index", "Indexing job", "shell", this, "RebuildAnalyticsIndex"); Line 106: return Sitecore.Jobs.JobManager.Start(options); Line 107: } Source File: C:\DATA\Latrobe.Sc\git\sitecore\src\foundation\Installer\code\MongoRestore\MongoRestoreService.cs Line: 105 Stack Trace: [UnauthorizedAccessException: Access to the path '$(sourceFolder)\feature\accounts\serialization' is denied.] System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +419 System.IO.Directory.InternalCreateDirectory(String fullPath, String path, Object dirSecurityObj, Boolean checkHost) +1438 System.IO.Directory.InternalCreateDirectoryHelper(String path, Boolean checkHost) +73 Rainbow.Storage.SerializationFileSystemDataStore.InitializeRootPath(String rootPath) +313 Rainbow.Storage.SerializationFileSystemDataStore..ctor(String physicalRootPath, Boolean useDataCache, ITreeRootFactory rootFactory, ISerializationFormatter formatter) +233 lambda_method(Closure , Object[] ) +246 Unicorn.Configuration.MicroConfiguration.Activate(Type type, KeyValuePair`2[] unmappedConstructorParameters) +826 Unicorn.Configuration.<>c__DisplayClass7_0`1.<RegisterExpectedConfigType>b__2() +38 System.Lazy`1.CreateValue() +709 System.Lazy`1.LazyInitValue() +191 Unicorn.Data.ConfigurationDataStore.RegisterForChanges(Action`2 actionOnChange) +19 Unicorn.Data.DataProvider.UnicornDataProvider..ctor(ITargetDataStore targetDataStore, ISourceDataStore sourceDataStore, IPredicate predicate, IFieldFilter fieldFilter, IUnicornDataProviderLogger logger, IUnicornDataProviderConfiguration dataProviderConfiguration, ISyncConfiguration syncConfiguration, PredicateRootPathResolver rootPathResolver) +547 lambda_method(Closure , Object[] ) +391 Unicorn.Configuration.MicroConfiguration.Activate(Type type, KeyValuePair`2[] unmappedConstructorParameters) +826 Unicorn.Configuration.MicroConfiguration.Resolve() +118 System.Linq.WhereSelectArrayIterator`2.MoveNext() +102 System.Linq.Buffer`1..ctor(IEnumerable`1 source) +148 System.Linq.Enumerable.ToArray(IEnumerable`1 source) +106 Unicorn.Data.DataProvider.UnicornSqlServerDataProvider..ctor(String connectionString) +232 [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) +329 Sitecore.Reflection.ReflectionUtil.CreateObject(Type type, Object[] parameters) +119 Sitecore.Configuration.DefaultFactory.CreateFromTypeName(XmlNode configNode, String[] parameters, Boolean assert) +119 Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +165 Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert) +72 Sitecore.Configuration.DefaultFactory.CreateObject(String configPath, String[] parameters, Boolean assert) +619 Sitecore.Configuration.DefaultFactory.CreateFromReference(XmlNode configNode, String[] parameters, Boolean assert) +170 Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +118 Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert) +72 Sitecore.Configuration.DefaultFactory.GetInnerObject(XmlNode paramNode, String[] parameters, Boolean assert) +932 Sitecore.Configuration.DefaultFactory.AssignProperties(XmlNode configNode, String[] parameters, Object obj, Boolean assert, Boolean deferred, IFactoryHelper helper) +560 Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +322 Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert) +72 Sitecore.Configuration.DefaultFactory.CreateObject(String configPath, String[] parameters, Boolean assert) +619 Sitecore.Configuration.DefaultFactory.GetDatabase(String name, Boolean assert) +157 Sitecore.Configuration.DefaultFactory.GetDatabase(String name) +55 Sitecore.Configuration.DefaultFactory.GetDatabases() +121 Sitecore.Data.Managers.LanguageProvider.InitializeEventHandlers() +73 Sitecore.Data.Managers.LanguageProvider..ctor() +225 Sitecore.DependencyInjection.DefaultSitecoreServicesConfigurator.<.cctor>b__a(IServiceProvider p) +31 Microsoft.Extensions.DependencyInjection.ScopedCallSite.Invoke(ServiceProvider provider) +117 Microsoft.Extensions.DependencyInjection.ServiceLookup.ConstructorCallSite.Invoke(ServiceProvider provider) +117 Microsoft.Extensions.DependencyInjection.ScopedCallSite.Invoke(ServiceProvider provider) +117 Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType) +100 Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider) +59 System.Lazy`1.CreateValue() +709 System.Lazy`1.LazyInitValue() +191 Sitecore.Globalization.Language.TryParse(String name, Language&amp; result) +139 Sitecore.Globalization.Language.Parse(String name) +63 Sitecore.Jobs.JobOptions..ctor(String jobName, String category, String siteName, Object obj, String methodName, Object[] parameters) +593 Sitecore.Jobs.JobOptions..ctor(String jobName, String category, String siteName, Object obj, String methodName) +66 Sitecore.Foundation.Installer.MongoRestore.MongoRestoreService.StartRebuildAnalyticsIndexJob() in C:\DATA\Latrobe.Sc\git\sitecore\src\foundation\Installer\code\MongoRestore\MongoRestoreService.cs:105 Sitecore.Foundation.Installer.MongoRestore.MongoRestoreProcessor.Process(PipelineArgs args) in C:\DATA\Latrobe.Sc\git\sitecore\src\foundation\Installer\code\MongoRestore\MongoRestoreProcessor.cs:30 (Object , Object[] ) +170 Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +484 Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain) +22 Sitecore.Nexus.Web.HttpModule.Application_Start() +259 Sitecore.Nexus.Web.HttpModule.Init(HttpApplication app) +704 System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +618 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) +539 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +125 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +731
I assume you have created multilist field on documents and data-source of the multilist field is Category items. Now if you select 1,3 and 4 categories into mulitlist of document 1 and 2 ,6 &amp; 7 categories for document d2 multilist field. On the front end you have checkboxes or any other thing for select categories now if you are selecting 1 and 2 then both document will show right? If this is the requirement then you can handle this by creating predicate builder and you can pass pipe separated categories into predicate builder as below code - var builder = PredicateBuilder.True(); //Filter with TemplateId builder = builder.And(i => i.TemplateId == [TemplateId]); //Created new builder for Category items and added again into main builder if (!string.IsNullOrEmpty(Categorys)) { var Categorybuilder = PredicateBuilder.False(); var CategoryItems = Categorys.Split('|'); foreach (var Category in CategoryItems) { var ct = Sitecore.ContentSearch.Utilities.IdHelper.NormalizeGuid(Categorys, true); Categorybuilder = Categorybuilder.Or(i => i.Category.Contains(ct)); } builder = builder.And(Categorybuilder); } Now pass this builder to search results query as below - var results=context.GetQueryable().Where(builder).Select(i => (Item)i.GetItem()).ToList() That way you can get the document values with OR. For more details you can also have a look my post - http://www.nttdatasitecore.com/Blog/2016/September/Sitecore-Lucene-Search-filtering-with-Predicate-Builder In this post I have written same scenario with multiple filters. Please let me know if something is not clear to you.
Filtering with Solr in Sitecore 8 Need your help in filtering. We have documents tagged to categories as below: d1 tagged to 1 ,3 &amp; 4 and d2 = 2 ,6 &amp; 7 I need to output as below: User selects category 1 and 2 and then click search.Result will be d1 and d2 3 => d1 7 => d2 3,6 =>d1 ,d2 5 => nothing With respect to implementation, I have a parameter named filter whose value will be comma seperated category (i.e the one selected by user in the ui Eg: 1,2) and I have a field exposed for each doecument as 1,2 (i.e comma seperated categories to which they are tagged) So now how can I get all documents corresponsing to the filter selected (passed as a parameter) by the end user?
The publish:end event will be triggered once at the end when all items have been published and therefore does not contain the list of all the items. If you are interested in collect information about the item you published you need to implement a handler in the publish:itemProcessed <event name="publish:itemProcessed"> <handler type="My.Assembly.Namespace.ItemProcessedProcessor, My.Assembly" method="ItemProcessed"> </handler> </event> This is your code for the processor: using System; using Sitecore.Data; using Sitecore.Publishing.Pipelines.PublishItem; namespace My.Assembly.Namespace { public class ItemProcessedProcessor { public void ItemProcessed(object sender, EventArgs args) { ItemProcessedEventArgs itemProcessedEventArgs = args as ItemProcessedEventArgs; PublishItemContext context = itemProcessedEventArgs != null ? itemProcessedEventArgs.Context : null; // your logic here } } }
How to get list of items that were published? I need to get list of items that were published but I don't know where to get it... I created publish:end handler public void OnPubEnd(object sender, EventArgs args) { var sitecoreEventArgs = ((SitecoreEventArgs) args); var item = Event.ExtractParameter(args, 0); } but it is no data about it in SitecoreEventArgs
There is no risk. Sitecore clean installation items are well know to every Sitecore develop (or at least easily accessible ;) ), like /sitecore node guid is {11111111-1111-1111-1111-111111111111}. Assuming that your solution is safe, you can expose all your item guids without any risk.
Do we have any security risk for exposing page Item GUID? We have number of article pages in our site. I am trying to create article RSS feed specifically for Facebook Instant Articles consumption. As per their documentation, each item in feed should have number of elements, among them, there is one <guid> element (A string that provides a unique identifier for this article in your feed.), Is it ok to pass Article Page Item Id for <guid> element? or do i need to send a randomly generated guid? What are the security risks, if we expose Sitecore Item Guids? I had already asked the same question in sitecore-chat slack channel, but the question was lost with other conversations. Any help would be much appreciated.
I am not 100% sure of this, but I believe what you are experiencing is because of the way xDB handles identified and unidentified contacts. From Identifying Contacts, we learn: Unidentified Contacts Every time a contact uses a device to interact with your website xDB creates a new contact record. New contacts enter the system as unidentified contacts because the only information collected at this point relates to the browser or device used. This is not enough to identify an individual across multiple devices. Contacts are connected to the devices they have been using but remain unidentified in the system until they provide a valid identifier. Clearing cookies in the browser breaks the connection between the contact and the device. And then Identified Contacts Depending on your requirements, there are different identification strategies that you can implement to identify contacts across their devices. For example: Introduce a login form. Connect to contacts using their given email address or phone number and SMS authentication. These all require you to integrate with the Sitecore platform calling the Identify() API call when applicable. Email Experience Manager (EXM) and the Web Forms for Marketers (WFFM) modules integrate with Sitecore to identify contacts when they open email links or complete a web form. All contact information, as well as an identified contact's history, can be accessed across multiple devices. When a contact identifies themselves using a particular device or browser, Sitecore stores the connection details and, by default, retains this association for the subsequent sessions that follow. So to point this to what you are experiencing, I believe you may have 120 contacts in total, 64 of which are identified - and only the identified ones make sense to pull up in a report.
Statistics overview for engagement plan shows wrong numbers I am experiencing weird behavior on engagement plan. We are running Sitecore 8.2 initial release. If I open the plan in "supervisor" mode I can see the overview on how much contacts are in each plan state. It says there are 120 contacts in my state. But if I click on that state to see contacts I see only 64 contacts which is correct number. Also total number of contacts in the plan is about 340 but it tells 532. So I have a question.. How come that happens and is there a way to fix it?
Not after-the-fact. I just tried logging into a vanilla Sitecore 8.2u2 instance as admin and changed the password. The only AUDIT message in the logs (where you would normally expect these events to be registered) was this one. 14264 15:41:03 INFO AUDIT (sitecore\admin): Login It is possible that if you installed something like the Advanced System Reporter, you would be able to get more detailed information on what your users were up to. But this would not apply retroactively on what has already transpired. I would take the issue to Sitecore Support; I feel a change password event is worthy of an AUDIT log entry out of the box.
Could it possible to find out who changed sitecore password through sitecore logs or db? Is it possible find out who changed sitecore password through sitecore logs or db ?
You need to overwrite (create a new) AddRendering command. As you can read here the dialog is opened in that command and the only way to really change the logic there is create you own. As shown in the blog, it can be done but be careful when upgrading as you need to "copy" some Sitecore code. The trick is to send a WebEditResponse with the correct parameters: WebEditResponse.Eval(FormattableString.Invariant( $"Sitecore.PageModes.ChromeManager.handleMessage('chrome:placeholder:controladded', {{ id: '{itemNotNull.ID.Guid.ToString("N").ToUpperInvariant()}', openProperties: {flag.ToString().ToLowerInvariant()}, dataSource: '{datasourceItem.ID.Guid.ToString("B").ToUpperInvariant()}' }});"));
Automatically set datasource when adding a rendering to a page My goal is to automatically set the datasource of a rendering when an certain rendering is added to the page in the Experience Editor. Since the datasource item is created when the user adds a rendering, I cannot set a static datasource path on the rendering itself. Currently I have the following partial solution: public void Process(GetRenderingDatasourceArgs args) { if (args == null) { throw new ArgumentNullException(nameof(args)); } // ... some code to: // - detect whether a datasource item should be created // - create datasource item // ... // set CurrentDatasource to the path of the newly added datasource item args.CurrentDatasource = datasourceItem.Paths.FullPath; } } This pipeline is patched before: Sitecore.Pipelines.GetRenderingDatasource.CheckDialogState, Sitecore.Kernel This results in the datasource item being created correctly and prefilled in the "Select the Associated Content"-dialog. However, I would like to skip this dialog and set the datasource of the rendering on the page immediately to the item I just created. Any suggestions how I can achieve this? The dialog:
Please see the release notes for 4.3 which explain how to remove the depth check: http://www.glass.lu/Blog/Release4-3 The depth check is designed to capture models where lazy loading is disabled but a loop might have been caused which would result in a stack overflow. However some models maybe deep enough anyway to cause the depth check to fire. Currently it is set to a depth of 8.
Glass Mapper Model too deep. Potential lazy loading loop exception after upgrading to version 4.3.4.196 I updated the Glass Mapper version for our Sitecore 8.2 project from version 4.0.1.8 to version 4.3.4.196. After upgrading Sitecore is still running, but our websites are throwing exceptions: Model too deep. Potential lazy loading loop I added the Cacheable property to the Models and I also had the Setting = SitecoreFieldSettings.DontLoadLazily on the Fields from before the upgrade. But no result, it keeps throwing this error. My model structure has not changed, anyone any idea what is going on? Or maybe that ModelDepthCheck can be disabled?
It's easier Today if you work with Sitecore 9, you can do it from your Content Management server. Just go to /sitecore/admin/ShowConfigLayers.aspx and select Content Delivery. This is article explaining in details how to View configuration changes
Viewing the compiled Sitecore config on Content Delivery? On Content Authoring servers, you can go to the control panel and view this page to see the compiled Sitecore config: /sitecore/admin/ShowConfig.aspx. It's also possible to do this via Sitecore Rocks. However I don't know a way of doing this on Content Delivery servers. Can anyone suggest, how can we verify config settings on Content Delivery server?
The cause of this was using the incorrect version of Sitecore with Habitat. I used Sitecore 8.2 Update 2 instead of Update 1. Reverting back to Update 1` resolved the issue..
Habitat Install Issue - System.InvalidOperationException: contextDatabase Another issue with Habitat install... getting this error when trying to log into Sitecore (after entering credentials). No idea what it's about, any clues? contextDatabase 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.InvalidOperationException: contextDatabase 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: [InvalidOperationException: contextDatabase] Sitecore.Forms.Core.Dependencies.DefaultImplItemRepository..ctor(Database contextDatabase, Database masterDatabase) +103 [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) +407 Sitecore.Reflection.ReflectionUtil.CreateObject(Type type, Object[] parameters) +119 Sitecore.Configuration.DefaultFactory.CreateFromTypeName(XmlNode configNode, String[] parameters, Boolean assert) +119 Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +165 Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert) +72 Sitecore.Configuration.DefaultFactory.CreateObject(String configPath, String[] parameters, Boolean assert) +619 Sitecore.Configuration.DefaultFactory.CreateFromReference(XmlNode configNode, String[] parameters, Boolean assert) +170 Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +118 Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert) +72 Sitecore.Configuration.DefaultFactory.GetInnerObject(XmlNode paramNode, String[] parameters, Boolean assert) +110 Sitecore.Configuration.DefaultFactory.GetConstructorParameters(XmlNode configNode, String[] parameters, Boolean assert) +163 Sitecore.Configuration.DefaultFactory.CreateFromTypeName(XmlNode configNode, String[] parameters, Boolean assert) +105 Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +165 Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert) +72 Sitecore.Configuration.DefaultFactory.CreateObject(String configPath, String[] parameters, Boolean assert) +619 Sitecore.Configuration.DefaultFactory.CreateFromReference(XmlNode configNode, String[] parameters, Boolean assert) +170 Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +118 Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert) +72 Sitecore.Configuration.DefaultFactory.GetInnerObject(XmlNode paramNode, String[] parameters, Boolean assert) +110 Sitecore.Configuration.DefaultFactory.GetConstructorParameters(XmlNode configNode, String[] parameters, Boolean assert) +163 Sitecore.Configuration.DefaultFactory.CreateFromTypeName(XmlNode configNode, String[] parameters, Boolean assert) +105 Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +165 Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, Boolean assert) +68 Sitecore.Events.EventSubscribers.Add(String eventName, XmlNode configNode) +545 Sitecore.Events.Event.GetConfigSubscribers() +564 Sitecore.Events.Event.RaiseEvent(String eventName, Object[] parameters) +373 Sitecore.Data.DataProviders.Sql.SqlDataProvider.SetProperty(String parameterName, String value, CallContext context) +274 Sitecore.Data.DataProviders.DataProvider.SetProperty(String name, String value, CallContext context, DataProviderCollection providers) +124 Sitecore.Data.DataManager.SetProperty(String name, String value) +116 Sitecore.Web.Authentication.DefaultTicketManager.CreateTicket(String userName, String startUrl, Boolean persist) +441 Sitecore.Pipelines.LoggedIn.Ticket.Process(LoggedInArgs args) +57 [TargetInvocationException: Exception has been thrown by the target of an invocation.] System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0 System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +128 System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +146 Sitecore.Reflection.ReflectionUtil.InvokeMethod(MethodInfo method, Object[] parameters, Object obj) +89 Sitecore.Nexus.Pipelines.NexusPipelineApi.Resume(PipelineArgs args, Pipeline pipeline) +313 Sitecore.Pipelines.Pipeline.Start(PipelineArgs args, Boolean atomic) +176 Sitecore.Pipelines.Pipeline.Start(String pipelineName, PipelineArgs args, Boolean atomic) +89 Sitecore.sitecore.login.Default.LoggedIn() +135 Sitecore.sitecore.login.Default.LoginClicked(Object sender, EventArgs e) +76 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +11802193 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +150 System.Web.UI.<ProcessRequestMainAsync>d__523.MoveNext() +7568
RAZL licensing is best handled through Hedgehog's sales team ([email protected]). I believe that the licensing depends on where the instance of Razl is installed. i.e You could run it from your own machine, and have connections to PROD, QA and DEV, but make the execution of the script run from your own machine running your own license. However this means all transfers are across the wire....whereas if it were running on one of the servers, you might find some performance boost. But for running locally, you also still maintain usage of Razl's UI for:- - comparison - filtering - link-navigating - granular copy controls - and script-generation capabilities On top of that, for the case you mention, consistent content migration is best done with Razl's History Syncing (https://www.youtube.com/watch?v=TRAWCvtsavg&amp;list=PLb9QmtmxCbhm5RnL42g1Trmr9-z_ZP40J&amp;index=11) which is also available in your scripts (and probably what you should be using for a scheduled weekly-sync). To setup a scheduled weekly sync, create a Windows task that executes weekly, running Razl.exe /script:"c:\Site Migration\Razl.xml".
Sitecore item auto sync from Prod to DEV & QA environment I want to schedule content sync from Prod to QA and DEV environment so while doing search I found following post: https://community.sitecore.net/developers/f/8/t/2438 But I do have further queries on this. Please suggest. Do we need license for target server also ( QA &amp; DEV ) also OR only once license is required from where( Prod ) we are actually sending content. As we know we can run script( Razl.exe /script:"c:\Site Migration\Razl.xml" ) manually from cmd command but is there any way we can schedule weekly basis.
If you look at the official MVP website you can see the question about the timeline there: What is the timeline of the selection process? The nomination is open during November for the exact dates please follow https://twitter.com/SitecoreMVP. We will review all the nominations and recommendations during December and we will finalize the award winners early January. The announcement of the Sitecore MVP Awards will be by the end of January. The press release is scheduled for the 31st January and every nominee will get an email couple of days before the announcement even if not awarded.
When are the Sitecore MVPs announced? How are MVPs typically notified? I'm curious when the Sitecore MVPs will be announced and for those of you that are currently MVP's, how were you notified in the past? Does Sitecore reach out to you directly?
I found the issue for my Solr problems. In my case the issue was in the Solrconfig, not Sitecore. The issue is that the default settings for the /select request somehow were changed to return JSON. Our team has a templated set of Solr settings. Somehow those settings got edited incorrectly thus cause JSON to be returned when XML was the expected default. Here's the configuration that caused the problem: <requestHandler name="/select" class="solr.SearchHandler"> <!-- default values for query parameters can be specified, these will be overridden by parameters in the request --> <bool name="terms">true</bool> REMOVED <lst name="defaults"> <str name="echoParams">explicit</str> <str name="wt">json</str> REMOVED <str name="indent">true</str> REMOVED <str name="df">text</str> <int name="rows">10</int> <bool name="terms">true</bool> REMOVED </lst> <arr name="last-components"> REMOVED ELEMENT <str>terms</str> </arr> </requestHandler> Where the final configuration should have looked like this: <requestHandler name="/select" class="solr.SearchHandler"> <!-- default values for query parameters can be specified, these will be overridden by parameters in the request --> <lst name="defaults"> <str name="echoParams">explicit</str> <int name="rows">10</int> </lst> </requestHandler> Thank you to Sitecore support for suggesting some good troubleshooting steps. We used Fiddler to figure out that our requests were returning JSON.
Issue with Sitecore Solr indexes Sitecore 8.1 Update 3 I am trying to convert the base Sitecore indexes from Lucene to Solr. I am using Sitecore 8.1 Update 3. I have 2 custom indexes that are still going to use Lucene for the time being so I still need the Lucene Default Index configuration enabled. Sitecore support confirmed this is allowed. I have configured Solr, generated the schemas for these indexes, have all the cores setup in the admin for Solr. I am able to Rebuild all of the indexes using the Index Manager. My issue is that when I try to go in the content editor for example I get the following exception: Exception: System.Xml.XmlException Message: Data at the root level is invalid. Line 1, position 1. Source: System.Xml at System.Xml.XmlTextReaderImpl.Throw(Exception e) at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace() at System.Xml.XmlTextReaderImpl.ParseDocumentContent() at System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options) at System.Xml.Linq.XDocument.Parse(String text, LoadOptions options) at SolrNet.Impl.SolrQueryExecuter`1.Execute(ISolrQuery q, QueryOptions options) at Sitecore.ContentSearch.SolrProvider.LinqToSolrIndex`1.Execute(SolrCompositeQuery compositeQuery, Type resultType) at Sitecore.ContentSearch.SolrProvider.LinqToSolrIndex`1.FindElements[TElement](SolrCompositeQuery compositeQuery) at Sitecore.ContentSearch.Linq.Parsing.GenericQueryable`2.GetEnumerator() at System.Linq.Buffer`1..ctor(IEnumerable`1 source) at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source) at Sitecore.ContentTesting.ContentSearch.TestingSearch.GetAllTests() at Sitecore.ContentTesting.Pipelines.GetContentEditorWarnings.GetContentTestingWarnings.AddSuspendedTestWarning(GetContentEditorWarningsArgs args) at Sitecore.ContentTesting.Pipelines.GetContentEditorWarnings.GetContentTestingWarnings.Process(GetContentEditorWarningsArgs args) at (Object , Object[] ) at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) at Sitecore.Shell.Applications.ContentManager.Editor.GetWarnings(Boolean hasSections) at Sitecore.Shell.Applications.ContentManager.Editor.Render(RenderContentEditorArgs args, Control parent) at Sitecore.Shell.Applications.ContentManager.ContentEditorForm.RenderEditor(Item item, Item root, Control parent, Boolean showEditor) at Sitecore.Shell.Applications.ContentManager.ContentEditorForm.UpdateEditor(Item folder, Item root, Boolean showEditor) at Sitecore.Shell.Applications.ContentManager.ContentEditorForm.Update() at Sitecore.Shell.Applications.ContentManager.ContentEditorForm.OnPreRendered(EventArgs e) I am trying to pull this apart in the code, but am not having much luck at the moment. It seems strange that I can rebuild the index, but they various pieces in the Shell can't seem to use it.
The path to your license file is set incorrectly. The default value of the license file setting in config is: <setting name="LicenseFile" value="$(dataFolder)/license.xml" /> If you have not change this, then most likely the issue is the dataFolder variable is not set correctly. Use a patch config set to update it to match the folder path your website is deployed to: <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> <sitecore> <sc.variable name="dataFolder"> <patch:attribute name="value">C:\Inetpub\wwwroot\my-project-location\Data</patch:attribute> </sc.variable> </sitecore> </configuration> The reason for the failure in your upgrade, at a guess, is that the dataFolder variable was updated directly in the <sitecore> section of web.config before, and when you upgrade to Sitecore 8.1 this has been moved to separate /App_Config/Sitecore.config file and therefore you lost your old setting. It's always best to use config patches to override Sitecore settings.
Sitecore Upgrade from 8.0 to 8.1 issue: Required license is missing: Runtime While upgrading sitecore 8.0 to 8.1. I have follow all the steps of upgrade guide. then i got the error "Required license is missing: Runtime". License file is the same as i have used in sitecore 8.0 and at the same place(Data folder). Please help me on this.
You want to use a static html page for this as otherwise you could end up in an endless loop. You can do this in your web.config like so: <customErrors mode="RemoteOnly" xdt:Transform="Replace"> <error redirect="/error.html" statusCode="500" /> </customErrors> You can then add a rewrite rule for each site to actually load a different static page for each site from a folder in your solution like so: <rule name="Server Error Rule" stopProcessing="true" enabled="true"> <match url=".*" /> <conditions> <add input="{URL}" pattern="^/error.html$" /> <add input="{HTTP_HOST}" pattern="^(admin|www).(mysite1|mysite2|mysite3)?.*.(com|co.uk)" /> </conditions> <action type="Rewrite" url="/errors/{C:2}.html" /> </rule> You will not be able to show info regarding the Sitecore item or other things that caused issues using this approach but I think it is risky to do so in case of Database connectivity issues and so forth. You would instead look at your Sitecore log files to find out what caused the problem.
Handling 500 errors in sitecore multi site multi language environment I found a similar question, but could not find out what I need from there I am trying to achieve a language-specific, content manageable, friendly error message page for 500 status code. What I have done so far is: Added a new processor in httpRequestEnd pipeline after Sitecore.Pipelines.HttpRequest.EndDiagnostics Finding if there is any internal server error. If there is, getting error Item from sitecore. public class Handle500Erros : HttpRequestProcessor { public override void Process(HttpRequestArgs args) { if (args?.Context?.Response.StatusCode == (int)HttpStatusCode.InternalServerError) { var errorPageItem = Sitecore.Context.Database.GetItem(string.Concat(Sitecore.Context.Site.StartPath, Settings.ErrorPage)); if (errorPageItem!= null &amp;&amp; Sitecore.Context.Item.ID!= errorPageItem.ID) { Sitecore.Context.Item = errorPageItem; //var htmlForErrorPageForSpecificlanguage = GetHtmlforErrorItem // set response html to htmlForErrorPageForSpecificlanguage } } } } Let's assume my error Item name in sitecore is 500Error Now my question is: How to get Html for the error sitecore Item? How to write that to response, seems like args.Context.Response is readonly? So if some error comes up at 500Error item I am just skipping this step, so there won't be any infinite loops happening. Am I over complicating? is there a better way to do this?
You can do it in the next way: First take the current item when the event was triggered Item item = Event.ExtractParameter(args, 0) as Item; Get the current site of the item : Sitecore.Web.SiteInfo siteInfo = Sitecore.Configuration.Factory.GetSiteInfoList() .FirstOrDefault(x => item.Paths.FullPath.StartsWith(x.RootPath)); var siteContext=Sitecore.Configuration.Factory.GetSite(siteInfo.Name) using (new SiteContextSwitcher(siteContext)) { //your logic }
Sitecore Context at Event Method I have an Sitecore (v8.1) Event and method that processing this event but Sitecore.Context is not available. I am try to use call SiteContextSwitcher but it does't help. SiteContext siteContext = SiteContext.GetSite(site); using (new SiteContextSwitcher(siteContext)) { Sitecore.Context.SetActiveSite(site); .... } What is the best option to get context in event ?
In theory the correct syntax is query:. (. being self) but there is a bug which means it does not work as expected. I would recommend not using fast: for performance reasons, instead set the Source of your Treelist field to the following: query:self:: This will select the current item as the root of the Treelist field.
Get Current Item children by fast query Using Sitecore 8.2 and the content tree looks like: sitecore |_Content |_Home |_Products |_Product 1 |_Product 2 |_Services |_Service 1 |_Service 2 The items Products &amp; Services are of the same template which has a treelist field. The items that can be selected from the treelist should be the children of that Menu item. For eg: For Products, author should see only Product 1, 2 in its tree list. Similarly, for Services, he should see only Service 1, 2. How can I write a query for the children path, in the template itself to achieve this. For now I'm doing these for each item at item level. fast:/sitecore/content/home/products/* fast:/sitecore/content/home/services/*
It used to not support basic authentication, There was a patch from sitecore to add support, but the github repository is now unpublished. (can request via portal) Here is a reference to the old patch https://github.com/ivansharamok/Sitecore.Support.449298/blob/master/README.md "Use patch 438539 that implements basic authentication using SolrNet HttpWebRequestFactory. If one requires Kerberos authenticaiton, consider implementing your own HttpWebRequestFactory that would work over Kerberos protocol." Here are some more recent posts on the topic. http://santoshpoojari.blogspot.co.uk/2017/03/solr-basic-authentication-secure.html?m=1 See release notes 8.2 update 6 https://dev.sitecore.net/Downloads/Sitecore%20Experience%20Platform/82/Sitecore%20Experience%20Platform%2082%20Update6/Release%20Notes Resolved issues "​​​Solr Basic Authentication does not work." 141324 Sitecore 9 default is for Solr to run over HTTPS. Would also recommend not making Solr publicly accessible/locked down to only be accessible from sitecore servers. Here is the apache securing Solr guide https://lucene.apache.org/solr/guide/6_6/securing-solr.html "No Solr API, including the Admin UI, is designed to be exposed to non-trusted parties. Tune your firewall so that only trusted computers and people are allowed access. Because of this, the project will not regard e.g., Admin UI XSS issues as security vulnerabilities. However, we still ask you to report such issues in JIRA."
Increasing SOLR security (hardening), and how Sitecore will handle with it? I'm looking to increase the security of my SOLR environment and wonder how Sitecore will handle with it? For example, I saw a possibility to use SSL and I guess it would be simply replace HTTP to HTTPS where I point SOLR server on Sitecore, but if I use another way to secure like Basic Authentication, how Sitecore will connect to SOLR? Also, I'm looking for advises in how to harden Solr if possible.
You'll want to follow the MongoDB security best practices: Enable Access Control and Enforce Authentication - You can use the default MongoDB authentication mechanism or an existing external framework. Authentication requires that all clients and servers provide valid credentials before they can connect to the system. Configure Role-Based Access Control - Create a user administrator first, then create additional users. Create a unique MongoDB user for each person and application that accesses the system. Create roles that define the exact access a set of users needs. Follow a principle of least privilege. Then create users and assign them only the roles they need to perform their operations. Encrypt Communication - Configure MongoDB to use TLS/SSL for all incoming and outgoing connections. Limit Network Exposure - Ensure that MongoDB runs in a trusted network environment and limit the interfaces on which MongoDB instances listen for incoming connections. Allow only trusted clients to access the network interfaces and ports on which MongoDB instances are available. Audit System Activity - Track access and changes to database configurations and data. Using Enterprise edition includes a system auditing facility that can record system events Encrypt and Protect Data - Configure the encrypted storage engine, or use application-level or 3rd party storage encryption. Run MongoDB with a Dedicated User - Run MongoDB processes with a dedicated operating system user account. Ensure that the account has permissions to access data but no unnecessary permissions. Run MongoDB with Secure Configuration Options - Disable server-side scripting if you are not using it. Do not enable the following, all of which enable the web server interface: net.http.enabled, net.http.JSONPEnabled, and net.http.RESTInterfaceEnabled. Keep input validation enabled. Don’t Ignore Security Best Practices - Review the MongoDB Security documentation to make sure you are following the best practices.
How to secure MongoDB replica set environment? Currently, I have 3 servers running MongoDB 3.0 as part of a Replica Set, and no security is applied. To connect I simple use mongodb://m01,m02,m03/analytics?replicaSet=rs0 Is it possible create users and roles that will be able to connect, read &amp; write in MongoDB to increase security?
1. Implement a custom token You can try to implement a custom token for that if you want to go on the safe way. Here is a great post how you can implement that. 2. Implement a custom field Possible solution could to use a custom field which is inherited from the default General Link field. Which is returning back the current item if it is empty. Here you can find how to implement a custom field. You can implement your own class, the following implementation is just a prototype but I think you need something similar. using Sitecore.Diagnostics; using Sitecore.Shell.Applications.ContentEditor; namespace YourProject { public class LinkWithDefault : Link { /// <summary> /// This is copied from Sitecore.Shell.Applications.ContentEditor.Link /// </summary> private XmlValue XmlValue { get { return new XmlValue(GetViewStateString("XmlValue"), "link"); } set { Assert.ArgumentNotNull(value, "value"); this.SetViewStateString("XmlValue", value.ToString()); } } public override string GetValue() { var xmlValue = this.XmlValue; if (!string.IsNullOrWhiteSpace(xmlValue.ToString())) { return xmlValue.ToString(); } xmlValue.SetAttribute("id", Sitecore.Context.Item.ID.ToString()); return xmlValue.ToString(); } } } To include this as a new custom field you can follow the instructions here: https://www.sitecore.net/company/blog/474/creating-a-custom-sitecore-field-4246
Sitecore General Link linking to itself (internal item) by default Every BasePage template I have has a general link field that needs its value to be set to itself by default, with the ability to change it. Is there anyway to do this on the standard values of the item? UPDATE: This means full use of standard values, updating as well as creation of the item.
This looks like an issue caused by to the way Sitecore config files are merged with a ref attribute. Since the <configuration> node has a ref to coveo/defaultIndexConfiguration, you will lose the fieldMap node coming from defaultIndexConfiguration if you redefine it in a specific index. You should either try patching the defaultIndexConfiguration fieldMap instead, or copy your whole fieldMap into each index in your patch file.
After reindex, some base Coveo-defined fields missing from content I've added some computed fields so I did the necessary re-indexing. Along the way, though, I noticed that a couple of the "default" Coveo fields (that is, field definitions in Coveo.SearchProvider.config that ship with Coveo for Sitecore) are no longer filling with data for my content, specifically "alltemplates" and "site". This is with CES 7 on-premesis, June release. For the moment, I'm using Coveo_master_index. If I go to Index in the admin portal, choose my index, click Fields on the left, click Manage Field Sets, then choose Field Sets for Coveo_master_index, I can still see the fields listed. But if I then go to the Content section, click Index Browser, and search for a piece of content by name, when I look at the field list neither "alltemplates" nor "site" are present anymore. I first noticed it because my queries use "alltemplates" to ensure the result set is using a specific base template, and during the process none of them returned data; as soon as I removed the "alltemplates" part of the query, the data showed up. I haven't modified the Coveo.SearchProvider.config file, and my new computed fields are in a separate patch config that fires after all the other Coveo ones. To add to the oddness of this, if I comment out my computed field definitions from my patch config and re-index, "alltemplates" and "site" come back into play. Is there some maximum number of fields that can be in play at once or something?
Pipeline Sitecore.Pipelines.Loader.ShowHistory is no longer used. Check your web.config (or sitecore.config) in App_Config and remove reference to this pipeline. But, if you have issue with this pipeline, most probably you have more corrupted configs in your solution. You may want to compare them with the clean Sitecore 8.2 configs.
Upgrading from 8.1 to 8.2 having an error this is the error that I get in log files. ERROR Could not resolve type name: Sitecore.Pipelines.Loader.ShowHistory, Sitecore.Kernel (method: Sitecore.Configuration.DefaultFactory.CreateFromTypeName(XmlNode configNode, String[] parameters, Boolean assert)). This is what I get in the browser: Server Error in '/' Application. Could not resolve type name: Sitecore.Pipelines.Loader.ShowHistory, Sitecore.Kernel (method: Sitecore.Configuration.DefaultFactory.CreateFromTypeName(XmlNode configNode, String[] parameters, Boolean assert)). 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.Exception: Could not resolve type name: Sitecore.Pipelines.Loader.ShowHistory, Sitecore.Kernel (method: Sitecore.Configuration.DefaultFactory.CreateFromTypeName(XmlNode configNode, String[] parameters, Boolean assert)). 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: [Exception: Could not resolve type name: Sitecore.Pipelines.Loader.ShowHistory, Sitecore.Kernel (method: Sitecore.Configuration.DefaultFactory.CreateFromTypeName(XmlNode configNode, String[] parameters, Boolean assert)).] Sitecore.Diagnostics.Error.Raise(String error, String method) +108 Sitecore.Configuration.DefaultFactory.CreateType(XmlNode configNode, String[] parameters, Boolean assert) +236 Sitecore.Configuration.DefaultFactory.CreateFromTypeName(XmlNode configNode, String[] parameters, Boolean assert) +46 Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +131 Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, Boolean assert) +42 Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, Boolean assert) +53 Sitecore.Pipelines.CorePipelineFactory.GetObjectFromType(XmlNode processorNode) +66 Sitecore.Pipelines.CorePipelineFactory.GetProcessorObject(XmlNode processorNode) +97 Sitecore.Pipelines.CoreProcessor.GetMethod(Object[] parameters) +129 Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +352 Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain, Boolean failIfNotExists) +162 Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain) +18 Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args) +18 Sitecore.Pipelines.CorePipeline.Run(String pipelineName, PipelineArgs args) +49 Sitecore.Nexus.Web.HttpModule.Application_Start() +156 Sitecore.Nexus.Web.HttpModule.Init(HttpApplication app) +472 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) +352 System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +296 [HttpException (0x80004005): Could not resolve type name: Sitecore.Pipelines.Loader.ShowHistory, Sitecore.Kernel (method: Sitecore.Configuration.DefaultFactory.CreateFromTypeName(XmlNode configNode, String[] parameters, Boolean assert)).] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9947444 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +261 Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1055.0
When you download the package the default filenames for SXA are Sitecore Experience Accelerator 1.2 rev. 161216 for 8.1.zip and Sitecore Experience Accelerator 1.2 rev. 161216 for 8.2.zip. Rename the file removing everything after the revision number and it will then show up in the Modules list, i.e. rename the file to Sitecore Experience Accelerator 1.2 rev. 161216.zip
What causes a Sitecore module not to work in Sitecore Instance Manager (SIM)? I remember having the problem awhile ago but I cannot find the solution again using Google etc. So I thought I'd post on here. I'm trying to add a module so that it can be selected in the instance creation wizard. I can select from many other modules including WFFM. But I cannot see Sitecore Experience Accelerator (SXA) when I place it in the repository directory or select it to be added during the process which prompts "Selected file is not a Sitecore module package". I'm downloading SXA v1.2 from https://dev.sitecore.net/Downloads/Sitecore_Experience_Accelerator/12/Sitecore_Experience_Accelerator_12_Initial_Release.aspx. The package contents look correct but I cannot remember what typically breaks these packages for SIM. I'm sure it was something simple :)
SOLR can be used with 8.2 update 1 (and 2). However, you need to install SOLR yourself, or choose for the azure search provider, which can be provisioned while provisioning your Sitecore PaaS Services to Azure. It's not required to have Coveo AND SOLR in 8.2.1. SOLR on itself is possible, Azure search can be used, lucene may be used (but not in the cloud). Coveo is an addition to the existing search providers. When using Coveo, you HAVE to have search providers like SOLR or Azure Search configured, as Coveo is only used for the websites, not for the CMS search.
Sitecore 8.2 Update 1, Using SOLR for both CMS search and Web search Can SOLR be used for Sitecore search and website search with latest release 8.2.1. the solution needs to be deployed on Cloud Is it required to have Coveo and SOLR both in order to implement search for Sitecore 8.2.1? What is the recommended best practice to use for SOLR search implementation for both CMS and Web search Are there any code samples available? I have already gone though the following links: https://doc.sitecore.net/sitecore_experience_platform/setting_up__maintaining/search_and_indexing/indexing/configure_a_search_and_indexing_provider https://doc.sitecore.net/sitecore%20experience%20platform/setting%20up%20%20maintaining/search%20and%20indexing/walkthrough%20setting%20up%20solr
Can I use the same session database for both sessions, or I need to have separate databases for shared and private sessions? You can use the same database, as long as you use Sitecore's session providers. Those providers are able to distinguish between session records of different session types. Can both CD1 and CD2 clusters use the same private session database? You can do this, but perhaps you should reconsider why you want to have two clusters altogether. A session server should always be as close as possible to the CD servers using it. ASP.NET session is retrieved and then saved back to the session store on every request, so having high latency between a CD and a session DB will directly impact your page loading times. Normally, you would separate your Sitecore instances into multiple clusters when they are geographically distributed. This way, the servers of any given cluster will be located in the same region (ideally, in the same data center) and have their own session DB close by, thus reducing network latency. If your CD servers are located in the same region, then why split them into several clusters? Normally, one cluster is enough. On the other hand, if CD1 and CD2 are in different regions, they should have separate session servers for optimal performance.
Configuring OutOfProc session state As per documentation (link) I need to configure the private and shared session state to be out of the process. My case is Content delivery cluster with a non-sticky load balancer I have decided to use SQL as my session storage. The question is: 1) Can I use the same session database for both sessions, or I need to have separate databases for shared and private sessions? 2) Can both CD1 and CD2 clusters use the same private session database?
Multiple keyword search is actually a relatively new feature to SPE and is only available in SPE version 4.4 or later. Check to ensure that that you are using SPE 4.4 or later and then you will be able to use keyword search in the following ways (per the issue comments by the developer, @AdamNajmanowicz): All words on item All keywords searched for must be present on the item, though they can be in separate fields. e.g. Searching for hello world will search for items that have the word hello in at least one field and the word world in at least one field. Literal phrase on item The quoted phrase searched for must be found as-is on one of the item's fields e.g. Searching for "hello world" will search for items that have the literal phrase hello world in at least one field. Getting the latest SPE If you are not using the SPE 4.4 or later, you can find the download for the latest SPE release, here.
How to use multiple words in Quick filter box in Sitecore powershell Show-Listview I am new for Sitecore Powershell, In the script I am using Show-Listview to display the result and it is providing option to Filter the result data. Powershell doc stating we can use multiple words in Filter box but If I use multiple words (for diff column values) it's not displaying any result. Can you suggest how to use multiple words in the quick filter box in Show-listview
You need to change: \Website\sitecore\shell\Applications\Dialogs\SelectRenderingDatasource\SelectRenderingDatasource.xml He use Sitecore.Shell.Applications.Dialogs.SelectRenderingDatasource class. You need to override method protected override void OnLoad(EventArgs e) You need to have something like if (yourconditionaretrue) { this.DisableCreateOption(); }
Disable 'Create new content' from 'Select the associated content' window I am using Sitecore 8.2 (initial release) and I have a case when for a rendering I have defined the fields 'Datasource Template' and 'Datasource Location' but I need to disable the button for 'Create new content' that appears in the window displayed in editor when adding a component. I can see that if no 'Datasource Template' is defined on the rendering the button is disabled by default, so this seems doable. Is there an easy way to somehow disable it even if I have defined the template for the rendering?
You can make use of MVC Areas (support for which was introduced in Sitecore 8.1). There are a number of strategies OOTB for resolving the area of a site, such as resolving by rendering parameters or layout definition. It's also possible to add your own strategy, we set your Area definition per site on the <site> node in using a similar processor as specified in this article by Kevin Brechbühl. Use whatever strategy works for you best. It's then possible to set the Area in the config of your project, and essentially create overrides of the views per project, you just need to ensure that Views are placed in the Areas folder and the follows the same structure as your Feature: Site-Project - Areas - [Site-Area-Name] - Views - FeatureName - view.cshtml Your project will require a dependency on the Feature (due to the model declaration and usage in your View) but this is a perfectly valid dependency within the principles.
How to handle alternative presentation for a helix Feature module Say I have a Feature layer module in my Helix compliant solution, e.g. the LinkMenu component in Sitecore.Feature.Navigation module from Habitat. Assuming I am happy with the way this works from a functional perspective for all of the sites in my solution, but Site A requires different html markup from Site B. What is the best way to override the cshtml rendering for each site? Everything else, Controller, Model templates etc would all work ok without modifying anything.
You can add your own replacement configuration into a .user file. <ItemGroup Condition=" '$(Configuration)' == 'Debug' "> <Replacement Include="[source folder]"> <TargetPath>[target folder]</TargetPath> <IsFolder>True</IsFolder> </Replacement> </ItemGroup>
TDS File Replacement per user I am using TDS File Replacement to manage configs. I would like to be able to do this per user, so each user can set up their environment however they wish. Right now, each user would need his or her own build configuration to do this. I could do it with a post build script, but really that has the same problem, each user would need their own build configuration. Can I configure File Replacement or a post build action in a .user file? UPDATE For example, I want a folder for each dev, which contains configs specific to that dev, then on build, I want whats in the Website folder replaced with whats in the dev specific folder.
With PowerShell you can use the New-UsingBlock cmdlet to mimick C#'s using statement. So assuming that you can use ancestors of the item to get the Site Root and then get the SiteContext from that you could do this to get the link: New-UsingBlock(New-Object -TypeName "Sitecore.Sites.SiteContextSwitcher" -ArgumentList $siteContext) { $linkUrl = [Sitecore.Links.LinkManager]::GetItemUrl($item); }
Create Sitecore Link with Powershell I'm working on some reports using Sitecore Powershell Extensions. One requirement is to provide the public URL for various Sitecore items. I'm thinking this isn't really possible via Link Manager because I don't have proper site context when running the report. Is my thinking correct? Is there another non-hardcoded way to generate the URL in this scenario? Does the concept of context switching exist within PSE? Probably important to note that this instance supports multiple sites so I can't assume a static domain for the URL. UPDATE After some Guidance from @Rirchard Seal and @Michael West below, here is what a function looks like to return a url: function Get-UrlForItem($item) { $linkUrl = "" $siteContext = [Sitecore.Sites.SiteContext]::GetSite("website"); New-UsingBlock(New-Object -TypeName "Sitecore.Sites.SiteContextSwitcher" -ArgumentList $siteContext) { $linkUrl = [Sitecore.Links.LinkManager]::GetItemUrl($item); $linkUrl } } Next up is to get the correct sitecontext for the item; right now I have it hard-coded to "website". Thanks guys!
I was intrigued by your question since I asked myself the same before. So I started investigating what happens when you click on 'Add here'. It triggers a webedit command: addrendering. If you look at the Sitecore.ExperienceEditor.config in the commands section, you'll find the following: <command name="webedit:addrendering" type="Sitecore.Shell.Applications.WebEdit.Commands.AddRendering, Sitecore.ExperienceEditor" /> I haven't looked at all the code in the AddRendering class, but there was 1 line in the Run method that got my attention: SheerResponse.ShowModalDialog(dialogUrl, "720px", "470px", string.Empty, true); 720px is the exact width of the Add rendering popup modal... So I copied the class to a test project, overwrote 720 to something larger, and it worked! Tested with Sitecore.NET 8.1 (rev. 160519) Note: I do agree with jammykam, updating CSS is probably the easiest way Note2: I noticed that the Insert Page dialog works differently. Insert Page is a SPEAK dialog, while Add Rendering is SHEER UI. To change the width of the Insert Page dialog go to the Core database and navigate to: /sitecore/client/Applications/ExperienceEditor/Dialogs/InsertPage/PageSettings/DialogSettings
Place to edit renderings popup window. Make larger I have implemented tabbed renderings in a client site, but the window is too small causing the user to scroll to see all the tabs. I have looked in the SelectRendering.xml file, but that seems to be inside of the popup. Anyone know of the proper place to edit the renderings popup to make the window larger? Update 1 After some investigation., the width is coming back from an API call to the WebEditRibbon.aspx page. http://SITE_URL/sitecore/shell/Applications/WebEdit/WebEditRibbon.aspx?sc_content=master&amp;ribbonId=%7B570A52B6-6755-461A-8052-5B95EF766F74%7D&amp;id=%7BEA0A499F-5304-4D12-AFAB-620A9EC33A2F%7D&amp;dev=%7BFE5D7FDF-89C0-4D99-9AA3-B5FBD009C9F3%7D&amp;db=master&amp;mode=edit&amp;url=%2F%3Fsc_mode%3Dedit%26sc_itemid%3D%257bEA0A499F-5304-4D12-AFAB-620A9EC33A2F%257d%26sc_lang%3Den%26sc_version%3D1%26sc_site%3Dwebsite&amp;la=en&amp;pageSite=website&amp;version=1&amp;sc_speakribbon=1 That returns this data. dialogWidth is what I need to track down. "dialogWidth:1175px;dialogHeight:605px;help:no;scroll:auto;resizable:yes;maximizable:yes;closable:yes;......
I have had severe issues with connecting Sitecore to write to databases (or even do first reads not from cache) when the SQL Azure was not in the same region. We have an East US primary region and West US failover region for one of our clients, and we had to stop installing packages of items in the West CM because it was just terrible connecting to the SQL Azure if it was still on its Eastern primary. I can only imagine going across to EU is even worse. I'm assuming in your topology you have a Web database in a West Europe Azure SQL which leads to your CM needing to execute compares and writes from its US region over that distance. The easiest way to solve the problem is to execute your publishes from the same region as the Web. This could be done a few ways: Setup a Sitecore instance on a West Europe VM so you can trigger manual publishes to your Europe CD or run a publishing agent to execute the publishes for you from that region. Leverage an existing non-CD instance in your West Europe region for one of the above. Upgrade to 8.2 so you can take advantage of the Publishing Service The Publishing Service is likely what you really need since all you want to do is geographically distribute your publishing without needing a full Sitecore instance, but unfortunately it doesn't work for 8.1
Sitecore publish speed with Azure We're using Sitecore 8.1 Update 2, with an Azure VM for the Sitecore instance and SQL Azure databases for the various Sitecore databases (and mLabs for MongoDB). Our CM is in one of the US regions, and one of our CDs is in the West Europe region, so the VM and databases are in that region as well. When we publish from CM to a US CD region, it goes relatively quickly, but when we publish from CM to a European CD, it seems to crawl along. I'm literally watching a publish of 1700 items increment one number at a time and it's very frustrating. Are there any tuning tips for these scenarios to look at? It seems like the write-speed to SQL is slow, could that be related to the service level we've chosen needing to be more robust? Is it just going from the US region to the EU region is naturally slower? I noticed after doing code changes to our EU VMs, they took longer for Sitecore to recycle than their US counterparts, but theoretically the configurations are identical.
tl;dr - Delete [Manager Root]/Messages/Service Messages/Self-Service Subscription/Subscription Notification and the emails will stop sending. There no is no explicit option to disable the email, but if the confirmation email cannot be found it will simply be skipped and won't throw an error. The confirmation email is located via a relative path from the Messages folder inside the Manager Root (eg. "Email Campaign"). The path comes from the StandardMessages.SubscriptionNotification setting, which has a default value of "Service Messages/Self-Service Subscription/Subscription Notification". NB. The confirmSubscription parameter of ClientApi.UpdateSubscriptions relates to sending the user an email that request that they confirm the subscription before actually being added to the list. Its path is defined via the StandardMessages.SubscriptionConfirmation setting, but there's no need to delete that item if you set confirmSubscription to false.
How to disable "Subscription Notification" emails when subscribing to a list When users subscribe to a list via ClientApi.UpdateSubscriptions (or using a built in control, presumably) a confirmation email is sent to them even if the confirmSubscription parameter is false. The email has the subject "Subscription Notification" and the body "You have successfully subscribed to this email group." Is there a way to disable this email from being sent?