output
stringlengths
34
25.7k
instruction
stringlengths
81
31k
input
stringclasses
1 value
In Sitecore 10 they are in Sitecore.Annotations.dll, e.g. Sitecore.Annotations.NotNullAttribute
Sitecore.Kernel 10.2- no attributes In Sitecore.Kernel 9.1 there were attributes, for example: Sitecore.NotNullAttribute I don't see them in version 10.2 of this library. Does anyone know if they've been moved, or is there a replacement?
Login is possible with single POST request URL: /sitecore/api/ssc/auth/login Body: { "username": "admin", "password": "b", "domain": "sitecore" }
A non-interactive client login to Experience Editor (Sitecore 9.3) I am writing a service tool where I need to invoke a web request to Experience Editor page from command line. I need to authorize the request with Sitecore user. How can I do this? I found some examples for Sitecore Commerce, Sitecore Command Line Interface, and API controllers. https://doc.sitecore.com/xp/en/developers/101/developer-tools/configure-a-non-interactive-client-login.html https://doc.sitecore.com/xp/en/developers/93/sitecore-experience-commerce/bearer-token-authentication.html https://doc.sitecore.com/xp/en/developers/93/sitecore-experience-manager/use-bearer-tokens-in-client-applications.html Is there something similar possible with Sitecore Experience Editor pages? Or not similar but still possible to use from command line?
GetThemeItem method is dependant on theme mode item with ID {79C7FE02-185A-4576-B5A8-5B0AC10DB0CB}. Make sure this item is published.
Creative exchange object null reference error We have upgraded to Sitecore 10.1 from Sitecore 8.2. The Creative Exchange feature is giving object null reference error in web database when creating a new site using powershell script. How to reproduce the error. Create a new sxa site Check the Creative Exchange under modules Publish the new site to web database. Open the Home item of new created website in the web database and object null reference error will appear. The error only appears when a new sxa site is created with Creative Exchange module. [NullReferenceException: Object reference not set to an instance of an object.] Sitecore.XA.Foundation.Theming.ThemingContext.GetThemeItem(Item item, DeviceItem device) +143 Sitecore.XA.Feature.CreativeExchange.Commands.CreativeExchangeCommandBase.QueryState(CommandContext context) +315 Sitecore.Shell.Framework.Commands.CommandManager.QueryState(Command command, CommandContext context) +36 Sitecore.Web.UI.WebControls.Ribbons.Ribbon.FillParamsFromCommand(CommandContext commandContext, RibbonCommandParams ribbonCommandParams) +220 Sitecore.Web.UI.WebControls.Ribbons.Ribbon.GetCommandParameters(Item controlItem, CommandContext commandContext) +78 Sitecore.Web.UI.WebControls.Ribbons.Ribbon.RenderLargeButton(HtmlTextWriter output, Item button, CommandContext commandContext) +77 Sitecore.Web.UI.WebControls.Ribbons.Ribbon.RenderButton(HtmlTextWriter output, Item button, CommandContext commandContext) +439 Sitecore.Web.UI.WebControls.Ribbons.Ribbon.RenderChunk(HtmlTextWriter output, Item chunk, CommandContext commandContext) +347 Sitecore.Web.UI.WebControls.Ribbons.Ribbon.RenderChunk(HtmlTextWriter output, Item chunk, CommandContext commandContext, Boolean isContextual, String id) +243 Sitecore.Web.UI.WebControls.Ribbons.Ribbon.RenderChunk(HtmlTextWriter output, Item chunk, CommandContext commandContext, Boolean isContextual) +160 Sitecore.Web.UI.WebControls.Ribbons.Ribbon.RenderChunks(HtmlTextWriter output, Item strip, CommandContext commandContext, Boolean isContextual) +431 Sitecore.Web.UI.WebControls.Ribbons.Ribbon.RenderStrips(HtmlTextWriter output, Item ribbon, Boolean isContextual, ListString visibleStripList) +1621 Sitecore.Web.UI.WebControls.Ribbons.Ribbon.RenderStrips(HtmlTextWriter output, Item defaultRibbon, Item contextualRibbon, ListString visibleStripList) +161 Sitecore.Web.UI.WebControls.Ribbons.Ribbon.Render(HtmlTextWriter output) +739 System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +131 Sitecore.Web.HtmlUtil.RenderControl(Control ctl) +79 Sitecore.Shell.Applications.ContentManager.ContentEditorForm.UpdateRibbon(Item folder, Boolean isCurrentItemChanged, Boolean showEditor) +559 Sitecore.Shell.Applications.ContentManager.ContentEditorForm.Update() +581 Sitecore.Shell.Applications.ContentManager.ContentEditorForm.OnPreRendered(EventArgs e) +191 [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) +132 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.Shell.Applications.ContentManager.ContentEditorPage.OnPreRender(EventArgs e) +143 System.Web.UI.Control.PreRenderRecursiveInternal() +200 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +7479 Has anyone encountered this issue? Thanks in advance .
You're missing ".ToString()" after .guid. $currentscript.id.guid.ToString() And you should switch the order most probably, like that: $scriptlist.add($currentscript.DisplayName, $currentscript.id.guid.ToString())
In SPE how can we assign dynamic hashtable to Read-variable options for checklist editor I have a requirement to show list of options as checklist to user for selection. If followed In Powershell how to enable/show options like Select All | DeSelect All for Multilist field type , it have static data for checklist then its working fine but when i am having an object whoes value evaluated at runtime then its not working. e.g. $scriptlist=@{} $scriptitems = get-childitem '/sitecore/system/Modules/PowerShell/Script Library' -recurse | where{$_.templateid -eq '{DD22F1B3-BD87-4DB2-9E7D-F7A496888D43}' } |foreach-object{ $currentscript=$_ $scriptlist.add($currentscript.id.guid,$currentscript.DisplayName) } Now i want to show this list as input to user, if i use below code: $dialogParams = @{ Title = "Dialog title" Description = "Description under title" OkButtonName = "Execute" CancelButtonName = "Close" ShowHints = $true Parameters = @( @{ Name = "checkListSelector" Title = "Checklist Selector" Editor = "checklist" Options = $scriptlist Tooltip = "Select one or more options" } ) } But getting error in logs: $dialogResult = Read-Variable @dialogParams Although i tried to change (Options = $scriptlist) with new variable but that also didn't work. Please let me know if i am missing anything.
It looks like configuration of your website includes reference to Upload Filter tool. It is mentioned in Secure the file upload functionality Sitecore documentation: https://doc.sitecore.com/xp/en/developers/90/platform-administration-and-architecture/secure-the-file-upload-functionality.html Now it looks like the dll is missing. You have 2 options: Copy right version of Upload Filter tool dll into bin folder Remove config that mentions CheckExtension class (most probably App_Config\Include\UploadFilter.config)
Error while uploading Sitecore Package Getting the following error while uploading (not installing), any Sitecore package: 9484 14:41:39 ERROR Could not resolve type name: **Sitecore.Pipelines.Upload.CheckExtension, Sitecore.UploadFilter** (method: Sitecore.Configuration.DefaultFactory.CreateFromTypeName(XmlNode configNode, String[] parameters, Boolean assert)). 9484 14:41:39 ERROR Application error. Exception: System.Web.HttpUnhandledException Message: Exception of type 'System.Web.HttpUnhandledException' was thrown. Source: System.Web at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
There are few tools which can be helpful in this case: https://github.com/SitecoreUnicorn/Unicorn https://doc.sitecore.com/xp/en/developers/101/developer-tools/serialization-plugin.html https://www.teamdevelopmentforsitecore.com/ In general the idea is to serialize a set of items which you are working on (not entire database) to disk as text files. This will allow you to version them using git, make them a part of the deployment package and install them on the staging server. The method itself is different depending on which tool would you like to use. Additionally you can move items between different environment using packages. You can create a package with items from the Desktop view You have to select the items or entire item branches and include them in the package. Once all your items are included, you can download the package and install it on any other instance. Please note that unlike the tools used to serialize the items it is hard to version the items when they are exported as a package or automate the whole process. On the other hand you can create such a package quite fast and it is available out of the box in any version of Sitecore.
How to deploy the changes from development environment to staging environement? What is the best way to deploy changes from development to staging. I have made huge changes in the code, and I know how to deploy that, just change the bin folder. I have also made changes in the Views folder, so I can also change that. I could just publish everything and it can be done automatically. But what about templates and renderings? How can I change that, without adding them manually to the staging environment? That would be ridiculous, I think most of you can agree on that. Both develop, and staging environments are using different databases, so is there maybe a SQL query, so I can deploy those templates and everything else with that. Again that is manually adding stuff, but I feel like it is much easier for me. Anybody has any tips on how to do this?
Default SXA process for robots.txt is: <getRobotsContent> <processor type=&quot;Sitecore.XA.Feature.SiteMetadata.Pipelines.GetRobotsContent.GetContentFromSettings, Sitecore.XA.Feature.SiteMetadata&quot; resolve=&quot;true&quot; /> <processor type=&quot;Sitecore.XA.Feature.SiteMetadata.Pipelines.GetRobotsContent.GetDefaultRobotsContent, Sitecore.XA.Feature.SiteMetadata&quot; resolve=&quot;true&quot; /> <processor type=&quot;Sitecore.XA.Feature.SiteMetadata.Pipelines.GetRobotsContent.AppendSitemapUrl, Sitecore.XA.Feature.SiteMetadata&quot; resolve=&quot;true&quot; /> </getRobotsContent> First it gets content from settings item - make sure that url which you use points to the right site, instead of default website or other site. Then (only if settings content for robots is empty) it reads content from physical robots.txt file if it exists. And in the end, if settings of the site defines Sitemap Status as active, it adds empty line plus Sitemap: ... line. In your case it should render content of the settings field. Why it doesn't? Maybe it's not published? Maybe wrong language version (I don't remember if field is shared)? Maybe it's matching wrong site? Maybe try adding ?sc_site=yoursitename in the url after robots.txt?
How to set CMS field value for Robots.txt Using Sitecore 10.1 with Commerce 10.1 There is a field Robots Content in this item - /sitecore/content/Tenant/MySite/Settings. This is a container setup and creating a file is not an option. When a user browses mysite/robots.txt, I want the robots.txt to have whatever is entered in the CMS field. This outcome is not consistent. If the content is this: User-agent:* Crawl-delay: 10 Sitemap: https://example.com The output is Sitemap: https://example.com There is some logic happening internally here and it is removing content. Is there any documentation explaining this. Is there any way to achieve what I need without overwriting the processor. UPDATE: I have realized that the content in the robots.txt page seems to be from cache. I had to do an iisreset for every CMS change. But this issue remains. When I add Crawl-delay:10 it is not showing in the robots page. That part is being removed.
You can write the code something like this. And it will open a prompt in Powershell and show the controls. $dropDownSelector = Get-Item -Path &quot;master:\content&quot; $dialogParams = @{ Title = &quot;Dialog title&quot; Description = &quot;Description under title&quot; OkButtonName = &quot;Execute&quot; CancelButtonName = &quot;Close&quot; ShowHints = $true Parameters = @( @{ Name = &quot;dropDownSelector&quot; Title = &quot;Dropdown Selector&quot; Root = &quot;/sitecore/content/&quot; Tooltip = &quot;Enter item name or select from tree&quot; } @{ Name = &quot;dropTreeSelector&quot; Title = &quot;Droptree Selector&quot; Editor = &quot;droptree&quot; Source = &quot;/sitecore/content&quot; Tooltip = &quot;Select from dropdown tree&quot; } ) } $dialogResult = Read-Variable @dialogParams For more information of other field types, please refer this link https://www.oshyn.com/blog/read-variable-parameters
How to enable multiselect in dialog prompt? how to set up multiple select on the Sitecore PowerShell interactive dialog? Thanks
I`ve faced the same issue. Looks like a bug. My workaround was to move context parameters out of offer: { <#if (offers)??> &quot;decisionOffers&quot;: ${toJSON(offers)}, </#if> &quot;firstName&quot;: &quot;${guest.firstName!}&quot; } Experience response is: { &quot;decisionOffers&quot;: [ { &quot;ref&quot;: &quot;fcde595f-fd78-41db-8b0e-23b5af1f1185&quot;, &quot;name&quot;: &quot;Offer &quot;, &quot;description&quot;: &quot;Offer &quot;, &quot;status&quot;: &quot;ACTIVE&quot;, &quot;attributes&quot;: { &quot;imageUrl&quot;: &quot;https://icycoupons.com/img/single-offer/womensbest.jpg&quot;, &quot;title&quot;: &quot;Dear ${guest.firstname}, 40% Off Best Coupon!&quot;, &quot;description&quot;: &quot;Save money on things you want with a Women's Best promo code or coupon. Join the Women's Best Rewards Club for Birthday Offers, Early Access to Limited Editions &amp; Surprise Gifts with Every Purchase.&quot;, &quot;linkUrl&quot;: &quot;https://by.wildberries.ru/brands/womens-store&quot; } } ], &quot;firstName&quot;: &quot;Denis&quot; } As you can see substitution doesn`t work inside offer, but works outside. And you can substitute your variablr in HTML markup, like this: <h1>Dear {{firstName}},</h1> {{#decisionOffers}} {{#attributes}} <div class=&quot;img-container&quot;> <div class=&quot;img-container__image&quot; style='background-image: url(&quot;{{imageUrl}}&quot;);'></div> </div> <div class=&quot;bx-transition-card__body&quot;> <h3>[[Title | string | {{title}} | {required:true, group: Title, order: 1}]]</h3> <p>[[Description | text | {{description}} | {required:true, group: Description, order: 1}]]</p> <div class=&quot;options-container&quot;> <a id=&quot;bx-transition-card--secondary&quot; class=&quot;options-container__secondary&quot;>[[Dismiss Text | string | No Thanks | {required:true, group: Secondary Button, order: 1}]]</a> <a id=&quot;bx-transition-card--primary&quot; class=&quot;options-container__primary&quot; href=&quot;{{linkUrl}}&quot;>[[CTA Text | string | Yes Please | {required:true, group: CTA Button, order: 1}]]</a> </div> </div> {{/attributes}} {{/decisionOffers}} </div>
How to resolve context parameter on offer in Sitecore CDP? I have Sitecore CDP Interactive Experience defined based off Decision Model that returns an offer. On offer data I have context parameter ${guest.firstname} defined but its not resolving its value and returning it as-is in the experience response. JSON response: { &quot;decisionOffers&quot;: [ { &quot;ref&quot;: &quot;616b2261-9cd1-48a1-94c5-e7d00f89b4d5&quot;, &quot;name&quot;: &quot;Harsh-50-USD-Discount&quot;, &quot;description&quot;: &quot;USD 50 Discount&quot;, &quot;status&quot;: &quot;ACTIVE&quot;, &quot;attributes&quot;: { &quot;imageurl&quot;: &quot;https://via.placeholder.com/150/A0A0A0/FFFFFF/?text=$+50+Off&quot;, &quot;name&quot;: &quot;50% off on Apple Watches ${guest.firstname}&quot; } } ] } Should this resolve by itself before returning response and how? Image:
Solr provides Tagging and Excluding Filters functionality to support facets for multi-select fields. It allows to tag a part of filter query and then exclude the tagged part when counting facets for a specific field. Sitecore Content Search provider currently does not support tag and ex parameters and does not have any Linq extension methods for passing them to Solr. There is a good example of how to prepare and apply these parameters by extending Sitecore Content Search query with SolrNet QueryOptions in the question Sitecore Solr multiple filter tagging / excluding. However, if you want to solve this by using only out-of-the-box Content Search API, be prepared to perform N+1 requests to Solr (where N is the number of multi-select filters with at least one option selected): Request with all filters applied to get valid results. Request without conditions from the first multi-select filter to get facets for this filter options. Request without conditions from the second multi-select filter, and so on until you process all multi-select filters.
Maintain Facet count after faceting I'm using Sitecore 9.3 and Solr 8.1.1. I'm developing a search filter using Sitecore Content Search API, with the behavior of keeping the facet count the same even after selecting options. For example, if the filter have these options : Option 1 , count = 11 Option 2 , count = 20 Option 3 , count = 8 If I select Option 1, other options' count will change according to this selection. I don't want that, I want to maintain the count as it is in the same Solr query. At the same time, I have multiple filters, so I want to keep the count for only the options in the selected filter, while other filters count can be changed.
The method System.IO.Path.InternalGetTempFileName() will attempt to create a file in the folder returned by System.IO.Path.GetTempPath() using a Win32Native command. If this command fails your will get the IOError you are seeing, which might lead us to one of the following conclusions: The web application does not have write access to the folder it's trying to create the file in The web application has write access, but not read access There are so many files in the target folder that it's not possible for the Temp File Generation system to add a new one Seeing as you've already checked most of these we should conclude that the system is not writing to the place you think it's writing to. When I need to test this sort of thing quickly I create a test.aspx file in the root of the solution which I can add some &quot;code beside&quot; into to execute some commands and return some trace data to the screen. You can use this technique and flex some WebForms Skillz(TM) to verify the path returned by System.IO.Path.GetTempPath() which is public, where the method cited in the stack is private and can't be (easily) called directly. If you want to be very tricksy you can use reflection to execute this private method. There is a public version of the System.IO.Path.GetTempFileName() which calls the Internal method with true as an argument. You could verify the arguments that Sitecore is using, but seeing as it's not &quot;System&quot; it's probably also using this public method so that would be a good test. A try/catch might reveal some additional data in InnerExceptions from Win32 that would provide more clues. Lastly you can install SysInternals Process Monitor. It's EXTREMELY noisy so keep it disabled till the last second then enable it, run your test page, and immediately disable it again. You'll still have 32,000 events per second but if you narrow down to failed file system events you might get lucky and capture the event that causing the failure. PS: If your app pool is 32-bit instead of 64-bit you might need to look at C:\Windows\SysWOW64 instead of C:\Windows\System32 even if System32 is reported in your telemetry, as this path is symlinked in to replace System32 for compatibility with 32-bit apps under various circumstances.
Sitecore 8.2 package designer fails with The file exists error I have a Sitecore task that generates a package of a specific set of content to export and then import to another instance. This task uses some pretty generic code and works in other environments but does not in production. The package designer in the UI is also failing with the same error so I know this is not my code. The code is failing in the package generation method in the Sitecore.Kernel.dll with the dreaded The file exists error. I have checked all temp directories including .net temp files, C:\Windows\Temp (which I have verified is the directory that the app is using), and C:\temp\packages (the directory I am writing the package to for the API to be able to access). I have also verified that all directories in the app pool have read/write/modify access to all directories in question. There are 0, and I mean zero files in these directories. I do see that when I run my code a temp file does get created but then it immediately errors out with the File Exists error. If anyone has any idea what I can do at this point I am grasping at straws! Code calling: using (new global::Sitecore.SecurityModel.SecurityDisabler()) { using (var writer = new PackageWriter(MainUtil.MapPath(fileName))) { Context.SetActiveSite(&quot;shell&quot;); writer.Initialize(Installer.CreateInstallationContext()); Log.Error(&quot;LocationDetailExportRepo: PackageGenerator.GeneratePackage&quot;, this); PackageGenerator.GeneratePackage(packageProject, writer); Context.SetActiveSite(&quot;website&quot;); } } Error stack: ManagedPoolThread #18 12:32:17 ERROR LocationDetailExportRepo: Error with building export package System.IO.IOException: The file exists. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.Path.InternalGetTempFileName(Boolean checkHost) at Sitecore.Zip.ZipWriter..ctor(String outputFile, Encoding encoding) at Sitecore.Install.Zip.PackageWriter.Initialize() at Sitecore.Install.Zip.PackageWriter.Put(PackageEntry entry) at Sitecore.Install.PackageGenerator.GeneratePackage(PackageProject solution, ISink`1 writer) at ihc.org.DataAccess.LocationDetailExport.LocationDetailExportRepo.PackageLocationData() in C:\work\repo\ihc.org.DataAccess\LocationDetailExport\LocationDetailExportRepo.cs:line 111 at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.Path.InternalGetTempFileName(Boolean checkHost) at Sitecore.Zip.ZipWriter..ctor(String outputFile, Encoding encoding) at Sitecore.Install.Zip.PackageWriter.Initialize() at Sitecore.Install.Zip.PackageWriter.Put(PackageEntry entry) at Sitecore.Install.PackageGenerator.GeneratePackage(PackageProject solution, ISink`1 writer) at ihc.org.DataAccess.LocationDetailExport.LocationDetailExportRepo.PackageLocationData() in C:\work\repo\ihc.org.DataAccess\LocationDetailExport\LocationDetailExportRepo.cs:line 111
There are couple of ways to approach that. Sitecore allows you to create a package definition as an XML file and then build a package from that definition. You can access package definition from the &quot;Start menu&quot; in the Desktop view and then go to Development Tools and Package Designer. If you want to create the package: Create the package definition using the designer or load it if it already exists If you are creating package definition add all the trees your module consists of (eg. /sitecore/layout/renderings/feature/navigation and /sitecore/templates/feature/navigation) so all the child items are automatically included Build &amp; download the package If you want to automate the whole process you can use PowerShell script to create packages: $package = New-Package &quot;Packing in Powerful Ways&quot;; # Set package metadata $package.Sources.Clear(); $package.Metadata.Author = &quot;Your Name&quot;; $package.Metadata.Publisher = &quot;Your Company&quot;; $package.Metadata.Version = &quot;1.0&quot;; $package.Metadata.Readme = 'Some description' # Add contnet/home to the package $source = Get-Item 'master:\layout\renderings\feature\ModuleName' | New- ItemSource -Name 'Module Name Renderings' -InstallMode Overwrite $package.Sources.Add($source); # Save package Export-Package -Project $package -Path &quot;$($package.Name)-$($package.Metadata.Version).zip&quot; -Zip # Offer the user to download the package Download-File &quot;$SitecorePackageFolder\$($package.Name)-$($package.Metadata.Version).zip&quot; Script will be much more powerful as you can adjust it to run for every module and can be triggered using PowerShell remoting. See the Sitecore PowerShell docs for more information. Downsides of using the packages Using package might seem easier but remember that packages are binary files and are hard to version. Serialization (tools suggested by @Rauman Gupth) allows you to convert items into text format which are easier to version.
How to deploy the site modules from one environment to another? I recently asked the question about the deployment of certain items from one environment to another. But the question I have now is how to deploy the site modules? I want to choose the path of making the packages and use the items inside the packages to deploy them. Is it possible to use this with site modules or is it not? What is the solution here when it comes to site modules?. Should I use them with packages or not?
You can check test database related configuration from this url: https://<sitename>/sitecore/admin/showconfig.aspx in your browser. You can check showconfig file through Content Editor as well : To view the configuration: Log in to Sitecore with an administrator account. Open the Control Panel. In the Administration section, click Administration Tools. To see the current configuration, click Show Config. You have to search for the following string: <database id=&quot;test&quot; This will allow you to identify which config file the configuration node comes from eg. <database id=&quot;test&quot; ... patch:source=&quot;Configuration.File.You.Are.Lookin.For.config&quot;> If you find any configuration related to test database then try to find it in configuration files(.config) under webroot path: ....\websitename\App_Config\Include and delete them.
Could not find configuration node: databases/database[@id='test'] When I try to make a package from package designer, I am getting this error Could not find configuration node: databases/database[@id='test']. I may know why this happens, and the reason for that is that my other colleagues that were working on the project, made a database just for test, and it looks like when they made a new environment they copied the entire configuration from that environment to this new one, and now I have a problem, because I do not have a test database on this new environment. Is there any way that I can delete this configuration beacuse I do not need this database now? Because this is a test database. How to do this?
Check file in your Identity Server instance: {siteroot}\Config\production\Sitecore.IdentityServer.Host.xml and add your Sitecore URL to the AllowedOriginsGroup1 similarly to the example below: <AllowedCorsOrigins> <AllowedCorsOriginsGroup1>https://sxa.storefront.com|https://abc.com</AllowedCorsOriginsGroup1> </AllowedCorsOrigins>
Sitecore XC10.1.2 - Invalid_request I'm trying to install the Sitecore XC 10.1.2 locally and I'm facing a issue, that I have no idea what is it. The installation went well without any error, but when I try to log in in the Admin Page, I got an error, saying that the request were invalid. In the logfile, I got the following error: Invalid redirect_uri: &quot;https://sxa.storefront.com/identity/signin&quot; AuthorizeRequestValidationLog { ClientId: &quot;Sitecore&quot;, ClientName: &quot;Sitecore&quot;, RedirectUri: null, AllowedRedirectUris: [&quot;{AllowedCorsOrigin}/identity/signin&quot;, &quot;{AllowedCorsOrigin}/signin-oidc&quot;], SubjectId: &quot;anonymous&quot;, ResponseType: null, ResponseMode: null, GrantType: null, RequestedScopes: &quot;&quot;, State: null, UiLocales: null, Nonce: null, AuthenticationContextReferenceClasses: null, DisplayMode: null, PromptMode: &quot;&quot;, MaxAge: null, LoginHint: null, SessionId: null, Raw: [(&quot;client_id&quot;: &quot;Sitecore&quot;), (&quot;response_type&quot;: &quot;code id_token token&quot;), (&quot;scope&quot;: &quot;openid sitecore.profile&quot;), (&quot;state&quot;: &quot;OpenIdConnect.AuthenticationProperties=tBHwULJMw2L-zKKFiRE3G4hXSKET2cIfKWqRL59--yevCD7j_5mbTxWpWymI0ewNGMJ7Rp0IcScYC4IvGIf2sVVEkbfHE1acqsoz0VR-TRTPcIGtYutN967V0mjjNuBj7mu3CUubg3j2-gNl3tF1jE5eMewL-WLXMJZxdyVzvYNRxYWs9gEmknx80VCpNK9tGJ5SDUAdMBFZgLGTpAt7ZA&quot;), (&quot;response_mode&quot;: &quot;form_post&quot;), (&quot;nonce&quot;: &quot;637853795860560397.ZDdlZTRjZDMtNWY3Ni00MDAwLWIxZDItNzNjODM3MjVhMWU4MWQ1NWY0ZDEtZTRjYi00ZDdjLWIwMTktMTkyMThiZmUyNzYz&quot;), (&quot;redirect_uri&quot;: &quot;https://sxa.storefront.com/identity/signin&quot;), (&quot;sc_account_prefix&quot;: &quot;sitecore\&quot;), (&quot;x-client-SKU&quot;: &quot;ID_NET461&quot;), (&quot;x-client-ver&quot;: &quot;5.3.0.0&quot;)] } Does anyone know how to solve this error ?
Now we have the refreshed documentation here. You have to use the Guest Delete endpoint in the Sitecore CDP Batch API to delete a guest record and all associated entities such as orders, sessions and events. Please note, that once a guest record is deleted you cannot restore it back! The below is a quick overview of how to delete a Guest: Upload a batch file containing the concerned guest records. Ensure that every guest record is aligned with the guest delete data model and has all mandatory fields specified: ref, schema, mode, value. A classic example in case you use the email attribute as an identifier will be as follows: { &quot;ref&quot;:&quot;e6f467b1-4d45-4cbf-9709-329f3e202951&quot;, &quot;schema&quot;:&quot;guest&quot;, &quot;mode&quot;:&quot;delete&quot;, &quot;value&quot;:{ &quot;email&quot;:&quot;[email protected]&quot; } } Note, that there are two options for the mode attribute: gdpr_delete and delete. So, if you are deleting the guest records in order to meet the GDPR compliance, use the gdpr_delete mode, otherwise use the delete mode for any other reason. If there is enough identifying information then the Guest Delete endpoint will attempt to find a guest record and permanently delete it. In case the Guest Delete endpoint finds more than one guest with matching identities it will delete the first one and return a 200 Response like n matches found for this guest, 1st match deleted, and you will need to perform the same procedure to delete the remaining records. If no matching guests were found then the Guest Delete endpoint will return a 404 Response like Guest not found.
Deleting a guest profile in CDP Has anyone tried deleting a guest profile in CDP when a request to forget comes from a customer? The documentation seems a little confusing, about the process to create a batch first and then send request also the method of the request is not mentioned. https://doc.sitecore.com/cdp/en/developers/sitecore-customer-data-platform--data-model-2-1/using-guest-delete.html
Before you do anything, first find out why you have duplicated </body>, </html> tags. Looks suspicious. Manipulate HTML once tags are rendered by modifying/creating your own version of \Views\SxaLayout\SxaLayout.cshtml btw. some SXA <script> elements are rendered before </body> and that's expected.
Clear extra Sitecore SXA html tags from the site pages I have SXA site pages and I need to clear the extra Sitecore html tags (script,link). After div tag Specification: Sitecore SXA 10.2 Can anyone provide any help ?
Without log entries it will be hard to help, but if I had to guess I would say you might be facing one of the following issues: The application pool for your Sitecore instance does not have read access to the xConnect cert or your cert has expired. You can check both easily enough. To check if access is the issue, add everyone with read access to the required cert, then refresh the page. To check if the cert has expired, then simply check the Expiration Date column in MMC. Note: You will want to find the cert in MMC by thumbprint, and you get the thumbprint from the AppSettings.config file in your xConnect instance. You have multiple Sitecore instances installed on the same machine. I have seen some strange things happen where this is the case, one of them being that the analytics dashboards break. To fix this in dev, I just generate a self-signed cert and update all the configuration with the new thumbprint. Your xConnect instance is configured with a different cert thumbprint than the one that your Sitecore instance is using. Easy enough to check, open the ConnectionString.config file in your Sitecore instance, then open the AppSettings.config file in your xConnect instance, then compare the value in the 'validateCertificateThumbprint' app setting from xConnect against the thumbprint in the ConnectionString file (screenshot below) from your Sitecore instance. Hope this helps!
Experience Profile 403 error The Experience Profile shows the correct data with no console errors when I logged into Sitecore for the first time but refreshing the page gives the error An error has occurred. The only way to see the data is to close the browser, open a new browser session, and logged into Sitecore but refreshing the page will bring the error again. I am using Sitecore 10.1 Did anyone experience any similar issues? Thanks in advance
Sitecore internally uses the current language in the cache key so the above approach will work fine for different language versions as well. It treats every sublayout or rendering as a different version in each language. The layout engine implements caching by retrieving the output that is previously generated by a component based on the language version, under similar conditions, instead of invoking the component again. By default, the layout engine executes each presentation component for each HTTP request, without any output caching. So it will work fine in every language.
Html cache on rendering with "vary by data" in Multiligual site I am using html cache on rendering level with &quot;vary by data&quot;, and it is working fine for english version. But i am not sure whether it will work on different language version or not as, it is using the same data source but with different language version. Thanks
A possible solution I can suggest: If you have a backup of your Inetpub folder then you can restore that one and for the Sitecore content editor you can use the Vanilla Sitecore instance master database and restore that one. Delete everything and reinstall the Sitecore instance again and make a practice to have a backup of your Sitecore Database and Inetpub folder before publishing and making any new changes to the code and DLL. To delete everything and reinstall perform the below steps: Stop the IIS and remove the configuration Delete Sitecore Service Delete the file system Remove the entry from the host file Delete the database Stop Solr service Delete the SOLR search indexes Delete Certificates for more details about the above-mentioned steps refer to the blog post: Uninstall Sitecore Instance Manually
Reset Sitecore 10.2 control editor and inetpub folder in the root directory I have installed Sitecore 10.2 using SIA and I need to reset the control editor (so that all the templates and sites created get deleted) and the inetpub folder gets cleared up as well. Is there a way to reset the Sitecore control editor and inetpub folder to its original form or do I need to delete everything and reinstall it?
As already mentioned by Mark the best way is to use configuration from Sitecore. Keep in mind the following parts: IdentityProvidersProcessor -- here you can set your authentication settings and configure your app to use the specific authentication like: args.App.UseGoogleAuthentication(googleAuthOptions); AuthenticationMiddleware - you can use Nuget packages like Microsoft.Owin.Security.Google Optional you if you have a custom claim that needs to be linked for a user as identifier you can use Sitecore.Owin.Authentication.Services.DefaultExternalUserBuilder, here you can override the CreateUniqueUserName.
Migrate existing Owin implementation from pre-Sitecore 9 I am migrating an app from Sitecore 8 to 10. The existing app was built with .Net 4.6.1 and uses Microsoft AspNet Identity and Owin for user access. The Startup class uses the OwinStartupAttribute annotation: [assembly: OwinStartupAttribute(typeof(Application.Web.Startup))] And the Startup class includes setting up the user and signin managers: app.CreatePerOwinContext(ApplicationDbContext.Create); app.CreatePerOwinContext<ApplicationUserManager>(ApplicationUserManager.Create); app.CreatePerOwinContext<ApplicationSignInManager>(ApplicationSignInManager.Create); After migrating to Sitecore 10.1.1 and attempting to login to the app as was done previously, the call to find a user by email fails with: System.ArgumentNullException: Value cannot be null. Parameter name: manager at Microsoft.AspNet.Identity.UserManagerExtensions.FindByEmail[TUser,TKey](UserManager`2 manager, String email) I see in appSettings that Sitecore 10 is now registering it's own Owin Startup: <add key=&quot;owin:appStartup&quot; value=&quot;Sitecore.Owin.Startup, Sitecore.Owin&quot; /> I have found that if I comment this out of appSettings, the user application's login works just fine; but Sitecore's admin login no longer works. And if I leave it in appSettings, the opposite is true - Sitecore's Admin login works and the user application's login fails with the error above. I haven't had much success in finding how to integrate so that both logins can work independently with their own separate stores and login screens like it was working in Sitecore 8. The Sitecore 10 that we are deploying to will be using the newer Sitecore Identity. Is there a good reference for doing this?
You can use the following, which will give you all the linked items of an item like image, droplink, link, etc. The script you will use is this. Get-Item -Path &quot;master:&quot; -Uri &quot;sitecore://master/<Your Item ID>&quot; | Get-ItemReference -ItemLink So to test this, I have these fields on an item. So when I run this, it will give me the output for a template, and two drop links. SourceItemLanguage : SourceItemVersion : 0 TargetItemLanguage : TargetItemVersion : 0 SourceDatabaseName : master SourceFieldID : {0D83E59A-C3F1-41BE-81B2-762D35E0799F} SourceItemID : {089FB61A-D804-4205-AFB8-BC7099C7AABD} TargetDatabaseName : master TargetItemID : {7313C9A1-836B-4871-899E-2618BB7DA955} TargetPath : {7313C9A1-836B-4871-899E-2618BB7DA955} SourceIsLanguageIndependent : True SourceItemLanguage : SourceItemVersion : 0 TargetItemLanguage : TargetItemVersion : 0 SourceDatabaseName : master SourceFieldID : {00000000-0000-0000-0000-000000000000} SourceItemID : {089FB61A-D804-4205-AFB8-BC7099C7AABD} TargetDatabaseName : master TargetItemID : {E5781591-1FB0-4C23-8197-068911765AD4} TargetPath : {E5781591-1FB0-4C23-8197-068911765AD4} SourceIsLanguageIndependent : True SourceItemLanguage : SourceItemVersion : 0 TargetItemLanguage : TargetItemVersion : 0 SourceDatabaseName : master SourceFieldID : {24171BF1-C0E1-480E-BE76-4C0A1876F916} SourceItemID : {089FB61A-D804-4205-AFB8-BC7099C7AABD} TargetDatabaseName : master TargetItemID : {7E8D1A67-55A4-4037-BCE0-B7C4150A3C10} TargetPath : {7E8D1A67-55A4-4037-BCE0-B7C4150A3C10} SourceIsLanguageIndependent : True Now you can create a loop on these items and then use the following script to create a language version. Add-ItemLanguage -Item $Item -Language &quot;en-US&quot; -TargetLanguage &quot;en&quot; -IfExist OverwriteLatest
How can I create new language version for linked items using Sitecore PowerShell Extensions? How can I create new language version item for linked items of page using Sitecore PowerShell Extensions? Script for items language version creation: #Create new items with new language function Create-ItemsLangVersion { param( [string]$path, [bool]$publish, [bool]$setToDraft, [bool]$isIdpItem ) $items = @() New-UsingBlock (New-Object Sitecore.Data.BulkUpdateContext) { $items += Get-Item $path $items += Get-ChildItem $path -Recurse #For each selected item and child items, set new language definition foreach($baseItem in $items) { #For each selected target languages foreach($language in $newLang){ $targetLangItem = Get-Item -Path $baseItem.Paths.FullPath -Language $language if(($baseItem -ne $null -and $baseItem.Versions.GetVersions().Count -gt 0) -and ($targetLangItem -eq $null -or $targetLangItem.Versions.GetVersions().Count -eq 0)) { Add-ItemLanguage -Item $baseItem -Language $baseLang -TargetLanguage $language -IfExist Skip $baseLangItemId = $baseItem.Id.Guid.ToString(&quot;B&quot;) $newLangItem = Get-Item -Path master: -Language $language -Id $baseLangItemId Copy-FinalRenderings $baseItem $newLangItem Write-Host &quot;New language version created for item:&quot; $baseItem.ID &quot; - &quot; $baseItem.Name if($publish -eq $true) { Publish-NewLangItem $newLangItem } if($setToDraft -eq $true) { if($isIdpItem -eq $true) { Update-WorkflowToIdpDraft $newLangItem } else { Update-WorkflowToDraft $newLangItem } } } else { Write-Host &quot;Skipped item:&quot; $baseItem.ID &quot; - &quot; $baseItem.Name } } } } } So if content for example have list of options, or dropdown values list, I also need to create item for each of them in dropdown list.
I think that your Upgrade Script item is not PDF file. So, first you should figure out why it is recognized as a PDF. Default Sitecore media content extractor works in the following way: item should be indexed; content extractor tries to get values of following item fields: Mime Type and Extension (mime type has a higher priority); content extractor parses <mediaIndexing> node (default configuration is in Sitecore.ContentSearch.Solr.DefaultIndexConfiguration.config) and tries to match value from previous step to corresponding extractor (ComputeFieldValue implementation). It seems that your item has Extention field which value is in the list of extensions -> includes (check your includes/excludes nodes configuration). If your item really has PDF content and you want to extract text: by default Sitecore uses PDFSharp library for content extraction, but it is very primitive and can extract text only from limited PDFs files (without any postprocessing/scans/etc.). Your issue is very common and it is error/limitation of PDFSharp itself; if you want to use iFilter instead of PDFSharp: the simplest way is to enable App_Config\Include\Examples\Sitecore.ContentSearch.ContentExtraction.IFilter.config.example config. It seems that your patch is not correct and you have erased Sitecore.ContentSearch.ContentExtraction.Readers.DefaultReaderFactory, but I`m not sure without seeing all configs. iFilter is also not the best option and is very slow (I think it does not help in your situation). If you need smart PDF recognition - take a look at TikaOnDotnet (good sitecore module is https://github.com/michaelthyregod/Contrib.Sitecore.ContentSearch/tree/master/src/Contrib.Sitecore.ContentSearch.TikaOnDotnet). P.S.: if you need OCR support to extract text from scanned PDFs, take a look at my Tesseract module for sitecore https://github.com/x3mxray/Tesseract.Sitecore.ContentSearch)
DefaultMediaItemTextExtractor logs an error 'Cannot extract content from media item with id GUID' Sitecore 10.2 running in Docker Desktop for Windows While crawling content I started seeing tons of errors messages in the Sitecore log: 2080 13:47:43 ERROR DefaultMediaItemTextExtractor: Cannot extract content from media item with id '{59AB8B22-2179-48D5-AEF4-068DF0DED0E8}'. Exception: PdfSharp.Pdf.IO.PdfReaderException Message: The PDF document is protected with an encryption not supported by PDFsharp. Source: PdfSharp at PdfSharp.Pdf.Security.PdfStandardSecurityHandler.ValidatePassword(String inputPassword) at PdfSharp.Pdf.IO.PdfReader.Open(Stream stream, String password, PdfDocumentOpenMode openmode, PdfPasswordProvider passwordProvider) at PdfSharp.Pdf.IO.PdfReader.Open(String path, String password, PdfDocumentOpenMode openmode, PdfPasswordProvider provider) at Sitecore.ContentSearch.ContentExtraction.Readers.PdfSharpReader.ReadAll(String filePath) at Sitecore.ContentSearch.ContentExtraction.Common.DefaultMediaItemTextExtractor.ExtractTextFromMedia(MediaItem mediaItem) What makes this even more strange is that {59AB8B22-2179-48D5-AEF4-068DF0DED0E8} represents an item of template type /sitecore/templates/Foundation/Experience Accelerator/Upgrade/Upgrade Script. Is there a recommended solution to address this error? Docker Image Solution? One thing I did try, thinking that these were PDFS, was install the Adobe IFilter in the container. Added the following to my CM Dockerfile: COPY .\PDFFilter64installer.msi C:\install\ RUN Start-Process -FilePath 'msiexec.exe' -ArgumentList '/i', 'C:\\install\\PDFFilter64installer.msi', '/quiet', '/norestart' -NoNewWindow -Wait; ` Remove-Item -Path 'C:\\install' -Recurse -Force; Installer downloaded from Adobe's FTP site. Then I patched the mediaFileTextExtractor: <?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?> <configuration xmlns:patch=&quot;http://www.sitecore.net/xmlconfig/&quot; xmlns:role=&quot;http://www.sitecore.net/xmlconfig/role/&quot;> <sitecore role:require=&quot;Standalone or ContentManagement or ContentDelivery&quot;> <contentSearch> <indexConfigurations> <contentExtraction> <mediaFileTextExtractor> <patch:delete /> </mediaFileTextExtractor> <mediaFileTextExtractor type=&quot;Sitecore.ContentSearch.ContentExtraction.IFilter.IFilterMediaFileTextExtractor, Sitecore.ContentSearch.ContentExtraction&quot;/> </contentExtraction> </indexConfigurations> </contentSearch> </sitecore> </configuration> Related links Indexing PDF content with Solr error solr Sitecore full text indexing ifilter Update While this may not be the right solution for everyone, I was able to disable this functionality by using the following patch: <?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?> <configuration xmlns:patch=&quot;http://www.sitecore.net/xmlconfig/&quot; xmlns:role=&quot;http://www.sitecore.net/xmlconfig/role/&quot; xmlns:search=&quot;http://www.sitecore.net/xmlconfig/search/&quot;> <sitecore role:require=&quot;Standalone or ContentManagement or ContentDelivery&quot;> <!-- Save time by not extracting content. --> <contentSearch> <indexConfigurations> <defaultSolrIndexConfiguration search:require=&quot;solr&quot;> <mediaIndexing> <mimeTypes> <includes> <patch:delete /> </includes> <includes> <mimeType type=&quot;Sitecore.ContentSearch.ComputedFields.MediaItemHtmlTextExtractor, Sitecore.ContentSearch&quot;>text/html</mimeType> <mimeType>text/plain</mimeType> </includes> </mimeTypes> <extensions> <includes> <patch:delete /> </includes> <includes/> </extensions> </mediaIndexing> </defaultSolrIndexConfiguration> </indexConfigurations> </contentSearch> </sitecore> </configuration> Turns out that some of these items were from custom templates for media items which do not have associated blob data. Sitecore has no way to ignore content extraction based on template ID, hence the errors.
I got the same error couple of days back and in my case, it turned out to be: Analytics.AutoDetectBots was set to false. I just changed this setting to true. Couple of more things to check: Check if you have a valid XDB license: How to check Sitecore.xDB.base in license file? Open <CM_Host>/sitecore/admin/showconfig.aspx and check below configs: Xdb.Enabled should be set to true. Xdb.Tracking.Enabled should be set to true. Analytics.AutoDetectBots should be set to true. Ensure that your layouts contain the VisitorIdentification tag: @Html.Sitecore().VisitorIdentification()
Sitecore 9.3 forms Robot Detection Steps I am starting with Sitecore Forms. When I am going to create new form, I have a message on the top &quot;You must have Sitecore xDB installed and robot detection in Experience Analytics configured to enable robot detection&quot; I have xDB installed and Added Ip addresses for robot to ignore. What else I need to do to make this message go away. Also this is a VM that doesn't have any outside connectivity. I can create new forms but robot detection checkbox is disabled. I am using Sitecore 9.3.
Step 1. Add a new config file to your {webroot folder}/App_Config/Include area to include an /api/search GraphQL endpoint: <configuration xmlns:patch=&quot;http://www.sitecore.net/xmlconfig/&quot; xmlns:set=&quot;http://www.sitecore.net/xmlconfig/set/&quot; xmlns:role=&quot;http://www.sitecore.net/xmlconfig/role/&quot;> <sitecore> <api> <!-- Define the app's Sitecore GraphQL API endpoint Note: this can be removed if you are not using GraphQL. Note: the endpoint must be defined both for integrated and connected type GraphQL queries. --> <GraphQL> <endpoints> <searchGraphQLEndpoint url=&quot;/api/search&quot; type=&quot;Sitecore.Services.GraphQL.Hosting.DatabaseAwareGraphQLEndpoint, Sitecore.Services.GraphQL.NetFxHost&quot; resolve=&quot;true&quot;> <url>$(url)</url> <enabled>true</enabled> <enableSubscriptions>true</enableSubscriptions> <!-- lock down the endpoint when deployed to content delivery --> <graphiql role:require=&quot;ContentDelivery&quot;>false</graphiql> <enableSchemaExport role:require=&quot;ContentDelivery&quot;>false</enableSchemaExport> <enableStats role:require=&quot;ContentDelivery&quot;>false</enableStats> <enableCacheStats role:require=&quot;ContentDelivery&quot;>false</enableCacheStats> <disableIntrospection role:require=&quot;ContentDelivery&quot;>true</disableIntrospection> <schema hint=&quot;list:AddSchemaProvider&quot;> <content type=&quot;Sitecore.Services.GraphQL.Content.ContentSchemaProvider, Sitecore.Services.GraphQL.Content&quot;> <!-- scope typed template generation to just this app's templates --> <templates type=&quot;Sitecore.Services.GraphQL.Content.TemplateGeneration.Filters.StandardTemplatePredicate, Sitecore.Services.GraphQL.Content&quot;> <database>context</database> <paths hint=&quot;list:AddIncludedPath&quot;> <templates>/sitecore/templates/Project/search</templates> </paths> <fieldFilter type=&quot;Sitecore.Services.GraphQL.Content.TemplateGeneration.Filters.StandardFieldFilter, Sitecore.Services.GraphQL.Content&quot;> <exclusions hint=&quot;raw:AddFilter&quot;> <!-- Remove system fields from the API (e.g. __Layout) to keep the schema lean --> <exclude name=&quot;__*&quot; /> </exclusions> </fieldFilter> </templates> <queries hint=&quot;raw:AddQuery&quot;> <!-- enable querying on items via this API --> <query name=&quot;item&quot; type=&quot;Sitecore.Services.GraphQL.Content.Queries.ItemQuery, Sitecore.Services.GraphQL.Content&quot; /> <query name=&quot;search&quot; type=&quot;Sitecore.Services.GraphQL.Content.Queries.SearchQuery, Sitecore.Services.GraphQL.Content&quot;/> </queries> <fieldTypeMapping ref=&quot;/sitecore/api/GraphQL/defaults/content/fieldTypeMappings/standardTypeMapping&quot; /> </content> </schema> <!-- Enables the 'jss' graph nodes that are preformatted to use with JSS rendering components, and the datasource resolving queries for JSS --> <extenders hint=&quot;list:AddExtender&quot;> <layoutExtender type=&quot;Sitecore.JavaScriptServices.GraphQL.JssExtender, Sitecore.JavaScriptServices.GraphQL&quot; resolve=&quot;true&quot; /> </extenders> <!-- Determines the security of the service. 'publicService' is open to anonymous access, but requires an SSC API key. --> <security ref=&quot;/sitecore/api/GraphQL/defaults/security/publicService&quot; /> <!-- Determines how performance is logged for the service. Defaults are defined in Sitecore.Services.GraphQL.config --> <performance ref=&quot;/sitecore/api/GraphQL/defaults/performance/standard&quot; /> </searchGraphQLEndpoint> </endpoints> </GraphQL> </api> </sitecore> Step 2. Open GraphQL Playground in a browser window and visit the new /api/search URL https://{your-sitecore-host}/api/search/ui?sc_apikey={your-api-key} Step 3. Insert this query on the left that contains the requested computed index field name you want to retrieve (in my case it was searchcontent_txm). Please note, that this field is requested outside the item{} block, as inside you can only request for Sitecore item fields. query Search($rootItem: String!, $keyword: String!, $pageSize: Int!) { search( rootItem: $rootItem fieldsEqual:[ { name: &quot;searchcontent_txm&quot;, value: $keyword} ] first: $pageSize latestVersion: false ) { results { items{ item { id name path url navigationTitle: field (name:&quot;navigationTitle&quot;) { value } description: field (name:&quot;description&quot;) { value } } searchcontent: field(name:&quot;searchcontent_txm&quot;) score } totalCount pageInfo { endCursor hasPreviousPage hasNextPage } } } } Step 4. Give your query some input parameters, e.g.: { &quot;rootItem&quot;: &quot;/sitecore/content/your-website/home&quot;, &quot;keyword&quot;: &quot;cinnamon&quot;, &quot;pageSize&quot;: 5 } Execute your query and see your results :)
Graph QL Search Result Computed Field I have started to look at using Graph QL for search using the endpoint that comes out the box with Sitecore 10.1. I've read that the results are based on an item but had lazy loading eg. You have indexed a field. How does this work in regards to computed fields, how do I see this as part of my results set?
The problem is that by default in the docker example the Sitecore.LoadBalancing.Enabled setting is set to true which gets the schema for this SPEAK processor from the HttpContext.Current.Request.Headers[Settings.LoadBalancingScheme] and for some reason it contains http,https value which is not a valid HTTP schema. To do a quick and dirty fix you can apply the following patch: <configuration xmlns:patch=&quot;http://www.sitecore.net/xmlconfig/&quot; xmlns:role=&quot;http://www.sitecore.net/xmlconfig/role/&quot;> <sitecore> <pipelines> <preprocessRequest> <!-- FIX: fix if &quot;http,https&quot; is in the Settings.LoadBalancingScheme header --> <processor patch:before=&quot;processor[@type='Sitecore.Pipelines.HttpRequest.OverrideDialogs, Sitecore.Speak.Applications']&quot; type=&quot;Feature.Pipelines.LoadBalancingSchemeFix, Feature&quot; role:require=&quot;Standalone or ContentManagement or ContentDelivery&quot; /> </preprocessRequest> </pipelines> </sitecore> </configuration> using Sitecore.Configuration; using Sitecore.Pipelines.PreprocessRequest; using System.Web; namespace Feature.Pipelines { public class LoadBalancingSchemeFix : PreprocessRequestProcessor { public override void Process(PreprocessRequestArgs args) { var scheme = HttpContext.Current?.Request?.Headers?[Settings.LoadBalancingScheme]; if (Settings.LoadBalancingEnabled &amp;&amp; (scheme?.Contains(&quot;,&quot;) ?? false)) { HttpContext.Current.Request.Headers[Settings.LoadBalancingScheme] = scheme.Split(',')[0]; } } } } Although this fix works, a Sitecore Support tickets needs to be raised. Once you get the Sitecore patch ID please post it
Next.js Headless images not working from rendering / fe instance (System.UriBuilder.set_Scheme) I'm facing issues with images on our Next.js headless application. My problem is that I always get an image error about a pipeline processor. But only when I go relative over the rendering instance URL. The error itself is obviously a .Net one. But when I call the relative URL directly on CM or CD it works fine! So I guess the rewriting/forwarding is corrupted somehow?! What misconfiguration could that be? [ArgumentException: value] System.UriBuilder.set_Scheme(String value) +206 System.UriBuilder..ctor(String schemeName, String hostName) +223 Sitecore.Web.WebUtil.GetRequestUri(HttpContextBase context) +160 Sitecore.Pipelines.HttpRequest.OverrideDialogs.Process(PreprocessRequestArgs args) +41 (Object , Object ) +14 Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +1268 Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain, Boolean failIfNotExists) +236 Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain) +22 Sitecore.Web.RequestEventsHandler.OnBeginRequest(HttpContextBase context) +166 Sitecore.Nexus.Web.HttpModule.HttpApplication_BeginRequest(Object sender, EventArgs e) +121 System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +223 System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +220 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) +94
Make sure you have https:// in your instance. Add https:// in your instance name in user.json (\.sitecore\user.json) and then try again. &quot;host&quot;: &quot;https://sc10sc.dev.local&quot;, &quot;authority&quot;: &quot;https://sc10identityserver.dev.local&quot;
Sitecore 10.2 CLI error the SSL connection could not be established While I have setup the CLI in helix project root folder and trying to run below command I'm getting error dotnet sitecore ser pull The SSL connection could not be established, see inner exception. Any suggestion will be helpful.
Try unchecking &quot;Track effect of personalization of this component&quot;. I have experienced in past that this would interfere with applying personalization rule. Read more about this feature here two-great-new-features-marketers-sitecore-xp-93-petr-anderle
Experience Explorer not showing personalization Having an intermittent issue with Experience Explorer not showing personalizations on a standalone Sitecore 10.2 local dev instance. It's mostly not working, but has worked twice in the last two days without me knowingly making any changes. When I try to use the Exp Explorer to demonstrate personalization for countries, it's not working. I recorded a video, so you can see what happens: https://youtu.be/TKTU64FMYgE I'll also explain: I have two components setup with personalization rules that change the content based on the country. If the country is Canada, it will display a different data source than default, and yet another for Europe. When I open Exp Explorer and select the country, as soon as I hit the Apply button, the &quot;Viewer&quot; menu from the right side disappears from the right side and appears minimized on the left over the &quot;Settings&quot; menu (regardless of it's previous state) then it slides across the screen (expanding as it does until it reaches the right side of the screen and then it returns to it's previous state. While that happens, the left side &quot;Settings&quot; menu options all collapse and then the &quot;Visitor Information&quot; menu option opens back up. All of that happens in less than 1 second. In the log file the following entry can then be found: 7372 21:32:22 ERROR Cannot finish Analytics page tracking Exception: System.ArgumentNullException Message: Value cannot be null. Parameter name: CurrentPage Source: Sitecore.Analytics at Sitecore.Analytics.Pipelines.EndAnalytics.SetRobotSessionTimeOut.Process(PipelineArgs args) at (Object , Object ) at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) at Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain, Boolean failIfNotExists) at Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, Boolean failIfNotExists) at Sitecore.Analytics.Pipelines.EndAnalytics.EndAnalyticsPipeline.Run() at Sitecore.Analytics.Pipelines.HttpRequest.EndAnalytics.Process(HttpRequestArgs args)
Sitecore provides you the option to clone an item with or without its subitems. So for this, you have to select the item and go to the Configure ribbon menu. And you will find the option like this. Once you click, a popup will appear where you can provide the location to clone.
How to copy, clone or duplicate without subitems I would like to make a copy of just the Home item, to some other location under home. But Copy, Clone or Duplicate does this including its child items.
SXA redirects should not be used normally for any links generation. Their purpose is completely different. When you create a this-url-should-be-redirected redirect item and configure its Redirection URL to some-another-link, when someone tries to open https://yourwebsite/this-url-should-be-redirected, browser will redirect them to https://yourwebsite/some-another-link. You can read more here: https://doc.sitecore.com/xp/en/users/sxa/17/sitecore-experience-accelerator/redirect-a-url.html
Sitecore SXA redirect code functionality I would like to add class name in redirect url anchor tag. Is it possible ?? Could someone let me know how redirect url create a anchor tag and where is the code of it?
The issue can be fixed by setting the --client-credentials argument to false in the interactive login command: dotnet sitecore login --authority https://<Sitecore identity server> --cm http://<Sitecore instance> --allow-write true --client-credentials false When using the non-interactive login this is set to true. And apparently if you do a new login that argument is not reset to the default (false) so you need to apply it. A simple fix for something that might be trivial for some but maybe I can save someone time by sharing here.
Error while getting client credentials token: invalid_client on interactive login with Sitecore CLI I am using the Sitecore CLI to login (interactive) to my local instance and that works fine. We have a setup for a non-interactive login for the CLI to the cloud dev environment. I wanted to test that locally and it succeeds. I can login and perform tasks. When I now want to login to my local instance again however I get an error: Error while getting client credentials token: invalid_client I am using the commands from the official docs here: https://doc.sitecore.com/xp/en/developers/102/developer-tools/log-in-to-a-sitecore-instance-with-sitecore-command-line-interface.html
Finally fixed the issue with the help of sitecore support. Actually we had upgraded our sitecore licence and for the new licence we had not activated the geolocation service. Hence we were not getting the geolocation data. Once we activated the service, geolocation started working as expected. For some IPs it was working fine before the fix because the geolocation data was cached for those IPs.
Sitecore Geo IP : Failed to read GeoIp data for Ip from lookup We have implemented Sitecore Geo IP in the Sitecore 10.0 version. The Geo IP is working fine in most cases but sometimes for some Users/IP, it will not work and we get the below exception. Falied to read GeoIp data for Ip:'c2e3273a-680c-165d-fa30-ab797b800a98' from lookup Exception: Polly.CircuitBreaker.BrokenCircuitException Message: The circuit is now open and is not allowing calls. Source: Polly at Polly.CircuitBreaker.CircuitStateController`1.OnActionPreExecute() at Polly.CircuitBreaker.CircuitBreakerEngine.<ImplementationAsync>d__1`1.MoveNext() Nested Exception Exception: System.InvalidOperationException Message: geoIpServiceUri Source: Sitecore.CES.GeoIp at Sitecore.CES.GeoIp.SitecoreProvider.RequestGeoIpService(String ip) at Sitecore.CES.GeoIp.SitecoreProvider.GetWhoIsInformationByIp(String ip) Also, the site is hosted on Azure Paas. Looking for your suggestions.
You can also use ID for both source and destination. So the query will be something like this. $itemID = &quot;{8A87AC2B-210D-49F2-93FC-215918085418}&quot; # Mention your Item ID to move $desinationParentID = &quot;{F0C8DEC1-75FB-4633-BA98-71CCD91F18F1}&quot; # Mention your Parent Item ID where to move Get-Item -Path &quot;master:&quot; -ID &quot;$itemID&quot; | Move-Item -Destination &quot;master:$desinationParentID&quot;
Moving item using in Powershell Is there a way to move item using ID in powershell. I know there is a way to Move item using path Move-Item -Path $_.ItemPath -Destination $destinationContainer; But in my scenario, the path is same for multiple forms, so I would need to move item via ID. Is this something possible via powershell?
I have face same problem in my project, after some investigation I found that Glass Mapper properties needs to be virtual, so try below code and let me know if it's works for you or not. public class TestViewModel { /// <summary> /// Gets or sets the id /// </summary> [SitecoreId] public virtual Guid Id { get; set; } }
Failed to find ID. Ensure that you have an ID property on your model error in Sitecore Experience editor I have upgraded my Sitecore instance instance from Sitecore 8.2 to Sitecore 9.3 I am getting below errors in experience editor mode but in normal mode component is not showing because we added error handling pipelines for view and controller rendering. Error in Text Inner Exception Failed to find ID. Ensure that you have an ID property on your model. at Glass.Mapper.Sc.GlassHtml.EditFrame[T](T model, String title, TextWriter output, Expression`1[] fields) in D:\a\Glass.Mapper\Glass.Mapper\Source\Glass.Mapper.Sc\GlassHtml.cs:line 199 at Glass.Mapper.Sc.Web.Mvc.GlassView`1.BeginEditFrame[T](T model, String title, Expression`1[] fields) in D:\a\Glass.Mapper\Glass.Mapper\Source\Glass.Mapper.Sc.Mvc\Web\Mvc\GlassView.cs:line 296 at ASP._Page_Areas_Clinical_Views_Listing_L05B_ListingProvidersWithTabs_cshtml.Execute() in c:\inetpub\wwwroot\local-cm.atriumhealth.org\Areas\Clinical\Views\Listing\L05B-ListingProvidersWithTabs.cshtml:line 20 at System.Web.WebPages.WebPageBase.ExecutePageHierarchy() at System.Web.Mvc.WebViewPage.ExecutePageHierarchy() at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) My Code is public class TestViewModel { /// <summary> /// Gets or sets the id /// </summary> [SitecoreId] public Guid Id { get; set; } }
Error states that the repository is already registered with name and source location and you need to install the specified module with mentioned version. If you already have a repository then run the below command and update it: Update-Module SitecoreInstallFramework After this run the below command to verify that the repository was installed successfully or not: Get-Module SitecoreInstallFramework –ListAvailable Output will be: Now re-run the setup again:
SIF error while installing Sitecore 10.2 using Sitecore Install Assistant's user interface I am installing Sitecore 10.2 using Sitecore Install Assistant's user interface and facing the below issue while installation. The repository could not be registered because there exists a registered repository with Name 'SitecoreGallery' and SourceLocation 'https://sitecore.myget.org/F/sc-powershell/api/v2'. To register another repository with Name 'Temp8abc6d53-84f8-4c41-94ae-a57636a9f92a', please unregister the existing repository using the Unregister-PSRepository cmdlet. Cannot validate argument on parameter 'Repository'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. The specified module 'SitecoreInstallFramework' with version '2.3.0' was not loaded because no valid module file was found in any module directory.
The solution is surprisingly trivial. First we need to map the isAdmin claim to the IsAdministrator user property. More information can be found in the official docs here. The patch configuration should contain an additional section for mapping the fields. <configuration xmlns:patch=&quot;http://www.sitecore.net/xmlconfig/&quot; xmlns:set=&quot;http://www.sitecore.net/xmlconfig/set/&quot; xmlns:role=&quot;http://www.sitecore.net/xmlconfig/role/&quot;> <sitecore role:require=&quot;Standalone or ContentManagement&quot;> <federatedAuthentication> <propertyInitializer> <maps> <map name=&quot;set IsAdministrator&quot; type=&quot;Sitecore.Owin.Authentication.Services.DefaultClaimToPropertyMapper, Sitecore.Owin.Authentication&quot;> <data hint=&quot;raw:AddData&quot;> <source name=&quot;http://www.sitecore.net/identity/claims/isAdmin&quot; value=&quot;true&quot; /> <target name=&quot;IsAdministrator&quot; value=&quot;true&quot; /> </data> </map> </maps> </propertyInitializer> </federatedAuthentication> </sitecore> </configuration> Second we need to map the custom name when creating the user. <configuration xmlns:patch=&quot;http://www.sitecore.net/xmlconfig/&quot; xmlns:set=&quot;http://www.sitecore.net/xmlconfig/set/&quot; xmlns:role=&quot;http://www.sitecore.net/xmlconfig/role/&quot;> <sitecore role:require=&quot;Standalone or ContentManagement&quot;> <federatedAuthentication> <identityProvidersPerSites> <mapEntry name=&quot;all sites&quot;> <externalUserBuilder> <patch:attribute name=&quot;type&quot; value=&quot;Company.Feature.Security.Services.CustomExternalUserBuilder, Company.Feature&quot; /> </externalUserBuilder> </mapEntry> </identityProvidersPerSites> </federatedAuthentication> </sitecore> </configuration> Third we need to implement the class which manages the creation of users. Since we defined the username explicitly in the config we'll need to look for that first. using System; using System.Linq; using Microsoft.AspNet.Identity; using Microsoft.AspNet.Identity.Owin; using Sitecore.Diagnostics; using Sitecore.Owin.Authentication.Identity; using Sitecore.Owin.Authentication.Services; using Sitecore.SecurityModel.Cryptography; namespace Company.Feature.Security.Services { public class CustomExternalUserBuilder : DefaultExternalUserBuilder { public CustomExternalUserBuilder(ApplicationUserFactory applicationUserFactory, IHashEncryption hashEncryption) : base(applicationUserFactory, hashEncryption) { Log.Info($&quot;Creating a new instance of {typeof(CustomExternalUserBuilder)}&quot;, this); } protected override string CreateUniqueUserName(UserManager<ApplicationUser> userManager, ExternalLoginInfo externalLoginInfo) { Log.Info($&quot;Preparing to create a new username&quot;, this); Assert.ArgumentNotNull(userManager, nameof(userManager)); Assert.ArgumentNotNull(externalLoginInfo, nameof(externalLoginInfo)); var identityProvider = this.FederatedAuthenticationConfiguration.GetIdentityProvider(externalLoginInfo.ExternalIdentity); if (identityProvider == null) { throw new InvalidOperationException(&quot;Unable to retrieve an identity provider for the given identity&quot;); } var nameClaim = externalLoginInfo.ExternalIdentity.Claims.FirstOrDefault(x => x.Type == &quot;name&quot;); if(nameClaim != null) { return nameClaim.Value; } return base.CreateUniqueUserName(userManager, externalLoginInfo); } } }
How to configure a friendly name for the generated user with CLI using non-interactive client login? Sitecore 10.2: I followed the documentation as described here. Configuration applied to Identity Server and stored at C:\identity\config\sitecore.identityserver.devex.xml <?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?> <Settings> <Sitecore> <IdentityServer> <Clients> <CliServerClient> <ClientId>SitecoreCLIServer</ClientId> <ClientName>SitecoreCLIServer</ClientName> <AccessTokenType>0</AccessTokenType> <AccessTokenLifetimeInSeconds>3600</AccessTokenLifetimeInSeconds> <IdentityTokenLifetimeInSeconds>3600</IdentityTokenLifetimeInSeconds> <RequireClientSecret>true</RequireClientSecret> <AllowOfflineAccess>false</AllowOfflineAccess> <AllowedGrantTypes> <AllowedGrantType1>client_credentials</AllowedGrantType1> </AllowedGrantTypes> <ClientSecrets> <!--<ClientSecret1>PlaceholderForSuperSecret</ClientSecret1>--> </ClientSecrets> <AllowedScopes> <AllowedScope1>sitecore.profile.api</AllowedScope1> </AllowedScopes> </CliServerClient> </Clients> </IdentityServer> </Sitecore> </Settings> Configuration applied to Sitecore CM role and stored under ~/App_Config/Include <configuration xmlns:patch=&quot;http://www.sitecore.net/xmlconfig/&quot; xmlns:set=&quot;http://www.sitecore.net/xmlconfig/set/&quot; xmlns:role=&quot;http://www.sitecore.net/xmlconfig/role/&quot;> <sitecore role:require=&quot;Standalone or ContentManagement&quot;> <federatedAuthentication> <identityProviders> <identityProvider id=&quot;SitecoreIdentityServer&quot;> <transformations> <transformation name=&quot;admin-ify client credentials users&quot; type=&quot;Sitecore.Owin.Authentication.Services.DefaultTransformation, Sitecore.Owin.Authentication&quot;> <sources hint=&quot;raw:AddSource&quot;> <claim name=&quot;client_id&quot; value=&quot;SitecoreCLIServer&quot; /> </sources> <targets hint=&quot;raw:AddTarget&quot;> <claim name=&quot;name&quot; value=&quot;sitecore\cliuser&quot; /> <claim name=&quot;http://www.sitecore.net/identity/claims/isAdmin&quot; value=&quot;true&quot; /> </targets> <keepSource>true</keepSource> </transformation> </transformations> </identityProvider> </identityProviders> </federatedAuthentication> </sitecore> </configuration> After logging in I see the following username: dotnet sitecore login --authority https://identityx.dev.sxp.local --cm https://scmsx.dev.sxp.local --allow-write true --client-credentials true --client-id SitecoreCLIServer --client-secret 'HIDDEN_FROM_BOBBY_TABLES' Note: I found that the client secret has a limit (probably 101). I decided to use a string 64 characters long.
Yes, this is a known issue with SPS. Depending on what version you're using, this patch may solve your problem: https://github.com/SitecoreSupport/Sitecore.Support.290996 From what I remember, this patch fixes the issue of case changes on fields. If case changes is done on an item Name, such change won't be published with the patch either.
Sitecore item publishing issue Is there any reason the Sitecore item publish did not identify the change, when changing the Camel case to the Pascal case and vice versa? For example, I have an item with a Description field set to quarantine, changed the description field to Quarantine save and published it. Sitecore didn't recognize the change.
You can get item properties using this command. $itemID = &quot;{8A87AC2B-210D-49F2-93FC-215918085418}&quot; #Mention your Item ID # Use Format-Table if you want to show results in the table view. Get-Item -Path &quot;master:&quot; -ID &quot;$itemID&quot; | Format-Table -Property ID, Name, DisplayName, &quot;Page Title&quot;, @{Label=&quot;Path&quot;; Expression={$_.Paths.FullPath} } # Use Show-ListView if you want to show result in a popup window Get-Item -Path &quot;master:&quot; -ID &quot;$itemID&quot; | Show-ListView -Property ID, Name, DisplayName, &quot;Page Title&quot;, @{Label=&quot;Path&quot;; Expression={$_.Paths.FullPath} } The window will also give you the option to export. Like this. Read this article for more operations. https://doc.sitecorepowershell.com/working-with-items
How to get path property of Sitecore item using PowerShell how can I get path property of Sitecore item using PowerShell module?
You should check $selectedOption value after you execute the script. That's were the value of what user selected is stored. Your parameters contain: {Name=&quot;selectedOption&quot;; Title=&quot;Choose an option&quot;; Options=$options; Tooltip=&quot;Choose one.&quot;} Look at the part Name=&quot;selectedOption&quot;. That means that your value will be stored in $selectedOption variable. And you should only process if $result returns ok, like that: $options = @{ &quot;A&quot;=&quot;a&quot; &quot;B&quot;=&quot;b&quot; } $props = @{ Parameters = @( @{Name=&quot;selectedOption&quot;; Title=&quot;Choose an option&quot;; Options=$options; Tooltip=&quot;Choose one.&quot;} ) Title = &quot;Option selector&quot; Description = &quot;Choose the right option.&quot; Width = 300 Height = 300 ShowHints = $true } $result = Read-Variable @props if($result -eq &quot;ok&quot;) { $selectedOption }
Get dropdown values through Powershell script I am using the below code in PoweerShell script:- $options = @{ &quot;A&quot;=&quot;a&quot; &quot;B&quot;=&quot;b&quot; } $props = @{ Parameters = @( @{Name=&quot;selectedOption&quot;; Title=&quot;Choose an option&quot;; Options=$options; Tooltip=&quot;Choose one.&quot;} ) Title = &quot;Option selector&quot; Description = &quot;Choose the right option.&quot; Width = 300 Height = 300 ShowHints = $true } Read-Variable @props I need to get selected dropdown values. However, it is showing ok or cancel result when I click on ok and cancel button in dialog box. I have tried $props.Parameters.Value as well it is showing the dropdown values but not the selected value everytime.
We had a similar issue. These Sitecore configs determine which templates are supported by GraphQL; these templates are then represented to the generated TypeScript. Configs: \App_Config\Sitecore\Services.GraphQL\sitecore.services.graphql.content.config \App_Config\Sitecore\Services.GraphQL\Sitecore.Services.GraphQL.EdgeContent.config By default Sitecore includes templates in these paths: <paths hint=&quot;list:AddIncludedPath&quot;> <foundation>/sitecore/templates/Foundation</foundation> <feature>/sitecore/templates/Feature</feature> <project>/sitecore/templates/Project</project> <userdefined>/sitecore/templates/User Defined</userdefined> </paths> For now, we're using a custom patch file. The patch clears the defaults and only includes the path to our JSS templates. Note, all inherited templates are still automatically included. <templates type=&quot;Sitecore.Services.GraphQL.Content.TemplateGeneration.Filters.StandardTemplatePredicate, Sitecore.Services.GraphQL.Content&quot;> <database>$(1)</database> <!-- Only include our JSS application --> <paths hint=&quot;list:AddIncludedPath&quot;> <foundation> <patch:delete /> </foundation> <feature> <patch:delete /> </feature> <project> <patch:delete /> </project> <userdefined> <patch:delete /> </userdefined> <jssSite>/sitecore/templates/Project/OurJssSite</jssSite> </paths> </templates> After adding the custom patch run: graphql:update jss bootstrap Your generated files will be much smaller and hopefully prevent JavaScript heap out of memory errors.
'jss bootstrap' causes JavaScript heap out of memory error on graphql-let step I have the Nextjs sample app running in connected mode to my existing Sitecore v10.2 implementation using JSS v19. It's all working correctly - I'm able to create new components and edit them in the Experience Editor. In another component I want to make a GraphQL request to get some data from Sitecore. Following the sample component GraphQL-ConnectedDemo.dynamic.tsx I have created a .graphql file with a query I've tested in Sitecore GraphQL editor <url>/sitecore/api/graph/edge/ui and the data is returned. I have run graphql:update to update the ./src/temp/GraphQLIntrospectionResult.json file so that my GraphQL query has types. This updates the file from ~22,000 lines of code to ~615,000 as it now has representations for all the Templates from my existing Sitecore implementation. Now when I run jss bootstrap to generate a .graphql.d.ts for my new query I receive the following error at the graphql-let step [ graphql-let ] Generating .d.ts... <--- Last few GCs ---> [38180:0000028409EEB070] 79499 ms: Scavenge 4048.3 (4120.0) -> 4045.5 (4137.8) MB, 8.7 / 0.0 ms (average mu [38180:0000028409EEB070] 80903 ms: Mark-sweep 4058.3 (4137.8) -> 4051.3 (4147.0) MB, 1385.9 / 0.0 ms (averagght not succeed <--- JS stacktrace ---> FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory ... The issue is due to the size of GraphQLIntrospectionResult.json - if I undo changes to that file jss bootstrap completes successfully. Therefore, is there a way to limit the scope of graphql:update such that it only generates for templates relating to my JSS App?
As per my understanding, you would like to get workflow ID based on workflow name only. For your first scenario try this approach : (Get-Item -Path &quot;master:/sitecore/system/Workflows/<your workflow name>&quot;).ID For your second scenario try the same approach and add your workflow state name like below : (Get-Item -Path &quot;master:/sitecore/system/Workflows/<your workflow name>/<your workflow state name>&quot;).ID
Get workflow id in Powershell script Can we get workflow id if we have workflow name in Powershell script? Scenario 1: I have workflow name &quot;Test workflow&quot; based on its name can I get its id in Powershell script? Scenario 2: Can we get workflow state id as well if I have workflow state name in Powershell script?
I had xConnect connectivity issues after installing a clean version of Sitecore 10.2 recently on a local dev server. In my case, I had to Disable TLS 1.3 over TCP in IIS: Hope this helps!
XConnect Error While Sending The Request I have installed a clean version of Sitecore XP0 of my local development machine and the logs are showing the following error: ManagedPoolThread #14 14:21:35 INFO Job ended: Sitecore.ListManagement.Operations.UpdateListOperationsAgent (units processed: ) 49008 14:21:44 ERROR Exception when executing agent aggregation/pathAnalyzerHistoryAgent Exception: Sitecore.XConnect.XdbCollectionUnavailableException Message: An error occurred while sending the request. Source: Sitecore.Xdb.Common.Web at Sitecore.Xdb.Common.Web.Synchronous.SynchronousExtensions.SuspendContextLock[TResult](Func`1 taskFactory) at Sitecore.XConnect.Client.XConnectSynchronousExtensions.SuspendContextLock(Func`1 taskFactory) at Sitecore.XConnect.Client.Configuration.SitecoreXConnectClientConfiguration.Initialize(XmlNode configNode) at Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) at Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert) at Sitecore.Configuration.DefaultFactory.CreateObject(String configPath, String[] parameters, Boolean assert) at Sitecore.XConnect.Client.Configuration.SitecoreXConnectClientConfiguration.GetClient(String clientConfigPath) at Sitecore.Analytics.Aggregation.XConnect.DefaultXdbContextFactory.CreateReadOnly() at Sitecore.PathAnalyzer.Processing.Agents.TreeAggregatorAgent.Execute() at Sitecore.Analytics.Core.BackgroundService.Run() Nested Exception Exception: Sitecore.Xdb.Common.Web.ConnectionTimeoutException Message: A task was canceled. Source: Sitecore.Xdb.Common.Web at Sitecore.Xdb.Common.Web.CommonWebApiClient`1.<ExecuteAsync>d__41.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Xdb.Common.Web.CommonWebApiClient`1.<ExecuteGetAsync>d__36.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.XConnect.Client.WebApi.ConfigurationWebApiClient.<Refresh>d__6.MoveNext() Nested Exception Exception: System.Threading.Tasks.TaskCanceledException Message: A task was canceled. Source: mscorlib at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Xdb.Common.Web.CommonWebApiClient`1.<ExecuteAsync>d__41.MoveNext() There are no errors in the XConnect logs or Event logs, so I am at a loss on how to diagnose the problem. Any suggestions?
So the document you are following is stating that you don't need to copy or publish your Web.Config to your Sitecore instance. See this as given in the document. https://doc.sitecore.com/xp/en/developers/93/sitecore-experience-manager/set-up-sitecore-and-visual-studio-for-development.html This is given in the section under the Set up a Visual Studio Project and point 4. The Web.config file in the Visual Studio project is quite minimal, while the Web.config file in the Sitecore instance contains important settings. This step is to avoid that the file from Visual Studio overwrites the one in Sitecore when you publish. In Visual Studio, in the Solution Explorer, right-click the Web.config file in the root of the project, and select Properties. Set the Build Action property to None and the Copy to Output Directory property to Do not copy So revert your Web.Config changes in the Sitecore and then try again. Hope this helps.
Server Error in '/' application. Parameter name: sessionStateBehaviorResolver - Sitecore 9.3 I am having issues with the connection of Sitecore after I tried to connect VS Studio 2019. The Solr is running and my server seems fine. Sitecore was running just fine until I tried to build a connection into Sitecore using VS Studio. I copied the web.config and global.asax, Sitecore files into my vs code solution and built them onto the root web folder and that's when everything crashed. Value cannot be null. Parameter name: sessionStateBehaviorResolver [ArgumentNullException: Value cannot be null. Parameter name: sessionStateBehaviorResolver] Sitecore.Diagnostics.Assert.ArgumentNotNull(Object argument, String argumentName) +64 Sitecore.Owin.Extensions.AppBuilderExtensions.SetSessionStateBehaviorResolver(IAppBuilder app, SessionStateBehaviorResolver sessionStateBehaviorResolver) +54 Sitecore.Owin.Startup.Configuration(IAppBuilder app) +28 [TargetInvocationException: Exception has been thrown by the target of an invocation.] System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0 System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +132 System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +146 Owin.Loader.<>c__DisplayClass12.<MakeDelegate>b__b(IAppBuilder builder) +93 Owin.Loader.<>c__DisplayClass1.<LoadImplementation>b__0(IAppBuilder builder) +224 Microsoft.Owin.Host.SystemWeb.OwinAppContext.Initialize(Action`1 startup) +900 Microsoft.Owin.Host.SystemWeb.OwinBuilder.Build(Action`1 startup) +51 Microsoft.Owin.Host.SystemWeb.OwinHttpModule.InitializeBlueprint() +101 System.Threading.LazyInitializer.EnsureInitializedCore(T&amp; target, Boolean&amp; initialized, Object&amp; syncLock, Func`1 valueFactory) +139 Microsoft.Owin.Host.SystemWeb.OwinHttpModule.Init(HttpApplication context) +160 System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +587 System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +173 System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +255 System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +347 [HttpException (0x80004005): Exception has been thrown by the target of an invocation.] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +552 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +122 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +737```
Changing the Workflow State field does not trigger any workflow actions. You need to use the WorkflowProvider to get the workflow and move it to the desired state. With SPE you can do this via the Invoke-Workflow command: Invoke-Workflow -Path master:/path-to-your/item ` -CommandName &quot;The Name of the Command&quot; -Comments &quot;Automated&quot; This will change the state of the item and execute any workflow actions that are setup in your workflow. Here is the documentation for Invoke-Workflow
Not publish item after moving its workflow state through PowerShell script I am moving workflow state through Powershell script to approved state. However, it is not publishing that item in the web database. Code:- $item.Editing.BeginEdit() $item.__Workflow=$workflowId $item.&quot;__Workflow state&quot;=$workflowStateId $item.&quot;__Default Workflow&quot;=$workflowId $item.Editing.EndEdit($false,$false)
I was missing one line of code, that is to use the serviceProvider. I modified the above code as shown below and the test runs successfully now. [Theory, AutoDbData] public void GetModel_ReturnsModel(IServiceProvider serviceProvider, IPageContext pageContext, IRendering rendering, IContentRepository contentRepository, IControlEditability controlEditability, IControlEditabilityService controlEditabilityService, IMultisiteContext multisiteContext) { // Arrange PageMode pageMode = Substitute.For<PageMode>(); serviceProvider.GetService(typeof(IPageMode)).Returns(pageMode); IRenderingModelBase result = null; // Act using (new ServiceProviderSwitcher(serviceProvider)) //Added this line of code { SnackbarNotificationRepository sut = new SnackbarNotificationRepository(); sut.SetFieldValue(&quot;_rendering&quot;, rendering); sut.SetFieldValue(&quot;_pageContext&quot;, pageContext); sut.SetFieldValue(&quot;_contentRepository&quot;, contentRepository); sut.SetFieldValue(&quot;_controlEditability&quot;, controlEditability); sut.SetFieldValue(&quot;_controlEditabilityService&quot;, controlEditabilityService); sut.SetFieldValue(&quot;_multisiteContext&quot;, multisiteContext); result = sut.GetModel(); } // Assert result.Should().BeOfType<SnackbarNotificationModel>(); }
Unit Test in Sitecore 9.3 SXA I am working on upgrading a project from Sitecore 8.2 to 9.3. Few tests are failing and throwing NullReferenceException at Sitecore.XA.Foundation.Mvc.Repositories.Base.FillBaseProperties(model). While debugging, I saw that IsEdit and IsEditable properties are throwing exception. Can anybody please let me know the Unit Test code to assign values to these two parameters? Please see current test code below - public void GetModel_ReturnsModel(IServiceProvider serviceProvider, IPageContext pageContext, IRendering rendering, IContentRepository contentRepository, IControlEditability controlEditability, IControlEditabilityService controlEditabilityService, IMultisiteContext multisiteContext, IPageMode pageMode) { // Arrange serviceProvider.GetService(typeof(IPageMode)).Returns(pageMode); SnackbarNotificationRepository sut = new SnackbarNotificationRepository(); sut.SetFieldValue(&quot;_rendering&quot;, rendering); sut.SetFieldValue(&quot;_pageContext&quot;, pageContext); sut.SetFieldValue(&quot;_contentRepository&quot;, contentRepository); sut.SetFieldValue(&quot;_controlEditability&quot;, controlEditability); sut.SetFieldValue(&quot;_controlEditabilityService&quot;, controlEditabilityService); sut.SetFieldValue(&quot;_multisiteContext&quot;, multisiteContext); FakeSiteContext fakeSite = new FakeSiteContext( new StringDictionary { { &quot;name&quot;, &quot;TestSite&quot; }, { &quot;rootPath&quot;, &quot;/sitecore/content/test&quot; }, { &quot;startItem&quot;, &quot;/Home&quot; } }); IRenderingModelBase result = null; // Act using (new SiteContextSwitcher(fakeSite)) { result = sut.GetModel(); } // Assert result.Should().BeOfType<SnackbarNotificationModel>(); }
One of the comments questioned the casing of the topology. In trying to figure this out, I decided to burn down the docker implementation and start over from scratch. Instead of using -Topology &quot;XP0&quot;, I used -Topology &quot;xp0&quot;in the compose-init command when installing Sitecore. This ended up fixing the issue with the Sitecore CLI login.
Sitecore CLI 4.1.0-r00492 Login erroring "Endpoint belongs to different authority:" I have installed a brand new, vanilla version of Sitecore 10.2, using Docker Desktop containers. My Identity URL (which works) is https://xp0id.localhost. My CM Url (which works) is https://xp0cm.localhost. I can log into Sitecore with no problem. I have installed the Sitecore CLI following the instructions here. I am trying to log into Sitecore and getting the following error message: &quot;Endpoint belongs to a different authority: https://XP0id.localhost/.well-known/openid-configuration/jwks&quot; The openid-configuration appears correct: {&quot;issuer&quot;:&quot;https://xp0id.localhost&quot;,&quot;jwks_uri&quot;:&quot;https://XP0id.localhost/.well-known/openid-configuration/jwks&quot;,&quot;authorization_endpoint&quot;:&quot;https://XP0id.localhost/connect/authorize&quot;,&quot;token_endpoint&quot;:&quot;https://XP0id.localhost/connect/token&quot;,&quot;userinfo_endpoint&quot;:&quot;https://XP0id.localhost/connect/userinfo&quot;,&quot;end_session_endpoint&quot;:&quot;https://XP0id.localhost/connect/endsession&quot;,&quot;check_session_iframe&quot;:&quot;https://XP0id.localhost/connect/checksession&quot;,&quot;revocation_endpoint&quot;:&quot;https://XP0id.localhost/connect/revocation&quot;,&quot;introspection_endpoint&quot;:&quot;https://XP0id.localhost/connect/introspect&quot;,&quot;device_authorization_endpoint&quot;:&quot;https://XP0id.localhost/connect/deviceauthorization&quot;,&quot;frontchannel_logout_supported&quot;:true,&quot;frontchannel_logout_session_supported&quot;:true,&quot;backchannel_logout_supported&quot;:true,&quot;backchannel_logout_session_supported&quot;:true,&quot;scopes_supported&quot;:[&quot;openid&quot;,&quot;profile&quot;,&quot;email&quot;,&quot;sitecore.profile&quot;,&quot;sitecore.profile.api&quot;,&quot;offline_access&quot;],&quot;claims_supported&quot;:[&quot;sub&quot;,&quot;name&quot;,&quot;family_name&quot;,&quot;given_name&quot;,&quot;middle_name&quot;,&quot;nickname&quot;,&quot;preferred_username&quot;,&quot;profile&quot;,&quot;picture&quot;,&quot;website&quot;,&quot;gender&quot;,&quot;birthdate&quot;,&quot;zoneinfo&quot;,&quot;locale&quot;,&quot;updated_at&quot;,&quot;email&quot;,&quot;email_verified&quot;,&quot;role&quot;,&quot;http://www.sitecore.net/identity/claims/isAdmin&quot;,&quot;http://www.sitecore.net/identity/claims/originalIssuer&quot;],&quot;grant_types_supported&quot;:[&quot;authorization_code&quot;,&quot;client_credentials&quot;,&quot;refresh_token&quot;,&quot;implicit&quot;,&quot;password&quot;,&quot;urn:ietf:params:oauth:grant-type:device_code&quot;],&quot;response_types_supported&quot;:[&quot;code&quot;,&quot;token&quot;,&quot;id_token&quot;,&quot;id_token token&quot;,&quot;code id_token&quot;,&quot;code token&quot;,&quot;code id_token token&quot;],&quot;response_modes_supported&quot;:[&quot;form_post&quot;,&quot;query&quot;,&quot;fragment&quot;],&quot;token_endpoint_auth_methods_supported&quot;:[&quot;client_secret_basic&quot;,&quot;client_secret_post&quot;,&quot;private_key_jwt&quot;],&quot;id_token_signing_alg_values_supported&quot;:[&quot;RS256&quot;],&quot;subject_types_supported&quot;:[&quot;public&quot;],&quot;code_challenge_methods_supported&quot;:[&quot;plain&quot;,&quot;S256&quot;],&quot;request_parameter_supported&quot;:true} I've validated the the ClientSecret is the same on both CM and ID server environment variables. How do I get past this? EDIT 1: Chet requested in the comments that I add the variables for the IdentityServer host config. These are run as docker containers, and those variables are set via environment variables. CM Environment Variables (not all, just the related ones): Sitecore_ConnectionStrings_SitecoreIdentity.Secret=vO1NgeC4l3DbbTm1pzh3DqelL8VHofYf6E6nu4AcqdJaEOmkgvPh5tKpy4Q0vXng Sitecore_ConnectionStrings_Solr.Search=http://solr:8983/solr;solrCloud=true Sitecore_ConnectionStrings_Web=Data Source=mssql;Initial Catalog=Sitecore.Web;User ID=sa;Password=Password12345 Sitecore_ConnectionStrings_XConnect.Collection=http://xconnect Sitecore_ConnectionStrings_Xdb.MarketingAutomation.Operations.Client=http://xconnect Sitecore_ConnectionStrings_Xdb.MarketingAutomation.Reporting.Client=http://xconnect Sitecore_ConnectionStrings_Xdb.Processing.Pools=Data Source=mssql;Initial Catalog=Sitecore.Processing.pools;User ID=sa;P assword=Password12345 Sitecore_ConnectionStrings_Xdb.Processing.Tasks=Data Source=mssql;Initial Catalog=Sitecore.Processing.tasks;User ID=sa;P assword=Password12345 Sitecore_ConnectionStrings_Xdb.Referencedata=Data Source=mssql;Initial Catalog=Sitecore.Referencedata;User ID=sa;Passwor d=Password12345 Sitecore_ConnectionStrings_Xdb.ReferenceData.Client=http://xconnect Sitecore_Identity_Server_Authority=https://XP0id.localhost Sitecore_Identity_Server_CallbackAuthority=https://XP0cm.localhost Sitecore_Identity_Server_InternalAuthority=http://id Sitecore_Identity_Server_Require_Https=false Identity Server Environment Vars: Sitecore_Sitecore__IdentityServer__CertificateRawDataPassword=7dkHdsNp40mZ Sitecore_Sitecore__IdentityServer__Clients__DefaultClient__AllowedCorsOrigins__AllowedCorsOriginsGroup1=https://XP0cm.localhost Sitecore_Sitecore__IdentityServer__Clients__PasswordClient__ClientSecrets__ClientSecret1=vO1NgeC4l3DbbTm1pzh3DqelL8VHofY f6E6nu4AcqdJaEOmkgvPh5tKpy4Q0vXng Sitecore_Sitecore__IdentityServer__PublicOrigin=https://XP0id.localhost Sitecore_Sitecore__IdentityServer__SitecoreMemberShipOptions__ConnectionString=Data Source=mssql;Initial Catalog=Sitecor e.Core;User ID=sa;Password=Password12345 EDIT 2: Also adding content of file requested: EDIT 3: Here is the same file from the production folder: EDIT 4: Sitecore 10.2 Install Guide where Topology was suggested to be all caps. I used &quot;XP0&quot; for my compose-init. EDIT 5: Trying different case:
The generation of the username when using identity server is controlled by the DefaultExternalUserBuilder class. There are some details about this in the documentaiton, but you can override this to generate more meaningful usernames. Create a class that inherits from DefaultExternalUserBuilder and override the CreateUniqueUserName() method: using Microsoft.AspNet.Identity; using Microsoft.AspNet.Identity.Owin; using Sitecore.Owin.Authentication.Identity; using Sitecore.Owin.Authentication.Services; using Sitecore.SecurityModel.Cryptography; namespace MyProject.IdentityProvider { public class ExternalUserBuilder : DefaultExternalUserBuilder { public ExternalUserBuilder(ApplicationUserFactory applicationUserFactory, IHashEncryption hashEncryption) : base(applicationUserFactory, hashEncryption) { } protected override string CreateUniqueUserName(UserManager<ApplicationUser> userManager, ExternalLoginInfo externalLoginInfo) { string hashDerivedName = base.CreateUniqueUserName(userManager, externalLoginInfo); string domain = hashDerivedName.Substring(0, hashDerivedName.IndexOf('\\')); string providerKeyName = domain + @&quot;\&quot; + externalLoginInfo.Login.ProviderKey; // Check name not already assigned. return userManager.FindByName(providerKeyName) == null ? providerKeyName : hashDerivedName; } } } Modify the line that sets the providerKeyName with the correct values based on the values your ptovider returns. You can then patch this on your CM server with the following config: <?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?> <configuration xmlns:patch=&quot;http://www.sitecore.net/xmlconfig/&quot; xmlns:set=&quot;http://www.sitecore.net/xmlconfig/set&quot;> <sitecore> <federatedAuthentication> <identityProvidersPerSites> <mapEntry name=&quot;all sites&quot;> <externalUserBuilder set:type=&quot;MyProject.IdentityProvider.ExternalUserBuilder, MyProject.IdentityProvider&quot; resolve=&quot;true&quot;> <IsPersistentUser>true</IsPersistentUser> </externalUserBuilder> </mapEntry> </identityProvidersPerSites> </federatedAuthentication> </sitecore> </configuration>
How can I modify Sitecore Admin to display full name instead of username in the review tab workflow? Sitecore 10 In the Content Tree when I click on an item being edited by another user, in the review tab, I see in the workflow section, &quot;lkjsadf4f&quot; has locked this item. This is because we are using Okta for Login and the Security Server in Sitecore is assigning a system generated username. So our client can't tell who actually has an item checked out for edit. How can I modify Sitecore to display Full User Name in place of the username which was system generated?
Kindly follow this link :- https://sitecorejunkie.com/2014/05/27/launch-powershell-scripts-in-the-item-context-menu-using-sitecore-powershell-extensions/ If it is still not showing in Context menu then Kindly check your parent folder template. If it is created by the below template `/sitecore/templates/Modules/PowerShell Console/PowerShell Script Module` then try to select checkbox in Module Activation tab. I am using Sitecore SXA.
Add script in Item context menu I would like to add PowerShell script on the home item context menu. I have added in Script library by creating a Content Editor followed by a Context menu folder. However, it is not showing the script in the home item context item. I have added the show rule and enable rule.
Please try to inject &quot;.Inject<ISupplierSyncCommand>()&quot; in &quot;headstart-development\src\Middleware\src\Headstart.API\Startup.cs&quot; file. It might fix this error.
Ordercloud headstart seeding data error I am setting up OrderCloud headstart environment on my local machine following this documentation: https://github.com/ordercloud-api/headstart While Seeding OrderCloud Data using /seed endpoint in postman, I am getting the below error: { &quot;Errors&quot;: [ { &quot;ErrorCode&quot;: &quot;InternalServerError&quot;, &quot;Message&quot;: &quot;Unknown error has occured.&quot;, &quot;Data&quot;: &quot;Unable to resolve service for type 'Headstart.API.Commands.SupplierSync.ISupplierSyncCommand' while attempting to activate 'Headstart.API.Commands.HsSupplierCommand'.&quot; } ] } I have provided all required parameters during post call. I have referred to this template body. https://github.com/ordercloud-api/headstart/blob/development/src/Middleware/src/Headstart.Common/Assets/SeedTemplate.json Any help is much appreciated.
With the help of my team, I found a workaround. Here is the solution we found http://mohammadhoque.com/?p=450 There are probably way to improve this, but this got us moving again.
Issue running Non-SXA site on an SXA installed Sitecore instance We are trying to pretty much lift and shift an old on prem Sitecore 7.2 site to Sitecore 9.3 in Azure. The environment is provided to us by a different team. When they installed the 9.3 instance, they added SXA. Old site is non SXA and we lifted and shifted to a local environment where the SXA is not installed. And it works. But when we go to Azure we have issue with components data source is not honored. For Example, we have a component named navigation, and it has a placeholder name associated with it and it's datasource. When this component on a page, a non-SXA Sitecore works and brings data but if it is on the SXA enabled sitecore instance, it doesn't work. If I go to the page and goto PLD and select the component and define placeholder and datasource there, it will work. Also if I take out the SXA and JSS SXA folders from app_config/module folders, it works and the datasource in the component level is honored. My question is> how can I have the component datasource be honored. Also, asking for a non-sxa installation takes over 4 weeks, a time that doesn't &quot;Disco&quot; with us :slightly_smiling_face: (edited)
You can try this recaptcha code, where you need to follow below steps: Create patch config for reCaptcha Sitekey and SecretKey Create new viewmodel class RecaptchaViewModel.cs Create new CustomRecaptcha.cshtml file Move to this location “Website/Views/FormBuilder/FieldTemplates” and open “Button.cshtm” and add “recaptcha” class in the class attribute. Add new template with name “CustomRecaptcha” Create new Field type here “/sitecore/system/Settings/Forms/Field Types/Security” with name “CustomRecaptcha” Custom reCaptcha Validation More details is available here https://www.swatiguptablogs.com/2019/10/sitecore-9-forms-google-recaptcha-field.html
Why is value always null when using Sitecore Forms with a custom validator? I'm using a custom validator for ReCaptcha on Sitecore forms. I've followed all of the instructions in the Sitecore docs for creating the validator, field type, etc. Does anyone know why this override in the validator class is always null for value? Wondering if it is something simple that I missed? public override ValidationResult Validate(object value) Thanks!
If you are looking for Sitecore PowerShell script then you try this :- $contentItem = Get-Item &quot;master:path..&quot; (Get-Item master: -ID $contentItem.&quot;__Workflow state&quot;).Name
Get item workflow state name We would like to get workflow state name of the item. I tried to find on internet but did not get any relevant result. Could someone help me out ?
The name is jss-footer/jss-top-links which means you're using dynamic placeholders. This is what the docs say about them: https://doc.sitecore.com/xp/en/developers/hd/190/sitecore-headless-development/sitecore-dynamic-placeholders-and-jss.html Dynamic placeholders were introduced with Sitecore 9.0. JSS takes advantage of this feature to drive layout and content dynamically in JSS applications. A central part of Sitecore architecture is a data-driven page layout based on addressing the location of components using placeholder keys. Components define their available placeholders in their code/markup and are placed according to their defined placeholder on the page. Placeholder addresses are usually fully qualified paths, meaning they contain the entire hierarchy of placeholders, delimited with a forward slash ('/'), much like a URL path The shortcomings of this system become apparent when you attempt to place the same component more than once at the same placeholder address. In the following example layout, it is unclear which Tabs component the Tab should be placed in when given the placeholder path /phContent/phTab. Out of the box, Sitecore puts a Tab component in the first Tabs container. To solve this problem, placeholder keys must be dynamic. Some possible approaches are: Attach an index to the placeholder key based on the position of the component. For example, /phContent/phTab_1. Utilize the unique identifier (UID) given by Sitecore to a component when it is placed on a page. For example, /phContent/phTab_8DFE46A3-5D17-43E1-835D-129D18BD59AC. Some combination of the previous approaches. The UID approach is the most resilient for scenarios such as moving components in advanced Sitecore Editors such as Experience Editor and Horizon. So you should try one of the above approaches to fix the problem. Also try this: <placeholder name=&quot;jss-top-links&quot; :rendering=&quot;rendering&quot; /> If your placeholder is inside another placeholder you only need the last segment.
Placeholder within Component not showing in JSS I am new to Sitecore JSS development. I am really struggling with how placeholders are working in JSS. I am using VUE.JS for my development. I have three root level placeholders in the layout.vue. I can see the root level placeholders are working but the placeholder inside my component is not showing the data: Below is my VUE code for footer component: <div class=&quot;row&quot;> <div class=&quot;component link-list col-8 col-sm-9 col-lg-10 footer-links--major&quot;> <div class=&quot;component-content&quot;> <placeholder name=&quot;jss-footer/jss-top-links&quot; :rendering=&quot;rendering&quot; /> //this is not showing </div> </div> The LinkList component code (Not displayed): <template> <ul> <li class=&quot;item0 odd first&quot;> <div class=&quot;field-link&quot;> <!-- <div> <pre>{{JSON.stringify(rendering) }}</pre> </div> --> <a href=&quot;/about-us&quot; target=&quot;&quot;><span>About us</span></a> </div> </li> <li class=&quot;item1 even&quot;> <div class=&quot;field-link&quot;> <a href=&quot;/about-us/careers&quot; target=&quot;&quot;><span>Careers</span></a> </div> </li> <li class=&quot;item2 odd&quot;> <div class=&quot;field-link&quot;> <a href=&quot;/about-us/news-and-media&quot; target=&quot;&quot;><span>News and media</span></a> </div> </li> <li class=&quot;item3 even&quot;> <div class=&quot;field-link&quot;> <a href=&quot;/help-contact&quot; target=&quot;&quot;><span>Help &amp;amp; Contact</span></a> </div> </li> <li class=&quot;item4 odd last&quot;> <div class=&quot;field-link&quot;> <a href=&quot;https://www.abc.com.au/login&quot; target=&quot;&quot;><span>My RACQ Account</span></a> </div> </li> <pre> {{JSON.stringify(fields)}} </pre> </ul> </template> <script> //import { Link } from '@sitecore-jss/sitecore-jss-vue'; export default { name: 'LinkList', components: { }, props: { rendering: { type: Object, default: () => ({}), }, fields: { type: Array, default: () => ([]), }, }, }; </script> My layout.vue <template> <div> <visitor-identification /> <placeholder name=&quot;jss-header&quot; :rendering=&quot;route&quot; /> <div class=&quot;container&quot;> <placeholder name=&quot;jss-main&quot; :rendering=&quot;route&quot; /> <placeholder name=&quot;jss-footer&quot; :rendering=&quot;route&quot; /> </div> </div> </template> <script> import { Placeholder } from '@sitecore-jss/sitecore-jss-vue'; import VisitorIdentification from './VisitorIdentification'; import 'bootstrap/dist/css/bootstrap.css'; import './assets/app.css'; export default { name: 'Layout', props: { route: { type: Object, default: () => ({}), }, rendering: { type: Object, default: () => ({}), } }, metaInfo() { return { title: (this.route.fields &amp;&amp; this.route.fields.pageTitle &amp;&amp; this.route.fields.pageTitle.value) || 'Page', }; }, components: { Placeholder, VisitorIdentification, }, }; </script> I am using page designs and partial designs to add footer to the SXA. The footer is added but top links are not below is my sitecore setup: Presentation details for partial design Links not shown:
I was able to accomplish this through code changes deployed to the Sitecore CM instance. Begin by adding a new class for role transformation. Regardless of the existing roles included with the claim, only the Sitecore\Sitecore Client Users is needed for granting users enough access to see the Launchpad. using System.Security.Claims; using Sitecore.Owin.Authentication.Services; namespace Company.Feature.Security.Transformations { public class AddDefaultRoles : Transformation { public override void Transform(ClaimsIdentity identity, TransformationContext context) { foreach (var claim in identity.FindAll(&quot;role&quot;)) { identity.RemoveClaim(claim); } identity.AddClaim(new Claim(ClaimTypes.Role, $&quot;Sitecore\\Sitecore Client Users&quot;)); } } } Next you'll need a configuration to patch this into Sitecore. <configuration xmlns:patch=&quot;http://www.sitecore.net/xmlconfig/&quot; xmlns:set=&quot;http://www.sitecore.net/xmlconfig/set/&quot; xmlns:role=&quot;http://www.sitecore.net/xmlconfig/role/&quot;> <sitecore role:require=&quot;Standalone or ContentManagement&quot;> <federatedAuthentication> <identityProviders> <identityProvider id=&quot;SitecoreIdentityServer&quot;> <transformations> <transformation name=&quot;grant minimal roles&quot; type=&quot;Company.Feature.Security.Transformations.AddDefaultRoles, Company.Feature&quot; resolve=&quot;true&quot; patch:after=&quot;transformation[@name='name to long name']&quot; /> </transformations> </identityProvider> </identityProviders> </federatedAuthentication> </sitecore> </configuration> Once the user logs in with the &quot;Login with Azure&quot; or &quot;Login with ADFS&quot; button you've added to Identity Server, they'll be presented with this after login. Note: Only roles added through the Role Manager will be visible or accessible through the Sitecore API.
How to configure default roles when using Identity Server integrated with ADFS or Azure? We are looking for a process in which some very basic role is granted to users that allow them to purely login to Sitecore, followed by a more traditional process of manually granting access to the user from within the Sitecore Role Manager. Can this be handled through configuration or custom code? From within Sitecore or Identity Server?
Since you mentioned this happens on larger publish tasks and given the error message this sounds like a timeout issue. I've found this to be a common issue with SPS when working with large data sets. Try increasing the timeouts configured in /config/sitecore/publishing/sc.publishing.xml. Also ensure <TransactionalPromote> is turned off. Otherwise large publish sets may cause all sorts of strange issues, such as running out of temp storage, locking issues etc. It's also worth looking into the database indexes, the Links database indexes in particular. If they are very fragmented, publish operations may take longer time. Though probably not related to this specific issue, it may be worth looking into the SPS cleanup tasks as well (sc.publishing.tasks.xml). Run those more often (Interval setting) than default and keep a jobs for a shorter time period (JobAge parameter). I've found this to be needed in most setups, as the SPS support tables grow really large, making operations heavier and may cause timeouts. Open the SPS publishing dashboard and click &quot;Recent jobs&quot;. If that page takes a long time to load, it's a good indication of this issue.
Item Promote from "Master" to "Internet" failed. - Error: "Execution Timeout Expired We are using Sitecore 9.1 (Initial release) and Publishing Service (4.0). Suddenly publishing service started throwing errors: 2022-05-04 01:00:31.327 +00:00 [Error] Item Promote from &quot;Master&quot; to &quot;Internet&quot; failed. - Error: &quot;Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding.&quot; 2022-05-04 01:00:31.342 +00:00 [Error] An error occured running an operation on Manifest 8933c141-119c-4d37-ab25-45beb1c1488a, sourceStore &quot;Internet&quot;. - Error: &quot;Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding.&quot; 2022-05-04 01:00:31.342 +00:00 [Error] One or more targets were not succesfully promoted. System.AggregateException: One or more targets were not succesfully promoted. The failed target(s) are: Manifest=8933c141-119c-4d37-ab25-45beb1c1488a Target=8e080626-ddc3-4ef4-a1d1-f0be4a200254. See inner exceptions for details. ---> System.AggregateException: One or more errors occurred. ---> System.Data.SqlClient.SqlException: Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception: The wait operation timed out --- End of inner exception stack trace --- at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action 1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean&amp; dataReady) at System.Data.SqlClient.SqlDataReader.TryReadInternal(Boolean setTimeout, Boolean&amp; more) at System.Data.SqlClient.SqlDataReader.ReadAsync(CancellationToken cancellationToken) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Dapper.SqlMapper.GridReader.<ReadBufferedAsync>d__21`1.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Dapper.SqlMapper.GridReader.<ReadBufferedAsync>d__21`1.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Framework.Publishing.Data.Classic.SqlServer.ClassicSqlServerDataProvider.<GetChangeReport>d__30.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Framework.Publishing.Data.Classic.SqlServer.ClassicSqlServerDataProvider.<>c__DisplayClass4_0.<<AddOrUpdateVariants>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Framework.TransientFaultHandling.Sql.SqlRetryHelper.<>c__DisplayClass8_0`1.<<ExecuteAsync>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Framework.TransientFaultHandling.Sql.SqlRetryHelper.<ExecuteAsync>d__8`1.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Framework.Publishing.Data.AdoNet.DatabaseConnection`1.<ExecuteAsync>d__27`1.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Framework.Publishing.Data.Classic.SqlServer.ClassicSqlServerDataProvider.<AddOrUpdateVariants>d__4.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Framework.Publishing.Data.Classic.ClassicItemRepository.<SaveVariants>d__10.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Framework.Publishing.DataPromotion.ItemManifestPromoteWorker.<SaveVariants>d__8.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Framework.Publishing.DataPromotion.DefaultItemManifestPromoter.<>c__DisplayClass3_1.<<Promote>b__4>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Sitecore.Framework.Publishing.DataPromotion.ManifestPromoterBase.<ProcessManifestInBatches>d__4`2.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Framework.Publishing.DataPromotion.DefaultItemManifestPromoter.<>c__DisplayClass3_0.<<Promote>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Framework.Publishing.DataPromotion.ManifestPromoterBase.<Promote>d__2.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Framework.Publishing.DataPromotion.DefaultItemManifestPromoter.<Promote>d__3.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Framework.Publishing.DataPromotion.DefaultPromotionCoordinator.<>c__DisplayClass10_0.<<RunAndLogPromote>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Framework.Publishing.DataPromotion.DefaultPromotionCoordinator.<RunAndLogPromote>d__10.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Framework.Publishing.DataPromotion.DefaultPromotionCoordinator.<>c__DisplayClass9_3.<<PromoteAll>b__1>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Framework.Publishing.DataPromotion.NonTransactionalOperationStrategy.<>c__DisplayClass5_0.<<RunOperation>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Sitecore.Framework.Publishing.DataPromotion.NonTransactionalOperationStrategy.<>c__DisplayClass5_0.<<RunOperation>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Framework.Publishing.DataPromotion.NonTransactionalOperationStrategy.<RunAllOperationsInParallel>d__4.MoveNext() --- End of inner exception stack trace --- --- End of inner exception stack trace --- ---> (Inner Exception #0) System.AggregateException: One or more errors occurred. ---> System.Data.SqlClient.SqlException: Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception: The wait operation timed out --- End of inner exception stack trace --- at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean&amp; dataReady) at System.Data.SqlClient.SqlDataReader.TryReadInternal(Boolean setTimeout, Boolean&amp; more) at System.Data.SqlClient.SqlDataReader.ReadAsync(CancellationToken cancellationToken) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Dapper.SqlMapper.GridReader.<ReadBufferedAsync>d__21`1.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Dapper.SqlMapper.GridReader.<ReadBufferedAsync>d__21`1.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Framework.Publishing.Data.Classic.SqlServer.ClassicSqlServerDataProvider.<GetChangeReport>d__30.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Framework.Publishing.Data.Classic.SqlServer.ClassicSqlServerDataProvider.<>c__DisplayClass4_0.<<AddOrUpdateVariants>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Framework.TransientFaultHandling.Sql.SqlRetryHelper.<>c__DisplayClass8_0`1.<<ExecuteAsync>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Framework.TransientFaultHandling.Sql.SqlRetryHelper.<ExecuteAsync>d__8`1.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Framework.Publishing.Data.AdoNet.DatabaseConnection`1.<ExecuteAsync>d__27`1.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Framework.Publishing.Data.Classic.SqlServer.ClassicSqlServerDataProvider.<AddOrUpdateVariants>d__4.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Framework.Publishing.Data.Classic.ClassicItemRepository.<SaveVariants>d__10.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Framework.Publishing.DataPromotion.ItemManifestPromoteWorker.<SaveVariants>d__8.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Framework.Publishing.DataPromotion.DefaultItemManifestPromoter.<>c__DisplayClass3_1.<<Promote>b__4>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Sitecore.Framework.Publishing.DataPromotion.ManifestPromoterBase.<ProcessManifestInBatches>d__4`2.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Framework.Publishing.DataPromotion.DefaultItemManifestPromoter.<>c__DisplayClass3_0.<<Promote>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Framework.Publishing.DataPromotion.ManifestPromoterBase.<Promote>d__2.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Framework.Publishing.DataPromotion.DefaultItemManifestPromoter.<Promote>d__3.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Framework.Publishing.DataPromotion.DefaultPromotionCoordinator.<>c__DisplayClass10_0.<<RunAndLogPromote>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Framework.Publishing.DataPromotion.DefaultPromotionCoordinator.<RunAndLogPromote>d__10.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Framework.Publishing.DataPromotion.DefaultPromotionCoordinator.<>c__DisplayClass9_3.<<PromoteAll>b__1>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Framework.Publishing.DataPromotion.NonTransactionalOperationStrategy.<>c__DisplayClass5_0.<<RunOperation>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Sitecore.Framework.Publishing.DataPromotion.NonTransactionalOperationStrategy.<>c__DisplayClass5_0.<<RunOperation>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Framework.Publishing.DataPromotion.NonTransactionalOperationStrategy.<RunAllOperationsInParallel>d__4.MoveNext() --- End of inner exception stack trace --- ---> (Inner Exception #0) System.Data.SqlClient.SqlException (0x80131904): Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean&amp; dataReady) at System.Data.SqlClient.SqlDataReader.TryReadInternal(Boolean setTimeout, Boolean&amp; more) at System.Data.SqlClient.SqlDataReader.ReadAsync(CancellationToken cancellationToken) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Dapper.SqlMapper.GridReader.<ReadBufferedAsync>d__21`1.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Dapper.SqlMapper.GridReader.<ReadBufferedAsync>d__21`1.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Framework.Publishing.Data.Classic.SqlServer.ClassicSqlServerDataProvider.<GetChangeReport>d__30.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Framework.Publishing.Data.Classic.SqlServer.ClassicSqlServerDataProvider.<>c__DisplayClass4_0.<<AddOrUpdateVariants>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Framework.TransientFaultHandling.Sql.SqlRetryHelper.<>c__DisplayClass8_0`1.<<ExecuteAsync>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Framework.TransientFaultHandling.Sql.SqlRetryHelper.<ExecuteAsync>d__8`1.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Framework.Publishing.Data.AdoNet.DatabaseConnection`1.<ExecuteAsync>d__27`1.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Framework.Publishing.Data.Classic.SqlServer.ClassicSqlServerDataProvider.<AddOrUpdateVariants>d__4.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Framework.Publishing.Data.Classic.ClassicItemRepository.<SaveVariants>d__10.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Framework.Publishing.DataPromotion.ItemManifestPromoteWorker.<SaveVariants>d__8.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Framework.Publishing.DataPromotion.DefaultItemManifestPromoter.<>c__DisplayClass3_1.<<Promote>b__4>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Sitecore.Framework.Publishing.DataPromotion.ManifestPromoterBase.<ProcessManifestInBatches>d__4`2.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Framework.Publishing.DataPromotion.DefaultItemManifestPromoter.<>c__DisplayClass3_0.<<Promote>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Framework.Publishing.DataPromotion.ManifestPromoterBase.<Promote>d__2.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Framework.Publishing.DataPromotion.DefaultItemManifestPromoter.<Promote>d__3.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Framework.Publishing.DataPromotion.DefaultPromotionCoordinator.<>c__DisplayClass10_0.<<RunAndLogPromote>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Framework.Publishing.DataPromotion.DefaultPromotionCoordinator.<RunAndLogPromote>d__10.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Framework.Publishing.DataPromotion.DefaultPromotionCoordinator.<>c__DisplayClass9_3.<<PromoteAll>b__1>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Framework.Publishing.DataPromotion.NonTransactionalOperationStrategy.<>c__DisplayClass5_0.<<RunOperation>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Sitecore.Framework.Publishing.DataPromotion.NonTransactionalOperationStrategy.<>c__DisplayClass5_0.<<RunOperation>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Framework.Publishing.DataPromotion.NonTransactionalOperationStrategy.<RunAllOperationsInParallel>d__4.MoveNext() ClientConnectionId:b10abffe-4223-4b89-8bf1-b3d3ad77525a Error Number:-2,State:0,Class:11 ClientConnectionId before routing:f74db522-040a-48d5-a464-8238a1c58e14
Short Answer No. You cannot create nested documents within Solr using the default Sitecore indexing functionality. Since there's not a lot of background on the goals that you are trying to achieve, I can share some options that are available; each with their own benefits and drawbacks. It'll be up to you to decide whether to implement any of these suggestions. Option 1: Use GraphQL (comes with Headless Services 16+) to query your parent and child documents together. https://doc.sitecore.com/xp/en/developers/hd/190/sitecore-headless-development/sitecore-graphql-api.html https://graphql.org/learn/ Option 2: Create an index re-crawler that builds a new index using the nested document functionality. There's documentation on how to do this in Solr here: https://solr.apache.org/guide/8_4/indexing-nested-documents.html This option does give you the ability to use BlockJoin faceting to search your documents and child documents. https://solr.apache.org/guide/8_4/blockjoin-faceting.html I've done this in the past, but some thorough consideration needs to be given to an update strategy on the new index. WARNING: With the exception of in-place updates, the whole block must be updated or deleted together, not separately. For some applications this may result in tons of extra indexing and thus may be a deal-breaker. Option 3: Use a computed field to store your child documents as json within a string field. This is quick and dirty and will get your content into the index, but you can't do any filtering, faceting or block joins on this field.
Nested Solr Structure Is it possible to create a nested data structure in Solr using the content search index configurations? I'm curious if I can create a document like the following, then query against and/or facet the fields in the nested structure. { &quot;_group&quot;:&quot;fe58033195a142f7b33331d85e6120a9&quot; &quot;school_name_s&quot;: &quot;School 1&quot; &quot;programs&quot;: [ { &quot;program_name_s&quot;:&quot;Program 1&quot;, &quot;program_type_s&quot;:&quot;Program Type 1&quot; }, { &quot;program_name_s&quot;:&quot;Program 2&quot;, &quot;program_type_s&quot;:&quot;Program Type 1&quot; }, { &quot;program_name_s&quot;:&quot;Program 3&quot;, &quot;program_type_s&quot;:&quot;Program Type 2&quot; } ] } I'm currently using Sitecore 10.1.0 and Solr 8.4.0
There is an out of the box SXA function called Get-SiteItem that takes the item as parameter and gives the context site name. Using Get-Item function you can get the context item by using . as parameter. Import-Function Get-SiteItem $item = Get-Item . // Gets context item $site = Get-SiteItem $item // Gets context site item for the current item Write-host $site.Name
Get Sitename through PowerShell script I would like to get SXA Site name dynamically when we run PowerShell script through the context menu. Currently I am giving static Site name in PowerShell script. Using the below code. Show-Input &quot;Enter Site name&quot; I am using multiple sites so need it dynamically.
You can override the out of the box media handler with your own and do some custom logic to check if the user is authenticated. Your custom media handler should inherit from Sitecore.Resources.Media.MediaRequestHandler or Sitecore.XA.Foundation.MediaRequestHandler.MediaRequestHandler if using SXA. You should override the DoProcessRequest method and add your custom logic to check if user is authenticated. Here is an example custom Media Request Handler using System.Web; using Sitecore.Resources.Media; namespace MyCustomCode.Handlers { public class MediaRequestHandler : Sitecore.Resources.Media.MediaRequestHandler { protected override bool DoProcessRequest(HttpContext context, MediaRequest request, Media media) { // Do your authentication and redirect logic here return base.DoProcessRequest(context, request, media); } } } Once you have your custom media request handler you need to override the default setting in web.config using Web.config transforms <configuration xmlns:xdt=&quot;http://schemas.microsoft.com/XML-Document-Transform&quot;> <system.webServer> <handlers> <add verb=&quot;*&quot; path=&quot;sitecore_media.ashx&quot; type=&quot;MyCustomCode.Handlers.MediaRequestHandler, MyCustomCode&quot; name=&quot;Sitecore.MediaRequestHandler&quot; xdt:Transform=&quot;SetAttributes&quot; xdt:Locator=&quot;Match(name)&quot; /> </handlers> </system.webServer> </configuration>
How can I Override Sitecore’s Media Handler to force user to redirect to login Page if user is not Authenticated I need a way to prevent access to files in media items if a user is not authenticated. If a user is not authenticated he/she should be forced to redirect to login Page. If a user is authenticated then we should let the user to access the media item file , like we should handover the request to sitecore. Also Help me on changing the configuration settings to override the existing mediarequesthandler.
You need to add correct reference to Scriban.dll . Sitecore 10.2 works with version 3.6 of Scriban.
Error when adding scriban template to rendering variant migrated from 9.1.1 to 10.2 I'm currently in the process of upgrading our solution from Sitecore 9.1.1 to 10.2. Our solution has a number of nVelocity templates that I need to replace with scriban templates. I've also already run the SXA upgrade steps for 9.1.1 to 10.2. Whenever I add a scriban template item to a rendering variant, I'm getting the following error. Method 'TryGetItem' in type 'Sitecore.XA.Foundation.Scriban.ContextExtensions.ItemAccessor' from assembly 'Sitecore.XA.Foundation.Scriban, Version=9.0.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation. Has anyone run into this issue before?
Without any other documentation available, I was able to get the error to go away with the following entry to the solr.in.cmd. set SOLR_OPTS=%SOLR_OPTS% -Dsolr.disable.shardsWhitelist=true
Solr replication configuration reports the error 'Invalid URL syntax in "shards" parameter' After upgrading from Solr 8.1.1 to 8.8.2 I'm seeing an error on the &quot;follower&quot; instance: Unable to create core [sitecore_web_index] Invalid URL syntax in 'leaderUrl' with value 'https://searchx.tsta.sxp.local/solr/sitecore_web_index' Invalid URL syntax in &quot;shards&quot; parameter: null This is configured with Leader/Follower replication settings found in the solrconfig.xml. <requestHandler name=&quot;/replication&quot; class=&quot;solr.ReplicationHandler&quot;> <lst name=&quot;follower&quot;> <str name=&quot;leaderUrl&quot;>https://searchx.tsta.sxp.local/solr/${solr.core.name}</str> <str name=&quot;pollInterval&quot;>00:00:20</str> </lst> </requestHandler> I suspect this has to do with a security issue reported and addressed with 8.8.2: CVE-2021-27905 I found an issue reported on Apache's Jira portal with no response: SOLR-15481 Any steps known to address overcome this issue?
Yes, all language versions of an item will be packaged if you use the Items statically option in the Package Designer, likewise all language versions will be added if you use the Items dynamically option, and then select do not check any language options within the Language filter. If an item does not have a version in a particular language, then one will not be packaged. Hope this helps!
How to select all languages when creating a package? Are all languages of specific item selected by default, when creating a package (not by default, but if the item exist for that language then it is selected automatically) if I do not have a language filter on? Or I should select all languages manually where the item exist? (English, German, Italian...)
You have couple of options to expose Sitecore configuration: Extending Layout Service could be easiest as it's easily accessible to your JSS app. One of the drawbacks of this solution would be performance in long run as it would take some time to run all the extensions and running generating Layout Service response. You can create REST endpoint / API on Back End / usually ASP.NET WebApi project solution/ which will expose this and/or product listing or other information. This can be also easily accessible via your JSS project using Axios React library You can also use Rendering Contents Resolver - It is something similar to first option but it's adding data to Layout Service output per component where this resolver is set. Why to choose third option: Avoid additional HTTP roundtrip(s). Automatically bind the data to the component. Make the data available for server/universal rendering. Make it easier to query additional data related to the current application, context item (route), or datasource item. In your case I would choose option 1 or 2 for exposing Sitecore configuration elements. I would go with option 3 for exposing product listing as product listing will be only exposed for components which will have that resolver set
Expose configuration items using JSS Quiet new to JSS world. We have a requirement to expose the sitecore configuration settings to FE using JSS headless architecture. On top of this, we have other global data that needs to be exposed to FE e.g. product listings etc. Given that Layout Service is mainly concerned with route details (place holders, data sources, fields etc), what's the best way to expose the data using JSS headless?
You need to use a dynamic source query like this, that will match the same content tree structure for each site. query:./ancestor-or-self::*[@@templateid='SITE TEMPLATE ID']//*[@@templateid='GLOBAL ITEM TEMPLATE ID']//*[@@templateid='BLOG TEMPLATE ID'] Also if you want to fix the path of your Content tree structure after a certain point then the query will be something like this. (In case you are using Folder to hold item) query:./ancestor-or-self::*[@@templateid='SITE TEMPLATE ID']/Global/Blog/Blog Promo Card Follow this article for more information https://sitecoresandbox.com/tag/droptree/ Hope this helps.
Show Items in drop tree dynamically based on Sites I have a requirement to show the datasource item in droptree field and its a multi site solution. My content tree structure is as below WebSite A Home Global Blog Blog Promo Card WebSite B Home Global Blog Blog Promo Card My requiremet is to show items dynamically based on sites based on this template (Blog Promo Card). So in drop tree field on item level i should show items creted from block promo card template.
To fix this, I did the following: Go to Manage/Watermarks Open Default Watermarks. Remove the Preview rendition from Rendition Links, and save. Add Preview back to Default watermark and save. The watermark user should now see this: At this point I was able to move the Preview rendition back to the default watermark and remove the temporary watermark, and the display remained functional. Note that this display requires very minimal permissions:
Watermark Preview won't display I've created a role that can only see watermarked versions of certain assets. Rather than displaying a watermarked preview, the assets are not being shown at all. The Preview rendition is configured to create a watermarked version. I'd like to know: If a security or other configuration task has been missed. How to effectively troubleshoot a rendering 404 issue. Is this behavior expected. Asset Detail Page missing preview How my page is displaying. Note gap on top left. Preview rendition also returns a 404. Security Roles Security roles set on this role. (Update: I've also added read access to M.File, per Ronald's reply.) Content Hub 3.4.6, and reproduced on 4.0.0 Additional information: Per Ronald's suggestion, I have added read access to M.File. This did not resolve the issue. For the preview image (technically, the Entity Image Viewer component output), the image is rendered with a URL for a Superuser: src=&quot;https://dan-solovay-346-empty.sitecoresandbox.cloud/api/delivery/local-15af4ed5a70b433bb6903925d8d4af24?expires=2022-05-10T17%3A09%3A06.0390071%2B00%3A00&amp;entityid=29984&amp;userid=29706&amp;rendition=preview&amp;signature=loXVaDCXgRA)&quot; but for the user without &quot;ViewWithoutWatermark&quot;, the src value is replaced with a small amount of inline binary: src=&quot;data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7&quot; If I create a &quot;watermark_preview&quot; rendition, as documented here, that rendition is visible to the user in a watermarked state: So watermarking is working fine for this user; the issue is with the watermark behavior of the Preview rendition. However, only Preview and Thumbnail are allowed options for the Entity Image component, so there is no way to make use of this rendition to display a watermarked preview on the Asset Detail page. The permissions on the watermarked_rendition are identical to Preview itself, so that doesn't look to be the issue.
The main use of Value Provider is for prefilling Sitecore forms. So Sitecore has described how to implement that using the below article. https://doc.sitecore.com/xp/en/developers/93/sitecore-experience-manager/walkthrough--setting-up-a-value-provider-for-prefilling-forms.html But in your case, if you want to pre-fill your value for a dropdown list then you only need to pass a list of strings like this. For example, if the value you want pre-fill is called &quot;prefillvalue&quot;, then you code will be like this. public object GetValue(string parameters) { return new List<string> {&quot;prefillvalue&quot;}; } Read this article for more details. http://onelittlespark.bartverdonck.be/value-provider-on-list-components/
Setup value provider for dropdown list field in Sitecore forms using IFieldValueProvider I have a doubt regarding setting up a value provider for prefilling Sitecore forms, I can see there are examples for simple text input fields, and it's working, but when I try to set up a value provider for a dropdown list field it's not working. I tried below but no luck, can someone help me to figure out what am doing wrong here. public class CountryListValueProvider : IFieldValueProvider { public FieldValueProviderContext ValueProviderContext { get; set; } public object GetValue(string parameters) { var countries = GetCountries(); var countrList = new ListFieldItemCollection(); foreach (var country in countries.data) { countrList.Add(new ListFieldItem { Text = country.code, Value = country.value }); } switch (parameters) { case &quot;countrList&quot;: return countrList; default: return string.Empty; } } } Or do I need to try something else, like using IListDataSourceProvider or something (edited)
As per your statement in your question i.e. &quot;this file should always be present after any kind of Sitecore installation&quot;, I downloaded Sitecore 10.2 installation packages for Sitecore Experience Platform (XP) and Sitecore Experience Management (XM). After extracting I found that the folder called System that is under Layout doesn't exist in XM but it does exist in XP. And I also verified that for both Content Management (CM) and Content Delivery (CD) packages. So it exists in XP for both CM and CD but not in XM for both. So you need to verify on your test server, which one is installed over there. To check the feature available for XM and XP, please follow this link. https://getfishtank.ca/blog/sitecore-xm-vs-xp Also, I verified these packages. Hope this help.
Why VisitorIdentification.js file is missing? Is there any reason why \layouts\system\VisitorIdentification.js file or whole \layouts\system\ folder is missing on the Sitecore instance? I'm using Sitecore 10.2 on my local and I can see this file, this file is missing on the test server. So I wondering does Sitecore provides some installation option that will not install this file or this file should always be present after any kind of Sitecore installation?
You need to specify different names for those paths. The second one is &quot;overwriting&quot; the definition of first one. So instead of: <includedPaths hint=&quot;list:AddTemplatePath&quot;> <templates>/sitecore/templates/path1</templates> <templates>/sitecore/templates/path2</templates> </includedPaths> you should use this for example: <includedPaths hint=&quot;list:AddTemplatePath&quot;> <templates>/sitecore/templates/path1</templates> <commonTemplates>/sitecore/templates/path2</commonTemplates> </includedPaths>
How to generate Synthesis model for two template paths I am using Synthesis ORM for Sitecore for auto generation. Purpose is to generate model for two template paths. I have given below settings in Synthesis.Local.config based on <TemplatePathRoot>/sitecore/templates</TemplatePathRoot> pattern and paths like <includedPaths hint=&quot;list:AddTemplatePath&quot;> <templates>/sitecore/templates/path1</templates> <templates>/sitecore/templates/path2</templates> </includedPaths> But it always generates model for template at second position. Can you please suggest if above syntax is correct and how can I generate model for both paths?
After talking to Sitecore support, we figured out. Posting here in case someone has the same problem. Yes, they are supported. The html-templating has to be reimplemented. Custom form elements have a &quot;razor view&quot; .cshtml file that defines how they are rendered. This essentially has to be &quot;translated&quot; into JSX (in our case where we're using react), or whatever HTML templating your frontend framework uses. Sitecore will not return any HTML structure, only configuration, so the .cshtml file can't be reused for the JSS approach. To associate your form element with your JSX, you use a defaultFieldFactory. It looks something like this: import { Form, createDefaultFieldFactory, } from &quot;@sitecore-jss/sitecore-jss-react-forms&quot;; import React from &quot;react&quot;; const myCustomFormFactory = createDefaultFieldFactory(); defaultFieldFactory.setComponent( &quot;<Your-Custom-Form-Component-ID-As-Per-Error-Message>&quot;, (props) => { return ( // The following reproduces whatever code was in your .cshtml <div> <label className={props.field.model.cssClass}>{props.field.name</label> <input className={props.field.model.cssClass}>{props.value}</input> </div> ); } ); export const SitecoreForm = (props: Props) => ( <Form form={props.fields} sitecoreApiHost={<API_HOST>} sitecoreApiKey={<API_KEY>} fieldFactory={myCustomFormFactory} /> ); This documentation is somewhat helpful: https://github.com/Sitecore/jss/blob/release/19.0.0/docs/data/routes/docs/techniques/forms/en.md
Is it possible to use Custom Form Elements in JSS? If yes, how? We are trying to include Sitecore Forms in our React Application using JSS. We're able to include regular forms, but when trying to use custom form elements using the design of the customer, we get an error: No renderer for form element type The custom form elements have been implemented without JSS in mind, by another team. I believe the current implementation depends on MVC-Forms. We're trying to understand: Are custom Form Elements even supported by JSS (we're using Sitecore 10.2)? What needs to be done to make them work? Do we need to re-implement them for use with JSS? Are there any tutorials or documentation for this particular use case?
This can be achieved in several ways, I will describe 2 ways below: Robots.txt: If you want to exclude all the pages below a particular route, you can add an entry in the Robots.txt like below: Disallow: /Account/* A Sitemap settings template: To have a more granular control at the page level, you should create a base template and include a setting for enable/disable in the crawling index. This template should be referenced in all the page items. In the header component, you can then include a check to add meta tag <META NAME=&quot;robots&quot; CONTENT=&quot;noindex,nofollow&quot;> based on the setting opted for the page.
Sitemap set noindex attribute I need to set noindex attribute for each generated sitemap XML. I create sitemap.xml using Sitemap Controller [Route(&quot;sitemap_index.xml&quot;)] public ActionResult SitemapIndexXml() { return this.TryInvoke<ActionResult>(() => { var siteName = SitecoreConstants.DefaultSiteName; var uri = Request.Url; if (uri != null) { var currentSite = SiteFacade.GetSiteNameByHostName(uri.Host); if (!string.IsNullOrEmpty(currentSite)) { siteName = currentSite; } } var expirationDate = DateTime.Today.AddDays(1); var xml = this.MemoryCacheService.GetOrSet( string.Format(SitemapCacheKey, siteName, string.Empty, &quot;sitemap_index&quot;), expirationDate, () => this.SitemapSerializationService.SerializeSitemapIndex(siteName)); return this.Content(xml, &quot;xml&quot;, Encoding.UTF8); }, &quot;SitemapController.SitemapIndexXml&quot;); }
I created a support ticket on Sitecore for this issue. And got a response that they are able to reproduce the similar behavior locally, this behavior has been registered as a bug in their tracking system with the reference number 511692. The issue has been fixed in Sitecore 10.2, So they suggested to consider upgrade it to the specific version to get the issue fixed. If the upgrade is not an option then you can also consider the following workarounds to avoid the issue happens: Workaround 1: Remove the language parameter manually in the field. Here's the sample screencast: https://www.screencast.com/t/Ux8JejD0M Workaround 2: The issue only happens in the List View, you can switch it to Grid View to avoid the issue happens. screencast: https://www.screencast.com/t/mlEOVL2acMYq
General Link with Search field is adding language code along with ID in the Item Link We are using the General Link with Search field to filter and select the items in Sitecore 10.1. Now when I click Search for a link on the field and then search for the items of a particular template, it gives me the proper result and that is fine. But when I select the item from the results, it appends the language with the Item ID selected in the ItemLink box like this as shown in below screenshot. The issue is that after selecting the item when I click OK, it gives me the error. Object reference not set to an instance of an object. Here is the screenshot. The value in the Item Link field shows like this {7F0FE8D0-36A7-4502-BFA9-49EE583FF513}/en. Now if I manually remove /en in the ItemLink field and click OK then it doesn't show any error and the item gets selected in the field and it works fine. Can anyone let me know how to resolve this?
What you are trying to do is to update the raw value of the Image field. To do this you need to get the target Image item from the raw value of the Image field and then get the Alternate Text of that image item. And then update the main item raw value to add alt text. Sharing with you a sample script will help you to do this. # Get the content Item by passing your item ID. $item = Get-Item -Path &quot;master:&quot; -Uri &quot;sitecore://master/<your-item-id>&quot; # Get the image field by passing your field name. $imageField = [Sitecore.Data.Fields.ImageField]$item.Fields[&quot;<your-field-name>&quot;] # Get the actual Sitecore Image item by passing the mediaID (see your raw value) $imageItem = Get-Item -Path master: -ID $imageField.mediaID # Get the Alt value from the Image Item $altValue = $imageItem.Fields[&quot;Alt&quot;].Value # Update the Main value $item.Editing.BeginEdit() $item.Fields[&quot;Image&quot;].Value = [string]::Format(&quot;<image mediaid='{0}' alt='{1}' />&quot;,$imageField.mediaID, $altValue) $item.Editing.EndEdit() Now your raw value will look like this. <image mediaid='{094AED03-02E7-4868-80CB-19926661FB77}' alt='Default Text' /> And you will be able to see it filled in your Image Properties. Hope this help.
How to update Item's Media Properties using SPE (Sitecore Powershell Extensions) I have an Image Field in an Item. When the image is uploaded to Media Library, the Alt field is not updated and hence when we look at the Image properties from Item, it is Blank. So far so good. The content Author now has updated the Image's Alt Text and i can see that the &quot;Default Alternate Text&quot; is showing correctly as in screenshot below. But the content author is expecting the &quot;Alternate Text&quot; to be filled up with &quot;Default Alternate Text&quot;. I planned to fill it with SPE. When i tried to browse the &quot;Alternate Text&quot; field from SPE, it shows an xml with MediaID without Alt tag. $Item[&quot;Article Thumbnail&quot;] $Item.PSFields.&quot;Article Thumbnail&quot; For both, I see an xml as Now the question is how to fill &quot;Alternate Text&quot; from &quot;Default Alternate Text&quot;. I can't access both fields from SPE. Any suggestions or solutions for this.
This isn't possible by default. There is a LastModified property but it will not serve your purpose. You should: Create a Custom Facet: https://doc.sitecore.com/xp/en/developers/93/sitecore-experience-platform/create-a-custom-facet.html Define a property to store the Created date Set Facet: At the time of creation of a new contact, set the facet property as described here: https://doc.sitecore.com/xp/en/developers/93/sitecore-experience-platform/set-contact-facets.html
How to retrieve Contact created date I'm using Sitecore 9.1 update 1. When retrieving contacts via IAsyncQueryable<Contact> queryable = client.Contacts I don't see the created date of the contact. How can I programmatically get the contact's created date?
Those views are not physically available in the webroot, they use view precompilation for performance reasons. For example the view you are mentioning is precompiled in the Sitecore.Speak.Web assembly. If you decompile this you will find some code like below which has the precompiled code for the view: [GeneratedCode(&quot;RazorGenerator&quot;, &quot;2.0.0.0&quot;)] [PageVirtualPath(&quot;~/sitecore/shell/client/Speak/Layouts/Layouts/Speak-FlexLayout.cshtml&quot;)] public class _sitecore_shell_client_Speak_Layouts_Layouts_Speak_FlexLayout_cshtml : WebViewPage<RenderingModel> { public override void Execute() { //all precompiled code is here } }
Where are the cshtml files for the built in SPEAK UI layouts and renderings I'm working with SPEAK UI (Sitecore 9.2) and am attempting to understand more about how the built-in components are structured. Looking at the layout Speak-FlexLayout I see that the Path specified is /sitecore/shell/client/Speak/Layouts/Layouts/Speak-FlexLayout.cshtml However, when I look at the file system I cannot find the file specified: I can find sitecore/shell/client/Speak/Layouts but it doesn't have a Layouts folder beneath it. Is there some file path mapping going on here?
You need to click on the sync button, then it will automatically move into the Bucketable structure. Make sure to click on parent folder and then click on the sync button, in your case click on the Videos Item. Although not sure why we need to do it manually, I can find this way only for now.
Moving Item from a Bucket into another Bucket doesn't keep the item into Bucket structure I have a requirement where I need to get items from a Bucket and move them into another Bucket. When I manually move the item using MoveTo from the menu, it works fine and shows a perfect tree structure in Bucketable item format like this. But when I try to do that using a Powershell script then it shows as a normal item that doesn't come in the Bucketable structure. It shows like this. The script I am using is this. $destinationItem = Get-Item &quot;/sitecore/media library/folder1/folder2/Videos&quot; $rootOfitemsToMove = Get-ChildItem -path &quot;/sitecore/media library/folder1/folder2/folder3/Media Content/2018/05/21/19/52&quot; -Recurse | Where-Object { $_.TemplateName -ne 'Bucket' } $rootOfitemsToMove | ForEach-Object { Move-Item -Path $_.ItemPath -Destination $destinationItem.Paths.FullPath } Please let me know if I need to add something to Powershell script?
The reason behind this below attribute HTML tag missing in the web.config. <httpCookies sameSite=&quot;None&quot; requireSSL=&quot;true&quot; /> I have updated my web.config with below attributes in respective tags: <httpRuntime targetFramework=&quot;4.8&quot; maxRequestLength=&quot;512000&quot; executionTimeout=&quot;600&quot; enableKernelOutputCache=&quot;false&quot; relaxedUrlToFileSystemMapping=&quot;false&quot; requestValidationMode=&quot;4.0&quot; enableVersionHeader=&quot;false&quot; requestValidationType=&quot;Sitecore.Web.RequestValidators.SitecoreBackendRequestValidator, Sitecore.Kernel&quot; /> <httpCookies sameSite=&quot;None&quot; requireSSL=&quot;true&quot; />
The operation could not be completed. Your session may have been lost due to a time-out or a server failure when I am going to publish any single item from the Sitecore content tree I am getting the below error: Application is migrated from Sitecore version 9.0.2 to 10.2 and deployed on Azure PAAS environment. It's perfectly working fine in the developer workstation. Can anyone please guide me, on what can be the reason, or am I missing some configuration on Azure?
All of the SXA meta renderings are located on the Meta Partial Design. I'm assuming that you have created a new page template but forgot to add proper Page Design mapping:
SxaLayout.cshtml head tag does not show metadata components for site page I've created a page type in Sitecore 10.2 SXA and it contains a base template Page. The page base template consists of all the metadata templates. When I try viewing the user-defined page via View page source the metadata tags do not appear. Using SxaLayout.cshtml <head> <meta charset=&quot;UTF-8&quot; /> <meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=edge&quot; /> @foreach (string style in assetLinks.Styles) { @Html.Raw(style) } @foreach (var include in includes.Head) { @Html.Raw(include.HTML) } @Html.Sxa().VisitorIdentification() @Html.Sxa().Placeholder(&quot;head&quot;) <link rel=&quot;stylesheet&quot; href=&quot;~/assets/css/style.min.css&quot; /> </head> Any idea how do I resolve this?
To get the result of all the selected pages in TreeList, you need to write your code something like this. $props = @{ Parameters = @( @{Name=&quot;listOfPages&quot;; Title=&quot;Select Language&quot;; Options=$languageTypes; Tooltip=&quot;Select one or more page from list&quot;; Editor=&quot;Treelist&quot;; Source = &quot;DataSource=/sitecore/content/DC Decorio/DecorioLocal/Home&amp;DatabaseName=master&quot;} ) Title = &quot;Select pages you wish to copy on other languages&quot; Description = &quot;Choose the criteria.&quot; Width = 550 Height = 300 ShowHints = $true } $result = Read-Variable @props $listOfPages | Select-Object DisplayName, FullPath This will give you the list of pages in output. You can use the variable $listOfPages and create a loop and write your code. Create a loop like this $listOfPages | ForEach-Object { Write-Host $_.DisplayName } Hope this helps.
How to loop selected pages in PowerShell model Treelist I am using Sitecore Powershell Module, to select list of pages that can be later on translated and created new item. I am using this block of code @{ Name = &quot;listOfPages&quot; Title = &quot;Select pages you wish to copy on other languages&quot; Editor = &quot;Treelist&quot; Source = &quot;DataSource=/sitecore/content/XXXX/Home&amp;DatabaseName=master&quot; Tooltip = &quot;Select one or more page from list.&quot; },
As per this discussion, When you have items in your $selectedItems and then in the loop, you are again trying to call Get-Item is creating the issue. You just need to update ItemId = (Get-Item $item).Name To ItemId = $item.Name And it will solve your issue.
Sharing data between two powershell scripts I have two scripts namely, Add and Report. I am having a array of items in Add script. I want to read this array in Report script. Add script can be called multiple times. I want to retain the value in array and read them in Report script. I have added Persistent Session ID to both these scripts. How do I update the array list in Add script whenever the add script is called and read the array list in Report script. I have a global function where I have initialized the class, class Modes { [string]$ItemId [string]$InstallMode [string]$MergeMode } [Modes[]]$itemModes = @() In Add.script, foreach($item in $selectedItems){ $itemMode= [Modes]@{ ItemId = (Get-Item $item).Name InstallMode= $installModeOption MergeMode = $mergeModeOption } $itemModes =[Array] $itemModes + $itemMode } In Report.script $itemModes|Show-ListView How do I read the itemsModes I have added in Add.script in Report.script?
You can try below command - Get-User -Current You can try some options as well - Get-User [-Identity] <AccountIdentity> [-Authenticated] Get-User -Filter <String> [-Authenticated] [-ResultPageSize <Int32>] Docs for references - https://doc.sitecorepowershell.com/appendix/security/get-user https://munirhassan.com/2021/10/17/powershell-scrips-to-get-sitecore-user-information/
How to get current user role name in Sitecore using Powershell How can I read the role name of current logged-in user in Sitecore PowerShell Module?
If you want to do this, then you need to first filter using the Where-Object and then call Show-ListView to show these filtered results. So I am showing a sample code here and then you need to adjust it wherever you want to use it. # Getting the list of items $listOfPagesInTree = Get-ChildItem -Path &quot;master:\content\home&quot; -Recurse # Filtering it using the Where-Object and then showing using Show-ListView $listOfPagesInTree | Where-Object { $_.TemplateName -eq &quot;Sample Item&quot;} | Show-ListView Hope this will help you to complete your code. Thanks
How to use Where-object in Show-ListView Expression I have a list(list 1- $itemModes) which contains following fields, class Mode { [string]$WorkflowName [string]$WorkflowId [string]$ItemId [string]$ItemName [string]$InstallMode [string]$MergeMode } [Mode[]]$itemModes=@() I have another list(list2- $items) as follows, $items | Show-ListView @props -Property @{Label=&quot;Name&quot;; Expression={$_.DisplayName} }, @{Label=&quot;Workflow State&quot;; Expression={(Get-Item -Path &quot;master:&quot; -ID $_.&quot;__Workflow state&quot;).Name} }, @{ Name=&quot;Source&quot;; Expression={}}, @{ Name=&quot;InstallMode&quot;; Expression={}}, @{ Name=&quot;MergeMode&quot;; Expression={}} How do I update the InstallMode, MergeMode values from list 1 in list 2 I need to match the item Id and workflow name. How do I use where-object with in, @{ Name=&quot;InstallMode&quot;; Expression={}}, @{ Name=&quot;MergeMode&quot;; Expression={}} Eg: @{ Name=&quot;InstallMode&quot;; Expression={$itemModes.InstallMode|Where-Object $_.Id -eq $itemModes.Id -and $_.WorkflowName -eq $itemModes.WorkflowName}}, @{ Name=&quot;MergeMode&quot;; Expression={$itemModes.MergeMode|Where-Object $_.Id-eq $itemModes.Id -and $_.WorkflowName -eq $itemModes.WorkflowName}} I am not sure how to do this.
It looks like you had a template which was somehow removed from Sitecore later. Or alternatively, one synchronized an item without synchronizing the template, and now you have an item in your database which has no template. Solution? Run the following script on your SQL database: SELECT TOP (1000) [ID] ,[Name] ,[TemplateID] ,[ParentID] FROM [Items] WHERE [TemplateID] = '{7FBCE76B-D04A-42C9-8CB2-D61BFA202879}' and for any [ID] from the result set open item in dbbrowser tool: `https://yourhost/sitecore/admin/dbbrowser.aspx?db=master&amp;lang=en&amp;id=[ID]` Delete that item. If necessary, change database from master to e.g. web in the url above.
Could not compute value for ComputedIndexField: _alltemplates for indexable Whenever I run sitecore_master_index or sitecore_suggested_test_index on Sitecore 9.0.1, I see the below errors in the Crawling logs. I cannot find the item {7FBCE76B-D04A-42C9-8CB2-D61BFA202879} in the Content Tree either. Any suggestions please? Exception: System.InvalidOperationException Message: Item template not found. Source: Sitecore.ContentSearch at Sitecore.ContentSearch.IndexOperationsHelper.GetAllTemplates(Item item) at Sitecore.ContentSearch.AbstractDocumentBuilder`1.<>c__DisplayClass55_0.<AddComputedIndexFieldsInParallel>b__0(IComputedIndexField computedIndexField, ParallelLoopState parallelLoopState)```
I'm not sure if this will solve your issue as you mention it is working on the CM - but we had an issue with integrated GraphQL on an 10.2 headless setup including SXA. The issue was solved by this kb: https://support.sitecore.com/kb?id=kb_article_view&amp;sysparm_article=KB1000658 Might seem completely unrelated but it solved the problem for us. After deleting the config file modules/sxa/z.layout.service/layout.service.config the integrated mode worked. If this doesn't fix, you should compare your config files between CM and CD to check for differences - and also check if there are no GraphQL related parts that get changed by the environment patching.
GraphQL Integrated not functioning correctly on CD server, working on CM I'm having a problem on our site setup with Sitecore 10.2, Sitecore Headless Services 19.0 and SXA. GraphQL integrated isn't returning data correctly on our CD site, it is only working properly on the content management (CM) server - though it is also not returning data on the layout service API (/sitecore/api/layout/render). The problem is that no data is being returned to the page/in the API. On the pages, when accessed from the CM (e.g. page edit mode, but also with sc_mode), the data from GraphQL queries comes through as expected. Using the GraphQL playground (/sitecore/api/graph/edge/ui), the GraphQL statements function as expected (the GraphQL playground is only accessible on the CM server). GraphQL connected is working properly across all modes/servers. I've tried different pages, different renderings, and modifying the NextJS components to no avail.
So it appears that the root of the issue is that Edit Frame uses a different Chrome Type than a rendering and the Edit Frame Chrome Type does not implement chrome:rendering:properties or any other relevant command. Rendering Chrome Type: shell\Applications\Page Modes\ChromeTypes\RenderingChromeType.js Edit Frame Chrome Type: shell\Applications\Page Modes\ChromeTypes\EditFrameChromeType.js EditFrameChromeType only handles 2 messages for edit frame. I was able to adjust the handlers from RenderingChromeType to work on the EditFrameChromeType. Here's the updated EditFrameChromeType.js I used that allows me to use the default button for Edit Component Properties on an edit frame. Sitecore.PageModes.ChromeTypes.EditFrame = Sitecore.PageModes.ChromeTypes.ChromeType.extend({ constructor: function() { this.base(); this._editFrameUpdating = false; this.fieldsChangedDuringFrameUpdate = false; }, handleMessage: function(message, params) { switch (message) { case &quot;chrome:editframe:updatestart&quot;: this.updateStart(); break; case &quot;chrome:editframe:updateend&quot;: this.updateEnd(); if (Sitecore.WebEditSettings.autoSaveOnEditFrame) { ExperienceEditor.ribbonDocument().querySelector('[data-sc-id=&quot;QuickSave&quot;]').click(); } break; case &quot;chrome:rendering:properties&quot;: this.editProperties(); break; case &quot;chrome:rendering:propertiescompleted&quot;: this.editPropertiesCompleted(); break; } }, isEnabled: function() { return $sc.inArray(Sitecore.PageModes.Capabilities.edit, Sitecore.PageModes.PageEditor.getCapabilities()) > -1 &amp;&amp; this.base(); }, key: function() { return &quot;editframe&quot;; }, load: function() { }, updateStart: function() { this._editFrameUpdating = true; this.fieldsChangedDuringFrameUpdate = false; }, updateEnd: function() { if (this.fieldsChangedDuringFrameUpdate) { this.chrome.element.addClass(&quot;scWebEditFrameModified&quot;); } this._editFrameUpdating = false; this.fieldsChangedDuringFrameUpdate = false; }, editProperties: function() { var placeholder = this.getPlaceholder(); var rendering = this.getRendering(); if (placeholder &amp;&amp; rendering) { placeholder.type.editProperties(rendering); } }, editPropertiesCompleted: function() { var placeholder = this.getPlaceholder(); var rendering = this.getRendering(); if (placeholder &amp;&amp; rendering) { placeholder.type.editPropertiesResponse(rendering); } }, uniqueId: function() { var rendering = this.getRendering(); if(!rendering){ throw &quot;Unable to find rendering for edit frame!&quot;; } return rendering.openingMarker().attr(&quot;id&quot;).substring(2); }, getPlaceholder: function() { var placeholder = this.getContainerByType('placeholder', null, 1, 4); return placeholder; }, getRendering: function() { var rendering = this.getContainerByType('rendering', null, 1, 4); return rendering; }, getContainerByType: function (typeKey, itm, iteration, maxIterations) { itm = itm || this.chrome.parent(false, false); if (!itm) { return null; } if(itm.type.key() == typeKey){ return itm; } var parentElement = itm.parent(); if (!parentElement || parentElement.type.key() != typeKey) { if(iteration > maxIterations) { console.warn(itm.element); throw &quot;EditFrame must have &quot; + typeKey + &quot; chrome as its parent. Got '&quot; + itm.type.key() + &quot;' instead&quot;; } return this.getContainerByType(typeKey, parentElement, iteration + 1, maxIterations); } return parentElement; } }); I basically just extended the getPlaceholder logic that checks the parent to crawl recursively and get renderings and placeholders. That let me access the methods I needed and emulate the context of the rendering.
Using Edit Frames Breaks Rendering Parameters (Edit Component Properties) I have a question or maybe a misunderstanding in regards to Edit Frames. Some of my renderings use rendering parameters templates that work well when I choose Edit Component Properties in Experience Editor. However, if I add an edit frame (e.g. Html.EditFrame) to my renderings the Edit Component Properties button no longer seems to work. I have tried duplicating the default button and been trying to use a small edit frame button with different variations of commands like chrome:rendering:properties, chrome:common:edititem({command:&quot;webedit:editrenderingproperties&quot;}), and webedit:editrenderingproperties with no luck so far. Is there a way to enable/call Edit Component Properties with my Edit Frames? e.g. This button works fine without an edit frame, but i cant get it to work in an edit frame
You are copying just a field in an item. This will not copy other items, like related datasources. However, the relationship to the datasource items will remain as this is based on guids inside the final renderings field. I think based on your code sample we can assume you are copying final renderings between language versions. In that case, the datasource relation will be fine. It will still point towards the original datasource but Sitecore will take the context language when rendering it.
When you copy final renderings, what does happen with the datasources? I wonder when I copy final renderings, what does happen with the datasource, does this will be copy also datasource or not? New-UsingBlock (New-Object Sitecore.Security.Accounts.UserSwitcher $elevatedUser) { function Copy-FinalRenderings { param( [Item]$baseLangItem, [Item]$newLangItem ) if($baseLangItem.TemplateID -in $templateIds) { $newLangItem.Editing.BeginEdit() $newLangItem.Fields[&quot;__Final Renderings&quot;].Value = $baseLangItem.Fields[&quot;__Final Renderings&quot;].Value $newLangItem.Editing.EndEdit() } }
When I have had to debug a similar issue in the past (generated layout that would not display) I used the Content Editor. From there, you can use the Presentation Details dialog to see all the components and which placeholders they were added to. You can also see the raw XML of the layout, if you really need to. This can help you debug if the components were not added, or were added to the wrong placeholder name.
How can I check why component disappears when I add it to placeholder? when I add content that was previously generated to placeholder of page, the whole component disappears, how can I check where is there error, also the content was created on new language version by PowerShell script.
You need to check If this is the issue of IIS? For this you need to check if IIS is started or not. If not, restart IIS and then check.
Sitecore SIF installation identityserver issue I am trying to install Sitecore 10.1 XM, via SIF but during installation I am getting error about identityserver, I see that identityserver is created on IIS side. it is no other sites on IIS side, MS SQL Server can connect via the login that I provided for script. what could be an issue of it ? [------------------------------- IdentityServer_StopWebsite : ManageWebsite --------------------------------------------] [IdentityServer_StopWebsite]:[Stop] mysite.identityserver Install-SitecoreConfiguration : The property 'Value' cannot be found on this object. Verify that the property exists. At C:\Projects\ori\dev\deploy\configs\sitecore\10.1\XM1\XM1-SingleDeveloper.ps1:95 char:1 + Install-SitecoreConfiguration @singleDeveloperParams *>&amp;1 | Tee-Objec ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Install-SitecoreConfiguration [TIME] 00:00:09 Invoke-ManageWebsiteTask : The property 'Value' cannot be found on this object. Verify that the property exists. At C:\Program Files\WindowsPowerShell\Modules\SitecoreInstallFramework\2.3.0\Public\Install-SitecoreConfiguration.ps1:644 char:25 + &amp; $entry.Task.Command @paramSet | Out-Default + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Invoke-ManageWebsiteTask
It's hard to know what you mean by &quot;is content and datasources&quot;. You can call $baseItem.Paths.IsContentItem that will return true is descendant of /sitecore/content item. And you can $baseItem.Template $baseItem.TemplateID $baseItem.TemplateName values to get more information about what kind of item that is.
How to check item type Sitecore PowerShell? How can I check if particular expected item is content and datasources? foreach($baseItem in $listOfPages) { $items += Get-Item $baseItem.Paths.FullPath $items += Get-ChildItem $baseItem.Paths.FullPath -Recurse }
So the code will be something like this. $items = @() foreach($baseItem in $listOfPages) { if($baseItem.Paths.IsContentItem) { foreach($childItem in Get-ChildItem $baseItem.Paths.FullPath -Recurse) { # Need to check that if any child item has the folder name called 'Content' if($childItem.Name -contains 'Content') { Write-Host &quot;Child items is content&quot; # Add this item in Array $items += $childItem # Add it's child items in Array $items += Get-ChildItem $childItem.Paths.FullPath } } } } Hope this will work.
How to select only items in content folder and item datasources using powershell script? how can I select only content items, items in content folder and Datasources of that items using PowerShell Extension script? $items = @() foreach($baseItem in $listOfPages) { if($baseItem.Paths.IsContentItem){ $items += Get-Item $baseItem.Paths.FullPath foreach($childItem in Get-ChildItem $baseItem.Paths.FullPath -Recurse) { if($childItem.Paths.FullPath -contains 'Content'{ Write-Host &quot;Child items is content &quot; $items += $childItem } } }
Adding this in the custom Sitecore index config works for me! <fieldNames hint=&quot;raw:AddFieldByFieldName&quot;> <field fieldName=&quot;sxatags&quot; returnType=&quot;stringCollection&quot;/> </fieldNames>
Unable to map sxatags_sm field to model I have indexed my content in the SOLR 8.8.2 and the tags available on those items are being pushed in the SOLR as below: { &quot;description_t_en&quot;:&quot;Lorem Ipsum is simply dum&quot;, &quot;_templatename&quot;:&quot;Insights Detail Page&quot;, &quot;_creator&quot;:&quot;&quot;, &quot;sxatags_sm&quot;:[&quot;Gaming&quot;,&quot;Managed Services&quot;], &quot;_language&quot;:&quot;en&quot;, &quot;authored_date_tdt&quot;:&quot;2022-05-21T00:00:00Z&quot;, &quot;_uniqueid&quot;:&quot;sitecore://master/{c8921b82-10c5...&quot; } Now, due to some custom requirements, I want to map the Solr field sxatags_sm into my model as below: [IndexField(&quot;sxatags_sm&quot;)] [DataMember] [TypeConverter(typeof(IndexFieldEnumerableConverter))] public virtual IEnumerable<string> TaggedIndustryAndServices { get; set; } But I am not getting these values in my model. Any idea why is this so?
I solved this issue by performing below steps: Copy <sitecore_root>\bin\Sitecore.Commerce.Connect.Collection.Model.dll file to your <xConnect_root>\bin folder. Copy <sitecore_root>\XConnectFiles\Configs\sc.XConnect.Collection.Model.Commerce.Plugins.xml file to <xConnect_root>\App_Data\Config\Sitecore\Collection folder. Copy <sitecore_root>\XConnectFiles\Configs\sc.XConnect.Segmentation.Commerce.Predicates.xml file to <xConnect_root>\App_Data\jobs\continuous\AutomationEngine\App_Data\Config\sitecore\Segmentation folder. Navigate to the Sitecore Experience Commerce installation package. You can download it from here. Copy the files from the Sitecore Commerce Marketing Automation for AutomationEngine 14.0.27.zip archive to your Marketing Automation folder (<xConnect_root>\App_Data\jobs\continuous\AutomationEngine). Please make sure to follow the same folders structure as in the zip archive. You may also need to restart the Marketing Automation engine service after that. After Marketing Automation restart, new enrolled contacts were not getting stuck in MA workflow, and no errors in the logs.
Abandoned cart marketing automation campaign not working We are using OOTB abandoned cart marketing automation campaign for our Experience Commerce(XC) based website. Already installed the Abandoned Cart Campaign Site Setup module for our site node in the content editor and deployed all the marketing definitions. We have created and activated an email in the site-specific EXM editor using the abandoned cart email template and assigned this email in the marketing automation. Now, on our website, when a user logs in and adds a sellable item to the cart and leaves the page, We can see marketing automation workflow gets triggered but contacts are getting stuck at the custom listener step (where the contact's cart has been manipulated) as shown in the screenshot. These are the error from the logs: [Error] An error occurred during activity invocation for activity '622086f9-cba2-8b7c-cac0-3721340e0319' in plan '6624497c-e642-4d86-b106-befb12532ef9' DescriptorId : 47134e14-c9ff-4c9a-816d-7cfd92e7616d Sitecore.XConnect.Segmentation.ExpressionBuilder.PredicateDescriptorException: No predicate descriptor was registered with Id '47134e14-c9ff-4c9a-816d-7cfd92e7616d'. I checked the predicate ID which is mentioned in the logs 47134e14-c9ff-4c9a-816d-7cfd92e7616d is already available in content editor: Any help is much appreciated.
This is as per your requirement, if you want caching globally then you can apply cache on rendering level but if you want caching to be applied on your site level only then you can have caching on site level only. For ex - If you have 2 sites - Site A and Site B, so let's suppose you want header rendering to be cached Site level only then in this case apply caching on Site level using following - Navigate to sitecore/<tenant>/<site>/Presentation/Cache Settings and on the Home tab, click Component Cache Settings. Enter a name for the setting and click OK. In the Select Items dialog box, navigate to Layout/Renderings/Feature/Experience Accelerator, click the renderings for which you want this setting to apply, and use the arrow to move them to the Selected field. In the Caching section, select the caching options: Publish the task. And you want CTA rendering to be cached globally then in this case apply caching on globally using following - To set caching options for a rendering globally: Navigate to sitecore/Layout/Renderings/Feature/Experience Accelerator and click the relevant rendering. In the Caching section, select the caching options for the navigation rendering to help improve website performance:
Sitecore cache in sxa I am already using Sitecore cache in SXA. I am using it on site level. My question is if we have Sitecore cache on site level, do we need to add it on rendering level in Sitecore SXA? I am using the below link for Sitecore cache :- https://doc.sitecore.com/xp/en/developers/sxa/17/sitecore-experience-accelerator/set-sxa-caching-options.html#:~:text=Caching%20to%20improve%20performance.,a%20large%20amount%20of%20items.
After analyzing data from a period of time where there was an issue with slow /identity/externallogincallback requests. Based on the Availability and performance section in the Azure portal, I see slow requests to /identity/externallogincallback gone after a few days (approx 7 days): Also, I see 3 5xx errors during this period, most likely these errors are related to /identity/externallogincallback request timeout: After that verified the Master DB DTU and it was returning 100% spikes all time so I have increased it to 50 DTU. Hope it helps to analyze the issue if someone faced the same.
After Login on Sitecore CMS does not redirect to Content Editor and throws error 500 - The request timed out I have deployed our Application on PROD CM and CD instance on the Azure PAAS and the instance is working fine. When I try to log in to the CM instance, I can log in, but instead of redirecting me to the Sitecore Content Editor it's throwing me an error 500 - The request timed out. The webserver failed to respond within the specified time. After logging into the CM site, the following error is displayed: 500 - The request timed out. The web server failed to respond within the specified time After login into the CM instance: I have verified the AllowedCorsOrigins and Redirect URL in the identity server and CM instance in both Sitecore.IdentityServer.Host.xml and Sitecore.Owin.Authentication.IdentityServer.config respective files and all are correct. The same code and deployment work perfectly with the Pre-PROD environment on the Azure PAAS. Sitecore Version 10.2
After copying Start.ps1 from solr-init locally, I changed it as follows: param( [Parameter(Mandatory)] [string]$SitecoreSolrConnectionString, [Parameter(Mandatory)] [string]$SolrSitecoreConfigsetSuffixName, [Parameter(Mandatory)] [string]$SolrCorePrefix, [Parameter(Mandatory)] [string]$SolrReplicationFactor, [Parameter(Mandatory)] [int]$SolrNumberOfShards, [Parameter(Mandatory)] [int]$SolrMaxShardsPerNodes, [string]$SolrXdbSchemaFile, [string]$SolrCollectionsToDeploy ) function GetCoreNames { param ( [ValidateSet(&quot;sitecore&quot;, &quot;xdb&quot;)] [string]$CoreType, [string]$SolrCollectionsToDeploy, [string] $SolrCorePrefix, [string[]]$solrCollections ) $resultCoreNames = @() $SolrCollectionsToDeploy.Split(',') | ForEach-Object { $solrCollectionToDeploy = $_ Get-ChildItem C:\data -Filter &quot;cores*$solrCollectionToDeploy.json&quot; | ForEach-Object { $coreNames = (Get-Content $_.FullName | Out-String | ConvertFrom-Json).$CoreType if ($coreNames) { foreach ($solrCoreName in $coreNames) { if (($solrCollections -notcontains ('{0}{1}' -f $SolrCorePrefix, $solrCoreName))) { $resultCoreNames += $solrCoreName } } } } } return $resultCoreNames } . .\Get-SolrCredential.ps1 $solrContext = .\Parse-ConnectionString.ps1 -SitecoreSolrConnectionString $SitecoreSolrConnectionString $SolrEndpoint = $solrContext.SolrEndpoint $env:SOLR_USERNAME = $solrContext.SolrUsername $env:SOLR_PASSWORD = $solrContext.SolrPassword $solrCollections = (Invoke-RestMethod -Uri &quot;$SolrEndpoint/admin/collections? action=LIST&amp;omitHeader=true&quot; -Method Get -Credential (Get- SolrCredential)).collections $solrSitecoreCoreNames = GetCoreNames -CoreType &quot;sitecore&quot; -SolrCollectionsToDeploy $SolrCollectionsToDeploy $SolrCorePrefix $solrCollections $solrXdbCoreNames = GetCoreNames -CoreType &quot;xdb&quot; -SolrCollectionsToDeploy $SolrCollectionsToDeploy $SolrCorePrefix $solrCollections $solrConfigDir = &quot;C:\temp\sitecore_content_config&quot; $solrBaseConfigDir = &quot;C:\temp\default&quot; .\Download-SolrConfig.ps1 -SolrEndpoint $SolrEndpoint -OutPath $solrBaseConfigDir .\Patch-SolrConfig.ps1 -SolrConfigPath $solrBaseConfigDir -XsltPath &quot;C:\data\xslt&quot; -OutputPath $solrConfigDir $collectionAliases = $null if(Test-Path -Path &quot;C:\data\aliases.json&quot;) { $collectionAliases = ((Get-Content C:\data\aliases.json | Out-String | ConvertFrom-Json).aliases) } if ($solrSitecoreCoreNames) { $solrBaseConfigsetName = $null foreach ($solrCoreName in $solrSitecoreCoreNames) { $solrConfigsetName = ('{0}{1}{2}' -f $SolrCorePrefix, $solrCoreName, $SolrSitecoreConfigsetSuffixName) if ([string]::IsNullOrEmpty($solrBaseConfigsetName)) { .\New-SolrConfig.ps1 -SolrEndpoint $SolrEndpoint -SolrConfigName $solrConfigsetName -SolrConfigDir $solrConfigDir $solrBaseConfigsetName = $solrConfigsetName } else { .\Copy-SolrConfig.ps1 -SolrEndpoint $SolrEndpoint -SolrConfigName $solrConfigsetName -SolrBaseConfigName $solrBaseConfigsetName } .\New-SolrCore.ps1 -SolrCoreNames $solrCoreName -SolrEndpoint $SolrEndpoint -SolrCorePrefix $SolrCorePrefix -SolrConfigsetName $solrConfigsetName -SolrReplicationFactor $SolrReplicationFactor -SolrNumberOfShards $SolrNumberOfShards -SolrMaxShardNumberPerNode $SolrMaxShardsPerNodes } } if($solrXdbCoreNames) { foreach ($solrCoreName in $solrXdbCoreNames) { $SolrXdbConfigsetName = ('{0}{1}{2}' -f $SolrCorePrefix, $solrCoreName, $SolrSitecoreConfigsetSuffixName) $SolrCollectionName = ('{0}{1}' -f $SolrCorePrefix, $solrCoreName) if($solrconfigs -notcontains $SolrXdbConfigsetName) { .\Copy-SolrConfig.ps1 -SolrEndpoint $SolrEndpoint -SolrConfigName $SolrXdbConfigsetName } .\New-SolrCore.ps1 -SolrCoreNames $solrCoreName -SolrEndpoint $SolrEndpoint -SolrCorePrefix $SolrCorePrefix -SolrConfigsetName $SolrXdbConfigsetName -SolrReplicationFactor $SolrReplicationFactor - SolrNumberOfShards $SolrNumberOfShards -SolrMaxShardNumberPerNode $SolrMaxShardsPerNodes -SolrCollectionAliases $collectionAliases .\Update-Schema.ps1 -SolrCollectionName $SolrCollectionName -SolrEndpoint $SolrEndpoint -SchemaPath $SolrXdbSchemaFile } } In this way, the PowerShell script could be used to create only the cores not present in Solr. To apply the change and replace the old Start.ps1 file, I had to change the DockerFile related to the solr-init build as follows: # escape = ` IMAGE_BASE ARG FROM $ {BASE_IMAGE} SHELL [&quot;powershell&quot;, &quot;-Command&quot;, &quot;$ ErrorActionPreference = 'Stop'; $ ProgressPreference = 'Continue silently';&quot;] COPY Start.ps1 C:\Start.ps1 COPY my-new-cores.json C:\data\my-new-cores.json At this point it is sufficient to execute the build of solr-init image in the CI pipeline and that's it
How to deploy Solr new custom cores in an AKS environment via Azure DevOps Regarding the following article: https://www.koenheye.be/running-a-container-to-check-its-contents/ it is possible to create custom cores in the Solr docker container by configuring a specific json file. This happens at T0, through the build of the solr-init image which executes a PowerShell script (Start.ps1) that takes care of creating the cores specified in the JSON file. In order to have Continuous Integration (CI) and Continuous Deployment (CD) processes where it is possible to add other cores, a new build of solr-init would fail, because the JSON file contains cores already present in Solr. What would be the best approach to add new Solr cores via DevOps?
Use the following code to access the multilist field from datasource... {{ for contentItem in (sc_followmany i_item &quot;Item List&quot;) }}
Facing error with SXA scriban template I am trying to access the multilist field from datasource in scriban template and getting the following error. The code snippet is given below, <div class=&quot;row-section&quot;> {{ for contentItem in (sc_follow i_item &quot;Item List&quot;) }} {{ contentType=(sc_follow contentItem 'Content Section') }} <div class=&quot;slider &quot;> <div class=&quot;content bar&quot;> <div class=&quot;image-wrapper&quot;> <div class=&quot;card-types&quot;> <p class=&quot;card-type&quot; card-type=&quot;{{contentType.Name}}&quot;>{{contentType.Name}}</p> </div> </div> </div> </div> {{ end }} </div> </div></div> {{ end }}
This feature won't support on Sitecore 9.x version and this feature will be supported on Sitecore 10.x version only. If you would like to use this feature please upgrade Sitecore 10.X. I had raised a Sitecore support ticket and they confirmed this product bug on Sitecore 9.x version. For more information please find below the Sitecore support Ticket case number (CS0300419).
Unable to hide/disable Config file from sitecore I want disable couple of config files using patch file or edit layer.config file.Have included below peace of lines of code to disable file. I can disable specific config by adding .disable/example to config but i dont want to each and every config to disable. am looking for single patch config file to disable config. <add path=&quot;Sitecore.Marketing.Definitions.MarketingAssets.Repositories.Solr.Index.Master.config&quot; type=&quot;File&quot; mode=&quot;Off&quot; /> <add path=&quot;Sitecore.Marketing.Definitions.MarketingAssets.Repositories.Solr.Index.Web.config&quot; type=&quot;File&quot; mode=&quot;Off&quot; /> Eventually above piece code not working , could some suggest how i can disable config files.
You can try below things to improve performance of page: Use Dianoga tool for optimize images, you can read more about it on this link. You can use jQuery lazy loader plugin. Apply Sitecore cache on component. Set height and width parameters on image. You can refer this link as well to get more information Get Optimized Image in sitecore
Is it possible to preload an image for the hero banner in Sitecore to improve LCP? We are trying to improve the LCP score of our site and one of the elements we want to optimize is the large image used in the hero banner of each page. Is there a way to set this image to be preloaded?
Try this. Downloaded nuget.exe, manually using this https://dist.nuget.org/win-x86-commandline/v5.6.0/nuget.exe Create an empty folder as Nuget under C:\Program Files. ex. -- C:\Program Files\Nuget Copy the nuget.exe to C:\Program Files\Nuget\ Comment this line in Dockerfile, available in ROOT_PROJECT\docker\build\dotnetsdk\Dockerfile ## RUN `Invoke-WebRequest &quot;https://dist.nuget.org/win-x86-commandline/v5.6.0/nuget.exe&quot; -UseBasicParsing -OutFile &quot;$env:ProgramFiles\NuGet\nuget.exe&quot;` Afterwards run .\up.ps1 again Hope this will solve your issue. Thanks
Error while installing Sitecore 10.2 xp0 in docker while running docker-compose up -d I am trying to set up Sitecore 10.2 xp0 in docker but I am getting error when I run the command docker-compose up -d Below is the error I get- Please let me know how can this be fixed. Step 7/11 : RUN Invoke-WebRequest &quot;https://dist.nuget.org/win-x86-commandline/v$env:NUGET_VERSION/nuget.exe&quot; -UseBasicParsing -OutFile &quot;$env:ProgramFiles\NuGet\nuget.exe&quot; ---> Running in 4a20f6fbca6c Invoke-WebRequest : The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. At line:1 char:76 + ... yContinue'; Invoke-WebRequest https://dist.nuget.org/win-x86-commandl ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:Htt pWebRequest) [Invoke-WebRequest], WebException + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShe ll.Commands.InvokeWebRequestCommand
To create an apiController you need to follow next steps 1 . Create a class which inherits from ApiController public class PersonApiController : ApiController You need to create your method which represent api call : [System.Web.Http.HttpGet] [Route(&quot;getvcard/{itemIdString}&quot;)] public HttpResponseMessage GetItemInformation(string itemIdString) You need to register the ApiController public class Register : IServicesConfigurator { public void Configure(IServiceCollection serviceCollection) { serviceCollection.Replace(ServiceDescriptor.Transient(typeof(PersonApiController), typeof(PersonApiController))); } } You need to register in the configuration : <configuration xmlns:patch=&quot;http://www.sitecore.net/xmlconfig/&quot;> <sitecore> <services> <configurator type=&quot;yourNameSpace.ServicesConfigurator,yourNamespace&quot; /> </services> </sitecore> </configuration> To call the api you need to call it in this way https://yourhostname/getvarcad/itemid
Create API controller in sitecore I am using Sitecore 10 and trying to implement an API controller, but I got this issue when calling API in postman https://{mydomain}/saveform { &quot;Message&quot;: &quot;An error has occurred.&quot;, &quot;ExceptionMessage&quot;: &quot;Multiple actions were found that match the request: \r\nSaveForm on type ATLP.Feature.SaveSitecoreForm.Controllers.SaveSitecoreFormController\r\nSaveForm on type ATLP.Feature.SaveSitecoreForm.Controllers.SaveSitecoreFormController&quot;, &quot;ExceptionType&quot;: &quot;System.InvalidOperationException&quot;, &quot;StackTrace&quot;: &quot; at System.Web.Http.Controllers.ApiControllerActionSelector.ActionSelectorCacheItem.SelectAction(HttpControllerContext controllerContext)\r\n at System.Web.Http.ApiController.ExecuteAsync(HttpControllerContext controllerContext, CancellationToken cancellationToken)\r\n at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__15.MoveNext()&quot; } this my controller [ServicesController] [RequiredApiKey] public class SaveSitecoreFormController : ApiController { private SaveFormRepository _repository; public SaveSitecoreFormController() { _repository = new SaveFormRepository(); } [System.Web.Http.HttpPost] [Route(&quot;saveform&quot;)] public IHttpActionResult SaveForm([FromBody]SitecoreFormDataModel formData) { List<FormFieldDataModel> FormFieldList = new List<FormFieldDataModel>(); if (formData == null) { return BadRequest (&quot;Missing form data&quot;); } else { var formId = formData.data.Where(f => f.key.Contains(&quot;FormItemId&quot;)).FirstOrDefault(); Guid formGuid = new Guid(formId.value); var formEmailData = formData.data.Where(f => f.key.Contains(&quot;Email&quot;)).FirstOrDefault(); if (formEmailData != null) { FormFieldDataModel emailFieldDataModel = new FormFieldDataModel { FormFieldName = formEmailData.key, FormFieldValue = formEmailData.value, FormFieldGuid = new Guid(&quot;{B026F347-0CEE-4FF0-B435-E4737B253BDA}&quot;) }; FormFieldList.Add(emailFieldDataModel); _repository.SaveFormData(formGuid, FormFieldList); } return Ok(&quot;Create CRM and Lead Objects Successful&quot;); } } } this serviceConfigurator class public class ServicesConfigurator : IServicesConfigurator { public void Configure(IServiceCollection serviceCollection) { serviceCollection.Replace(ServiceDescriptor.Transient(typeof(SaveSitecoreFormController), typeof(SaveSitecoreFormController))); } } and this config file <configuration xmlns:patch=&quot;http://www.sitecore.net/xmlconfig/&quot;> <sitecore> <services> <configurator type=&quot;ATLP.Feature.SaveSitecoreForm.Services.ServicesConfigurator, ATLP.Feature.SaveSitecoreForm&quot; /> </services> </sitecore> any ideas what is missing here?
When you run this command npm init sitecore-jss react it ask some option one of them is How would you like to fetch Layout and Dictionary data? it have two types (GraphQL and Rest) as shown in below screenshot. Please select Rest then it will start working because i think GraphQL doesn't supports in disconnected mode. I tried it and it's started working, please see below screenshot
New JSS app will not start: GraphQL requests to Dictionary and Layout services are not supported in disconnected mode I'm following along with Discover Sitecore's &quot;Build Your First JSS App&quot; video (https://www.youtube.com/watch?v=XNQGsr9_34A) and was only 2:10 in when I ran into my first issue. All I've done so far was install jss globally using the command npm install -g @sitecore-jss/sitecore-jss-cli and then I created a new jss app using this command npm init sitecore-jss react After cd to the new directory, I attempted to execute the command jss start when I got the errors indicated. > npm run start -- > [email protected] start > cross-env-shell JSS_MODE=disconnected &quot;npm-run-all --serial bootstrap --parallel start:react start:proxy start:watch-components&quot; > [email protected] bootstrap > cross-env-shell FETCH_WITH=GraphQL &quot;node scripts/bootstrap.js&quot; C:\Projects\jss-react\scripts\bootstrap.js:15 throw new Error( ^ Error: GraphQL requests to Dictionary and Layout services are not supported in disconnected mode. at Object.<anonymous> (C:\Projects\jss-react\scripts\bootstrap.js:15:9) at Module._compile (node:internal/modules/cjs/loader:1105:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12) at node:internal/main/run_main_module:17:47 node:events:505 throw er; // Unhandled 'error' event ^ Error: spawn node scripts\bootstrap.js ENOENT at notFoundError (C:\Projects\jss-react\node_modules\cross-spawn\lib\enoent.js:6:26) at verifyENOENT (C:\Projects\jss-react\node_modules\cross-spawn\lib\enoent.js:40:16) at ChildProcess.cp.emit (C:\Projects\jss-react\node_modules\cross-spawn\lib\enoent.js:27:25) at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12) Emitted 'error' event on ChildProcess instance at: at ChildProcess.cp.emit (C:\Projects\jss-react\node_modules\cross-spawn\lib\enoent.js:30:37) at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12) { code: 'ENOENT', errno: 'ENOENT', syscall: 'spawn node scripts\\bootstrap.js', path: 'node scripts\\bootstrap.js', spawnargs: [] } ERROR: &quot;bootstrap&quot; exited with 1. node:events:505 throw er; // Unhandled 'error' event ^ Error: spawn npm-run-all --serial bootstrap --parallel start:react start:proxy start:watch-components ENOENT at notFoundError (C:\Projects\jss-react\node_modules\cross-spawn\lib\enoent.js:6:26) at verifyENOENT (C:\Projects\jss-react\node_modules\cross-spawn\lib\enoent.js:40:16) at ChildProcess.cp.emit (C:\Projects\jss-react\node_modules\cross-spawn\lib\enoent.js:27:25) at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12) Emitted 'error' event on ChildProcess instance at: at ChildProcess.cp.emit (C:\Projects\jss-react\node_modules\cross-spawn\lib\enoent.js:30:37) at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12) { code: 'ENOENT', errno: 'ENOENT', syscall: 'spawn npm-run-all --serial bootstrap --parallel start:react start:proxy start:watch-components', path: 'npm-run-all --serial bootstrap --parallel start:react start:proxy start:watch-components', spawnargs: [] }
It's not quite clear what you are trying to share - browsable content or datasources, nor what you have tried already (and why that did not work as expected). For browsable content you could look at a delegated area. You can do this by going to the Configure tab, then Clone the item(s). SXA will then ask you whether you want to make the clone an SXA delegated area. In your site, you now need to go to the /Settings/Shared Site Settings in your SXA site, and add your clone to the Delegated Areas field. It is also possible to share presentation details or datasource items. You can do this by designating a site as shareable. On your SXA tenant, go to the Sharing section and add the site you want to be able to be shared to your Shared sites field.
How to resolve item from one site to another site in sitecore 10 SXA I have items on one site, want to display that item in multiple sites. So how to resolve that shared items in the current site. Template to page design mapping, header and footer should be assigned from the current site, not from the original site.
As @kamil mentioned, there was a notable Microsoft deprecation that recently came into full effect. The TLDR; is: WS-Trust authentication type that is used by custom clients to connect to Dataverse is deprecated. We are making this change to remove a security protocol (WS-Trust) that is inherently insecure by current encryption standards. Effective April 2022, the authentication protocol will be retired for all new and existing environments within a tenant. The retirement of new environments starts April 1, 2021 and rolls out gradually in all regions within a 6-week window. More info can be found here. Sitecore released fixes for this in Sitecore Connect for Microsoft Dynamics 365 for Sales 7.0.0 (release notes), and after speaking with Sitecore support, they provided a hotfix for version 4 (Hotfix 500295). Regarding hotfixes, the usual warning applies: The hotfix was built specifically for Sitecore Dynamics CRM connector 4.0 and you should not install it on other Sitecore versions or in combination with other hotfixes, unless explicitly instructed by Sitecore Support. For this hotfix, I would recommend manual installation rather automatically installing the .zip. After applying the hotfix, I was able to connect to the D365 instance with this connection string format: AuthType=ClientSecret;ClientId=xxxxxxx;ClientSecret=xxxxxxx;Url=https://ORG_NAME.api.crm.dynamics.com/; As far as I can tell, this is the best-practice method of connecting to an organization with 2FA/MFA enabled. See this Microsoft guide to learn more about best practices for authentication. After applying the hotfix, I did run into other connection string issues when running pipeline batches. I saw this error in the job logs: CRM ConnectionString cannot be null or empty. The way I fixed the issue was by creating a new tenant AFTER applying the hotfix. Regarding the log location of the connection troubleshooter errors, I can confirm that if you want to see the full stack trace, you must write your own Sitecore.DataExchange.Providers.DynamicsCrm.Endpoints.OrganizationEndpointTroubleshooter and specify it as the Troubleshooter type on the Dynamics Organization Endpoint item.
D365 Connector Connection Issues - Connection Strings & Log Location I am having trouble testing the connection to my remote instance of D365. I can access it via the browser at https://xxxxxxx.crm.dynamics.com This is a 9.3 install with DEF and D365 Connector version 4.0.0. I have tried various connection string formats, and each of them have received different error messages: <!-- Results in error: Metadata contains a reference that cannot be resolved: 'https://xxxxxxx.crm4.dynamics.com/XRMServices/2011/Organization.svc?wsdl&amp;sdkversion=9 --> <add name=&quot;Sitecore.DataExchange.Staging&quot; connectionString=&quot;AuthType=Office365;Url=https://xxxxxxx.crm4.dynamics.com;User id=xxxxxxx;Password=xxxxxxx&quot; /> <!-- Results in error: An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail --> <add name=&quot;Sitecore.DataExchange.Staging&quot; connectionString=&quot;AuthType=Office365;Url=https://xxxxxxx.crm.dynamics.com;Username=xxxxxxx;Password=xxxxxxx&quot; /> <!-- Results in error: The authentication endpoint Kerberos was not found on the configured Secure Token Service --> <add name=&quot;Sitecore.DataExchange.Staging&quot; connectionString=&quot;AuthType=AD;Url=https://xxxxxxx.crm.dynamics.com&quot; /> <!-- Results in error: An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail. --> <add name=&quot;Sitecore.DataExchange.Staging&quot; connectionString=&quot;Url=https://xxxxxxx.crm.dynamics.com;Username=xxxxxxx;Password=xxxxxxx&quot; /> <!-- Results in error: An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail. --> <add name=&quot;Sitecore.DataExchange.Staging&quot; connectionString=&quot;AuthType=Office365;Url=https://xxxxxxx.crm.dynamics.com;[email protected];Password=xxxxxxx&quot; /> <!-- Results in error: An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail. --> <add name=&quot;Sitecore.DataExchange.Staging&quot; connectionString=&quot;url=https://xxxxxxx.api.crm.dynamics.com/XRMServices/2011/Organization.svc; [email protected];password=xxxxxxx;organization=xxxxxxx;authentication type=2&quot; /> <!-- Results in error: Metadata contains a reference that cannot be resolved: 'https://xxxxxxx.dynamics.com/XRMServices/2011/Organization.svc?wsdl&amp;sdkversion=9 --> <add name=&quot;Sitecore.DataExchange.Staging&quot; connectionString=&quot;url=https://xxxxxxx.crm.dynamics.com/XRMServices/2011/Organization.svc?singleWsdl; userid=xxxxxxx;password=xxxxxxx;organization=xxxxxxx;authentication type=2&quot; /> I can connect to the D365 instance just fine using XrmToolBox. In fact, that's where I got the first connection string that I tried: AuthType=Office365;Url=https://xxxxxxxx.crm.dynamics.com;Username=xxxxxxxx;Password=xxxxxxxx What other connection string formats might work (assuming these errors aren't a result of permission/configuration issues)? I already tried the proposed solution here, but in my case xxxx.crm4.xxxx is not a valid endpoint. Where are these connection errors being logged to? So far I have looked in the following places: Event Viewer IIS logs Sitecore logs XConnect logs After decompiling the DLL that performs this check, it doesn't appear to do any logging. It just returns the result: troubleshooterResult = TroubleshooterResult.FailResult(string.Concat(&quot;Exception during connection. Read more in log file. &quot;, exception.Message), exception); return troubleshooterResult;