Quantcast
Channel: Optimizely Search & Navigation
Viewing all 6894 articles
Browse latest View live

Discount is not getting applied to price properties

$
0
0

Hi,

In a Commerce 11.8.5 project we have a custom FixedPrice promotion.

After orderGRoup.ApplyDiscounts() I can see the applied promo in orderGroup.Promotions, but lineItem.TryGetDiscountValue(d => d.EntryAmount) returns zero.

In short, the processor checks two separate contentRef lists and applies a reward for each pair from the two groups. Problem is that I can see the promotion info on the orderGroup but TryGetDiscountValue always return 0 so the discount isn't reflected in the totals.

Any ideas? I haven't been able to find anything missing regarding price entries, AffectedEntries, redemption descriptions, reward description or orderForm.Promotions.

// for each pair from the two group
                    var entry1 = new PriceEntry(lineItem1.PlacedPrice, 1, lineItem1);
                    var entry2 = new PriceEntry(lineItem2.PlacedPrice, 1, lineItem2);
                    entry1.Promotion = promotionData;
                    entry2.Promotion = promotionData;
                    var priceEntries = new List<PriceEntry>() { entry1, entry2 };
                    var affected = new AffectedEntries(priceEntries);
                    redemptions.Add(CreateRedemptionDescription(affected));
// After going through all pairs, return reward description
return new RewardDescription(fulfillmentStatus, redemptions, promotionData, fixedPrice * fulfilledQuantity, decimal.Zero, RewardType.FixedPrice, "Combo price");

Only sporadic indexing of content - ContentIndexer.Invisible?

$
0
0

We've been having big problems in our multi-server environment with the Find indexer not always indexing one or all properties of a document, or not at all. It seems to be isolated to the event based indexer, the scheduled job always indexes everything correctly. Trying to re-save the page multiple times some times helps, but most often not.

It's been working OK on the production and staging servers but the testing servers and the local development servers have been more or less impossible to work with, find-wise.

Find has given us no errors in the logs, and even a custom serialization trace writer more or less says everything is OK when it's not.

I finally tried to set ContentIndexer.Invisible to falseas per this answer on an old thread, and it seems to be working (still might be too early to tell but looks good so far). The docs say this setting forces the indexer to run in the shared event thread and not its own (it's true by default).

Does anybody know something about this and why it's happening and if it could be related to something else and not the thread setting? Can't seem to file a support ticket right now. Anyway it might help anyone else having weird indexing issues.

Problem with DOJO updating EpiServer edit mode

$
0
0

Hi,

I am having problem when creating new page in EpiServer edit mode. I saw that on creation of new page (before entering content), panes on the top, left and right are updating using DOJO and deffered objects. I have error which is displayed in console:

I inspected that code from Episerver Shell and found that error occurs if more notifications are received before the query resolves, in which case the observer can't be sure whether the query results are up to date with the subsequent notifications it has received (which I think it is the case, because it is sending separate queries for each pane). When query returns response (via resolving deffered object) it is checking revision of sent query and sometimes result for some query returns after revision number is incremented and it throws error.

Revision check:

if (++queryRevision != revision) {
   throw new Error("Query is out of date, you must observe() the query prior to any data modifications");
}

The error does not show in the Chrome console when I am debugging using Chrome Developer tools, because all responses are returned synchronized. Tried changing sub-version of EpiServer, but each sub-version of version 11 throws error when not in debug mode.

Thanks in advance.

Generation of URL segment for content

$
0
0

Hello

When a page is created an URL is auto-generated that changes ø to o. Is there any way to change this behaviour so that ø becomes oe?

Thanks in advance.

Regards,
Benjamin

Dragging Blocks into Rich Text Editor - Rendering Issue

$
0
0

Hi

As per the article below 

https://webhelp.episerver.com/latest/en/platform/blocks.htm

We can drag blocks into Rich text editors.

In our site it allows us to drag the block (screenshot above) but it does not render on the site.

It just shows the name of the block

We are using Html.Raw to dispaly the rich text content in the razor view.

Could someone please assist.

Regards

Sandeep

A Question

$
0
0

Hi 

Is it possible to generate a list of all the files stored in the VPP?

I need all the files in all the directories > even the sub directories that contain sub directories etc not just the first level.

Is this possible in C#?

Support SVG files in edit UI

$
0
0

Inserting svg files in properties marked with UI hunt "Image" makes an nullref error in the logs, and the image looks broken to the editor. Ref: https://support.episerver.com/hc/en-us/requests/291373

SVG files are sometimes the preferred format when displaying logos and such, so this should be supported. It's easy to get thumbnails in the asset pane to show up for SVGs, but the image property itself lacks this support.

ContentArea contains an invisible, deleted block. How to clean up?

$
0
0

I've had some issues with a block failing with a NullReferenceException for a while now. After a lot of debugging I was finally able to trace the reason to a deleted block that is still referenced in one of the ContentAreas. It's not visible from anywhere, including All Properties, but looking in the database I found it there among all the other valid contents of that particular ContentArea:

<div data-classid="..." data-contentgroup=""
    data-contentguid="X" data-contentname="[some name, valid]">{}</div><div data-classid="..." data-contentgroup=""
    data-contentguid="Y" data-contentname="[some name, seemingly valid]">{}</div><div data-classid="..." data-contentgroup=""
    data-contentguid="Z" data-contentname="[some name, valid]">{}</div>

(this is from the LongString column in tblContent for the ContentArea property on the parent block)

Looking up all the contentguids, I found everyone but "Y".

So my question is; how do I clean this up? Of course I could probably just edit this row in the database directly, and that's fine for dev, but for a production environment it involves a fair amount of red tape I'd prefer to avoid if possible.

And if anyone has any theories on how this could happen in the first place, I'd love to hear them.


Custom AvailableContentTypes attribute

$
0
0

Does anyone know if we can create a custom attribute to show/hide a page type that depends on a custom condition? I would like to have an attribute like:

[CustomAvailableContentType]
public class ProductPage : StandardPage, IHasRelatedContent
{
}


Connection strings defined in Azure Portal are still not picked up

$
0
0

Hello

I did just now deploy an Alloy site to Azure (with version: ) and I still neeeded the appsetting to make it read from the portal instead of the config file.

With a release note for this bug (that I reported) it says that it could not be fixed without a breaking change, but that was in version 8 so there has been two breaking after that so I thought it had been fixed. (I also heard from another developer that it was the same in version 11).

https://world.episerver.com/documentation/Release-Notes/ReleaseNote/?releaseNoteId=122518

Is this still the case, that you need to use this appsettings, and will you fix so you won't use it?

I do not want to save passwords in the transformation file, instead use the config tab in Azure

SeoUriRouter is obsolete

$
0
0

Hi,

In our project we have a class SimpleAddressRouteHandler which overrides SeoUriRouter to set custom market and language.

But after upgrading to Commerce v13, SeoUriRouter has become obsolete. What is the recommended way to replace SeoUriRouter? I can't find any information about it.

Thanks in advance!

Bart

 [ServiceConfiguration(ServiceType = typeof(ISimpleAddressRouteHandler), Lifecycle = ServiceInstanceScope.Singleton)]
    public class SimpleAddressRouteHandler : SeoUriRouter
    {
        [NonSerialized]
        private static readonly ILogger _log = LogManager.GetLogger(typeof(SimpleAddressRouteHandler));
        private readonly IMarketService _marketService;
        private readonly ICurrentMarket _currentMarket;
        public SimpleAddressRouteHandler(PartialRouteHandler partialRouteHandler, IContentLoader contentLoader, ReferenceConverter referenceConverter, IContentVersionRepository contentVersionRepository, ICatalogSystem catalogSystem, IMarketService marketService, ICurrentMarket currentMarket) 
            : base(partialRouteHandler, contentLoader, referenceConverter, contentVersionRepository, catalogSystem)
        {
            _marketService = marketService;
            _currentMarket = currentMarket;
        }
        /// <summary>
		/// Tries to handle a segment value as a simple address.
		/// </summary>
		/// <param name="urlSegment">The simple address</param>
		/// <param name="routeRoot">The route root</param>
		/// <param name="segmentContext">The segment context</param>
		/// <returns><c><see cref="T:EPiServer.Web.Routing.Segments.SimpleAddressRouteValues" /></c> if <paramref name="urlSegment" /> was handled, otherwise <c>null</c></returns>
		public override SimpleAddressRouteValues GetRouteValues(string urlSegment, ContentReference routeRoot, SegmentContext segmentContext)
        {
            SimpleAddressRouteHandler._log.DebugBeginMethod("GetRouteValues", new object[]
            {
                urlSegment,
                routeRoot,
                segmentContext
            });
            //strip software part from the url again
            if (urlSegment.StartsWith("software/", StringComparison.InvariantCultureIgnoreCase)) 
            {
                urlSegment = urlSegment.Substring("software/".Length);
            }
            //strip software part from the url again
            if (urlSegment.StartsWith("trainingen/", StringComparison.InvariantCultureIgnoreCase))
            {
                urlSegment = urlSegment.Substring("trainingen/".Length);
            }
            ProcessLanguageAndMarketSegment(ref urlSegment, segmentContext);
            if (urlSegment == null) return null;
            return base.GetRouteValues(urlSegment, routeRoot, segmentContext);
        }
        public void ProcessLanguageAndMarketSegment(ref string urlSegment, SegmentContext segmentContext)
        {
            //Check LanguageMarket segment
            if (urlSegment.Contains("/"))
            {
                var firstSegment = urlSegment.Split('/')[0]; //First index shouldbe our languageAndMarketSegment
                //Our segment is always {TwoLetterIsoCode}-{MarketCode}, therefor segment[2] should always be "-"
                if (firstSegment.Length >= 3 && firstSegment[2] == '-')
                {
                    var segmentParts = firstSegment.Split('-');
                    //is the last part a valid marketCode
                    var languagePart = segmentParts[0];
                    var marketPart = segmentParts[1];
                    var validMarket = MarketConstants.UrlToMarketMappings.ContainsKey(marketPart);
                    if (validMarket)
                    {
                        //Set market
                        var marketCode = MarketConstants.UrlToMarketMappings[marketPart];
                        var marketId = new MarketId(marketCode);
                        _currentMarket.SetCurrentMarket(marketId);
                        //Set language
                        var market = _marketService.GetMarket(marketId);
                        var language = market.Languages.FirstOrDefault(x => x.TwoLetterISOLanguageName == languagePart);
                        if (language == null)
                        {
                            urlSegment = null;
                            return;
                        }
                        segmentContext.Language = language.ToString();
                        //Finally strip language and market segment from url
                        urlSegment = urlSegment.Substring(urlSegment.IndexOf('/') + 1);
                    }
                }
            }
        }
    }

Orderby noderelation sortorder

$
0
0

Hi

Is it possible to get results (products) ordered by a specific noderelation sort order?

extra question that might solve alot ... are NodeEntryRelations mapped to find? 

Getting RemovedDueToInvalidPrice error

$
0
0

While adding cart to cart service, I have validation from OrderValidationService.ValidateOrder and I am getting RemovedDueToInvalidPrice  error (Item has been removed due to invalid price.). I have set AUD100 to variant price.

Adding option for users to register and login to my website

$
0
0

I'm developing a website on soccer players in Episerver and I want my visitor to register (preferably in the future with Facebook, Google or Microsoft), login and manage a watchlist of their favorite players on my website. After reading a few docs I have four solutions to go for;

  • EPiServerProfile; this gives me a head start, still I don't know if I can ever use social logins?
  • Epi server commerce; this seems like overfitting the problem. I don't intent to sell anything. But maybe feature complete?
  • Use EPiServer.Cms.UI.AspNetIdentity; this allready got my cms account it so why not use this?
  • Build everthing custom and try to manage users; I like to do this but would take me along time and I want to manage the users in Epi server (Maybe descend from PageData?)

I'm a bit new to episerver so who is whiling to rate my solutions? 

Error saving any page after .Net Framework update and using VS2019 - EPiServer.DataAccess.SaveAction

$
0
0

Error saving any page after .Net Framework update and using VS2019. This error does not happen on our previous version of .Net Framework using VS2019.

Server Error in '/' Application.

The parameters dictionary contains a null entry for parameter 'action' of non-nullable type 'EPiServer.DataAccess.SaveAction' for method 'System.Web.Mvc.ActionResult ChangeStatus(EPiServer.Core.ContentReference, EPiServer.DataAccess.SaveAction)' in 'EPiServer.Cms.Shell.UI.Rest.Internal.ContentDataStore'. An optional parameter must be a reference type, a nullable type, or be declared as an optional parameter.
Parameter name: parameters

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.ArgumentException: The parameters dictionary contains a null entry for parameter 'action' of non-nullable type 'EPiServer.DataAccess.SaveAction' for method 'System.Web.Mvc.ActionResult ChangeStatus(EPiServer.Core.ContentReference, EPiServer.DataAccess.SaveAction)' in 'EPiServer.Cms.Shell.UI.Rest.Internal.ContentDataStore'. An optional parameter must be a reference type, a nullable type, or be declared as an optional parameter.
Parameter name: parameters

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace: 

 

[ArgumentException: The parameters dictionary contains a null entry for parameter 'action' of non-nullable type 'EPiServer.DataAccess.SaveAction' for method 'System.Web.Mvc.ActionResult ChangeStatus(EPiServer.Core.ContentReference, EPiServer.DataAccess.SaveAction)' in 'EPiServer.Cms.Shell.UI.Rest.Internal.ContentDataStore'. An optional parameter must be a reference type, a nullable type, or be declared as an optional parameter.

Parameter name: parameters]

   System.Web.Mvc.ActionDescriptor.ExtractParameterFromDictionary(ParameterInfo parameterInfo, IDictionary`2 parameters, MethodInfo methodInfo) +430

   System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +111

   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +35

   System.Web.Mvc.Async.<>c.<BeginInvokeSynchronousActionMethod>b__9_0(IAsyncResult asyncResult, ActionInvocation innerInvokeState) +39

   System.Web.Mvc.Async.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult) +70

   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +42

   System.Web.Mvc.Async.<>c__DisplayClass11_0.<InvokeActionMethodFilterAsynchronouslyRecursive>b__0() +80

   System.Web.Mvc.Async.<>c__DisplayClass11_2.<InvokeActionMethodFilterAsynchronouslyRecursive>b__2() +387

   System.Web.Mvc.Async.<>c__DisplayClass11_2.<InvokeActionMethodFilterAsynchronouslyRecursive>b__2() +387

   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +42

   System.Web.Mvc.Async.<>c__DisplayClass3_6.<BeginInvokeAction>b__4() +50

   System.Web.Mvc.Async.<>c__DisplayClass3_1.<BeginInvokeAction>b__1(IAsyncResult asyncResult) +188

   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +38

   EPiServer.Shell.Services.Rest.RestControllerBase.EndExecute(IAsyncResult asyncResult) +60

   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +648

   System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +213

   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +131

 

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.3282.0


How to create new menu category under CMS=>Admin

$
0
0

Hello,

I have a requirement to create new menu category under CMS => Admin section.

Below is the existing out-of-box menu

1) Access Rigths

2) Scheduled Jobs

3) Tools

So i need to create new category to above existing structure like, under this new category i'll create multiple .aspx pages as per my need.

4) Employee Management

I have tried to use below attribute but it is creating under "Tools" category.

[GuiPlugIn(
Area = PlugInArea.AdminMenu,
Description = "User Login",
Category = "Employee Management",
DisplayName = "User Login",
Url = "~/Employee/UserLogin.aspx",
SortIndex = 1020)]

Can someone help on this?

Thanks,

Suresh Bodapothula

EPiServer.Forms.Samples Resources Returning 404

$
0
0

Hello,

I'm trying to install the EPiServer.Forms.Samples package in order to use Google reCAPTCHA. However when I add the form element to a form and try to load the page, several of the resources needed to render the reCAPTCHA element return a 404:

http://localhost/util/EPiServer.Forms.Samples/ClientResources/ViewMode/jquery-ui.min.css net::ERR_ABORTED 404 (Not Found)
http://localhost/util/EPiServer.Forms.Samples/ClientResources/ViewMode/EPiServerFormsSamples.js net::ERR_ABORTED 404 (Not Found)
http://localhost/util/EPiServer.Forms.Samples/ClientResources/ViewMode/RecaptchaElementBlock.js net::ERR_ABORTED 404 (Not Found)
http://localhost/util/EPiServer.Forms.Samples/ClientResources/ViewMode/EPiServerFormsSamples.css net::ERR_ABORTED 404 (Not Found)
http://localhost/util/EPiServer.Forms.Samples/ClientResources/ViewMode/jquery-ui.modified.js net::ERR_ABORTED 404 (Not Found)
http://localhost/util/EPiServer.Forms.Samples/ClientResources/ViewMode/jquery-ui.structure.min.css net::ERR_ABORTED 404 (Not Found)
http://localhost/util/EPiServer.Forms.Samples/ClientResources/ViewMode/jquery-ui.theme.min.css net::ERR_ABORTED 404 (Not Found)

I found a similar thread (https://world.episerver.com/forum/developer-forum/episerver-forms/thread-container/2018/4/episerver-forms-samples-clientresources-returning-404/#190210), but this guys solution doesn't seem to work for me.

Any help or direction would be greatly appreciated.

Block to Commerce Catalog or Product Relationship Defect

$
0
0

Hello Guys,

We believe there is a known issue with commerce catalog and content block. But I cant find the defect being raised anywhere. If you create a content block and use it in Commerce page Content Area. The block does not show the relationship between the block and commerce catalog. 

Here are the steps to reproduce.

1. Create block 
2. Drop the block on a commerce page (product or node) 
3. Publish the product or node 
4. Go to edit the block

Actual Result: It says "This item is not used anywhere."

Expected Result: It should say "This item is used in 1 place" with a link to the catalog.

Does anyone know link to the defect or you guys thinking, this is not a defect and I am doing something wrong?

Regards, 
Sujit

Support hosting a DXC site in multiple regions

$
0
0

Right now, when launching a DXC site, we can select a single Azure region for hosting websites. This cannot be changed afterwards.

But for sites with very global reach, it would be very nice to be able to deploy the DXC web apps in multiple Azure regions.

I know that Cloudflare supports load balancing based on regions. And this would make it possible to transparently serve visitors in different parts of the world from data centers closer to them.

Any plans to introduce such option?

Forms submission gives error 500

$
0
0

Using Episerver.Forms 4.24.1 and episerver.CMS 11.10.4 (had same problem back in time when started with Forms 4.15.1 and CMS 11.4.3)

Our intranet site is mostly giving "error 500: Internal Server Error" when posting a form.

Error in log shows: 

ERROR EPiServer.Global: Unhandled exception in ASP.NET
EPiServer.Core.EPiServerException: ContentReference: Input string was not in a correct format.
at EPiServer.Core.ContentReference.Parse(String s)
at EPiServer.Core.ContentReference..ctor(String complexReference)
at EPiServer.Forms.Core.Internal.DataSubmissionService.GetValidatableElementsData(NameValueCollection validationData, Submission submissionDataFullForm)
at EPiServer.Forms.Core.Internal.DataSubmissionService.PerformDataSubmit(NameValueCollection rawSubmittedData, HttpContextBase httpContext, ControllerBase controller)
at EPiServer.Forms.Controllers.DataSubmitController.Submit()
at lambda_method(Closure , ControllerBase , Object[] )
at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass15.<InvokeActionMethodWithFilters>b__12()
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation)
at System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName)
at System.Web.Mvc.Controller.ExecuteCore()
at System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext)
at EPiServer.Forms.Controllers.FormsMvcHandler.ProcessController(IController controller)
at EPiServer.Forms.Controllers.FormsMvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state)
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)

Our intranet is using windows authentication, and users is automatically authenticated.

Web.config contains: <authentication mode="Windows">

IIS is set up with Authentication: "Windows Authentication" and "Anonymous Authentication" enabled

Access rights is set up like this

Have a guest group (ip criterion) that can access the site without login, an other site on server whith the IP is getting RSS feed from this site.

The strange is that a way around the error is (only sometimes) refresh the page by puttig cursor in address line and press enter. Refreshing by pressing F5 or refresh icon does not work.

From time to time we also get following error in logg, and the same "error 500: Internal Server Error" on page

ERROR EPiServer.Forms.Internal.Security.DefaultAntiForgeryValidator: Failed to validate the anti-forgery token
System.Web.Mvc.HttpAntiForgeryException (0x80004005): The provided anti-forgery token was meant for user "DOMAINNAME\username", but the current user is "".
at System.Web.Helpers.AntiXsrf.TokenValidator.ValidateTokens(HttpContextBase httpContext, IIdentity identity, AntiForgeryToken sessionToken, AntiForgeryToken fieldToken)
at System.Web.Helpers.AntiXsrf.AntiForgeryWorker.Validate(HttpContextBase httpContext, String cookieToken, String formToken)
at EPiServer.Forms.Internal.Security.DefaultAntiForgeryValidator.Validate(HttpContextBase httpContext)

and at the same time showing the icon for entering editmode on page.

Viewing all 6894 articles
Browse latest View live