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

what does ecf_LineItem_Update do in episerver?.

$
0
0

what does ecf_LineItem_Update do in episerver?. Does it update it update price and Total price for the cart?


A lot of exceptions in Azure App Insights

$
0
0

Hi everyone, we have an Epi site with CMS 11.15.0 and Commerce 13.18.2, hosted in an Azure appservice. It is registering a lot of exceptions in Azure Insights, and we just don't know where are those coming from. The ones with most occurrences and with no easy explanation are:

1. CheckVirtualFileExists

This one happens on every .aspx request that does not exist. We use the 404 Geta handler, and it redirects to our "not found page" correctly, but it logs a lot of these exceptions in azure. 

System.Web.HttpException:
   at System.Web.UI.Util.CheckVirtualFileExists (System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
   at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal (System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
   at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert (System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
   at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory (System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
   at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath (System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
   at System.Web.UI.PageHandlerFactory.GetHandlerHelper (System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
   at System.Web.UI.PageHandlerFactory.GetHandler (System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
   at System.Web.HttpApplication+MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute (System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
   at System.Web.HttpApplication+<>c__DisplayClass285_0.<ExecuteStepImpl>b__0 (System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
   at System.Web.HttpApplication+StepInvoker.Invoke (System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
   at System.Web.HttpApplication+StepInvoker+<>c__DisplayClass4_0.<Invoke>b__0 (System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
   at Microsoft.AspNet.TelemetryCorrelation.TelemetryCorrelationHttpModule.OnExecuteRequestStep (Microsoft.AspNet.TelemetryCorrelation, Version=1.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
   at System.Web.HttpApplication+<>c__DisplayClass284_0.<OnExecuteRequestStep>b__0 (System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
   at System.Web.HttpApplication+StepInvoker.Invoke (System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
   at System.Web.HttpApplication.ExecuteStepImpl (System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
   at System.Web.HttpApplication.ExecuteStep (System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)

From the IIS logs on azure:

2020-07-20 22:23:38 AZAPP-NXS-EPI-CMS-PREP-01__E284 GET /search.aspx 404;https://azapp-nxs-epi-cms-prep-01__e284:80/search.aspx?page=11&category=953&X-ARR-LOG-ID=77c41081-2434-4707-a9e4-966b3c94b9c3 443

Testing the same url, but in my local environment (note no 404):

2020-07-20 23:13:43 127.0.0.1 GET /search.aspx page=11&category=953 80 - 127.0.0.1 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/83.0.4103.116+Safari/537.36 - 200 0 0 1141

2. Server cannot append header after HTTP headers have been sent. 

System.Web.HttpException:
   at System.Web.HttpResponse.AppendHeader (System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
   at System.Web.HttpResponseWrapper.AppendHeader (System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
   at EPiServer.Web.MediaHandlerBase.CheckIsModifiedAndAddETag (EPiServer.Framework.AspNet, Version=11.15.0.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7)
   at EPiServer.Web.MediaHandlerBase.NotModifiedHandling (EPiServer.Framework.AspNet, Version=11.15.0.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7)
   at EPiServer.Web.BlobHttpHandler.ProccessBlobRequest (EPiServer.Cms.AspNet, Version=11.15.0.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7)
   at EPiServer.Web.BlobHttpHandler.ProcessRequestAsyncInternal (EPiServer.Cms.AspNet, Version=11.15.0.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7)
   at EPiServer.Web.BlobHttpHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest (EPiServer.Cms.AspNet, Version=11.15.0.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7)
   at System.Web.HttpApplication+CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute (System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
   at System.Web.HttpApplication+<>c__DisplayClass285_0.<ExecuteStepImpl>b__0 (System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
   at System.Web.HttpApplication+StepInvoker.Invoke (System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
   at System.Web.HttpApplication+StepInvoker+<>c__DisplayClass4_0.<Invoke>b__0 (System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
   at Microsoft.AspNet.TelemetryCorrelation.TelemetryCorrelationHttpModule.OnExecuteRequestStep (Microsoft.AspNet.TelemetryCorrelation, Version=1.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
   at System.Web.HttpApplication+<>c__DisplayClass284_0.<OnExecuteRequestStep>b__0 (System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
   at System.Web.HttpApplication+StepInvoker.Invoke (System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
   at System.Web.HttpApplication.ExecuteStepImpl (System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
   at System.Web.HttpApplication.ExecuteStep (System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)

This one is the most random exception. Happens a lot when trying to access to images. I had a chat with Epi Support, they asked me to review my redirects, which I did and error is still happening. This can't be reproduced in my local environment either. 

These two exceptions happen a lot during the day, this is just a report from the past 6 hours: 

Hope any of you have seen this before and have some insight on to what might be happening. We use azure deployment slots to decrease downtime, not sure if that can be an issue.

Thanks!

Migrate Episerver Blobs to Amazon

$
0
0

Hi, I am migrating existing Episerver blobs ( stored on server filesystem ) to Amazon S3 bucket. I am new to this process and I want to check that I did not miss anything.

What I have done so far:
1. Installed/Configured  EPiServer.Amazon.Blobs.AmazonBlobProvider
2. Manually copied all files to S3 bucket

Did I missed anyhting?

When I load the pages from the CMS the media files are still refered via /globalassets and I cannot see that request is ending up at S3 bucket. Do I need to do anything else in th emigration process?

What is the best way to make sure that those files are coming from the S3 bucket, and how can I offload the request from the webserver to get the file directly from S3?

Thanks
las

what does ecf_LineItem_Update do in episerver?.

$
0
0

what does ecf_LineItem_Update do in episerver?. Does it update it update price and Total price for the cart?

Not able to save the CMS category using fake respository

$
0
0

Hello There,

I am using EpiServer CMS version 11.14. I have created a unit test project and I am using FakeItEasy to create Fake instances and Nunit for unit test. At one place I have to create CMS categories in category repository and have to attach category to page. By following code I am trying to create categories, but couldn't able to save it.

-- Faking -- 
public CategoryRepository CategoryRepository { get; set; }

A.CallTo(() => ServiceLocator.Current.GetInstance<CategoryRepository>()).Returns(this.CategoryRepository); 
 

--- Category Creation -- 

var rootCategory = cmsContext.CategoryRepository.GetRoot();
rootCategory = rootCategory.CreateWritableClone();
rootCategory.Name = "Root";
rootCategory.ID = 0;

cmsContext.CategoryRepository.Save(rootCategory);
var parentCategory = new Category(rootCategory, SiteConstants.AuthorsCategoryName)
{
Selectable = true,
Name = SiteConstants.AuthorsCategoryName,
ID = 1
};
cmsContext.CategoryRepository.Save(parentCategory);
var authorJohn = new Category(parentCategory, "John")
{
Selectable = true,
Name = "John",
ID = 2
};

cmsContext.CategoryRepository.Save(authorJohn);

var testCat = cmsContext.CategoryRepository.Get("John");

// testCat -  give me category with 0 id.


Please help me out.

Async Index method in block controller

$
0
0

Hi,

   I am trying to implement async call in block controller. 

The method inside Index method calls the Api endpoint. 

When making it async, is throws inner exception "InvalidOperationException: HttpServerUtility.Execute blocked while waiting for an asynchronous operation to complete."

It is causing a performance issue for the webiste, as we are having 4-5 blocks on page

[HttpGet]
        public async Task<ActionResult> Index(xBlock currentBlock, xyViewModel viewModel)
        {
            var xxx = await xxx.IndexAsync();
            var yyy= await yyy.Index2Async();
         return PartialView(viewModel);
}

How can I make block methods async ? I have tried a lot but still getting same error

ASP.Net version-> 5.2.7

MatchContained with DateTime For Day, Month, Year match

$
0
0

Hi guys using using find 13.2.7 I have trying to match if any passed in dates in a range exist within an indexed collection of date ranges for the index item

E.g I have index on my item with a field

"EventDayRange$$date": ["2020-07-26T23:00:00Z","2020-07-27T23:00:00Z","2020-07-28T23:00:00Z","2020-07-29T23:00:00Z"]

And I'm trying to write an extension method that allows be to pass a list of dates and check if any of those exist in the list.

I created

        public static ITypeSearch<T> FilterMonths<T>(this ITypeSearch<T> query, List<DateTime> filterDates)
            where T : IContent, IEventContent
        {
            if (filterDates != null && filterDates.Any())
            {
                var dateFilter = SearchClient.Instance.BuildFilter<T>();
                var minDate = filterDates.Min();
                var maxDate = filterDates.Max();
                var daysInMonth = DateTime.DaysInMonth(maxDate.Year, maxDate.Month);
                var realMaxDate = new DateTime(maxDate.Year, maxDate.Month, daysInMonth, 23, 59, 59);
                var datesInRange = minDate.GetDateRangeFloored(realMaxDate);
                foreach (var dateTime in datesInRange)
                {
                    dateFilter = dateFilter.Or(x => x.EventDayRange.MatchItem(d => d.MatchDay(dateTime.Year, dateTime.Month, dateTime.Day)));
                }
                return query.Filter(dateFilter);
            }
        /// <summary>
        /// Gets the date range.
        /// </summary>
        /// <param name="startDate">The start date.</param>
        /// <param name="endDate">The end date.</param>
        /// <returns></returns>
        /// <exception cref="ArgumentException">endDate must be greater than or equal to startDate</exception>
        public static IEnumerable<DateTime> GetDateRangeFloored(this DateTime startDate, DateTime endDate)
        {
            if (endDate < startDate)
                throw new ArgumentException("endDate must be greater than or equal to startDate");
            while (startDate <= endDate)
            {
                yield return new DateTime(startDate.Year, startDate.Month, startDate.Day, 0, 0,0);
                startDate = startDate.AddDays(1);
            }
        }

But when I run thge query I get an error.

I've been using the match contained for another query which works as it's just a string but there's no matchcontained implementation for a DateTime Day,Month,Year match.

Does anyone good with Find know how to resolve this as I'm a bit rusty with my Find queries.

Can EpiServer handle a high load / large amount of content

$
0
0

Hi Episerver community,
We are choosing a CMS platform for a big old solution. It's preferrable to have site on-premise, not in cloud

Does anyone have experience with building a solution with similar characteristics:

~ 4-20 mln visits a day (3 sites)
~ 4000 requests/sec
~ 6 mln pages of content (search is needed in admin for all pages)

It would be great to hear about real-life examples.


DateTime wrong Culture

$
0
0

Hello Dear Experts,

Could you please help me to resolve the following issue.

The site initially had globalization culture set to en-US. DateTime are defined in wrong format for us. I've replaced the culture with

<globalization culture="en-AU" uiCulture="en-AU"

In the controller that intitializes the form with DateTime property checking current culture

string currentCulture = EPiServer.Globalization.GlobalizationSettings.CultureLanguageCode;

it's set to correct one en-AU, but when checking the DateTime format it's still in en-US

Why this happens?

Thanks

Olga

Is there a way to change the Personal Language in My Settings by code?

$
0
0

This setting is found in My Settings (Person Icon in the top right corner) -> Display Options tab -> Language Settings -> Personal Language. The default in my environment is "Use system language" and I would like to force the value to English (United States) if it is possible via code or any config.

Removing empty block controllers for better performance

$
0
0

I am currently looking at this interesting article: https://swapcode.wordpress.com/2018/05/16/episerver-block-performance-with-controller-vs-without-controller-vs-irendertemplate/

I am a bit of an episerver newbie, so while looking through our Episerver project I came across this block controller:

using System.Web.Mvc;
using BestDigital.Site.Models.Blocks;
using EPiServer.Web.Mvc;
namespace BestDigital.Site.Controllers
{
    public class AboutUsGridBlockController : BlockController<AboutUsGridBlock>
    {
        public override ActionResult Index(AboutUsGridBlock currentBlock)
        {
            return PartialView(currentBlock);
        }
    }
}

I this is what is considered an "empty" block controller in the article? Because if I understood it correctly all this block controller is doing is handing over data to the View?

Decrease product amount when promotion is added with larger amount then subtotal

$
0
0

Hi,

We ran into a problem.

We have a site where you can use your wallet value to buy some products. The Wallet value the customer wants to use do we call a Wallet Promotion.
The customer selects the Wallet amount (max amount of order subtotal ex vat or max of customer wallet amount) en after that we create a Promotion of type WalletPromoData (override from OrderPromotion). 

Now we have the following scenario:

  1. Add product to cart with 4 seats a E200,- each (order subtotal is E800,-)
  2. Use Wallet value for whole order, so also E800,- (promotion with couponcode is generated and visible)
  3. Decrease the seats to 2, so order subtotal will be E400,- while the Wallet Promotion still has a value of E800,-
  4. Now, the cart page run into the following error after calling OrderRepository.Service.Save(cart): "Invalid order group total calculation"
  5. So it looks like Episerver doesn't decrease the amount of the promotion to the max of the order subtotal

Does anyone else ran into the same problem or something like this?

Thanks in advance.

Grtz Sander

How to get data in Episerver Forms Override form submit method

$
0
0

I have created a controller inheriting from DataSubmitController in which i have overide Submit method to execute my part of code before actually saving in the table.

My issue is i was using  base.HttpContext.Request.Form.AllKeys; to get the data which was mentioned by the user in the form but this does not show the new hidden fields(added in my custom FormContainerBlock) also it does not show the actual names of the fields i mentioned for my custom form elements instead is shows _field13213. 

Is there any other way to get the correct data in this submit method?

Failed loading content url after saveCatalogNode

$
0
0

Hi Everyone,

I am trying to call saveCatalogNode of ICatalogSystem inside the PublishedContent event but unfortunately, after clicking publish button I always get this error

after several attempts of figuring the cause, i noticed that as soon as after calling saveCatalogNode, the HttpContext.Current.Request.Url was updated to this wrong url. The correct url in our set up is "epi.cms.contentdata:///1073742255_CatalogContent" but after saveCatalogNode, it added 2122933 on the middle part. Any ideas on why it changes the request url? and is there a way to retain the original one even after calling savecatalognode method? Thanks.

Event listener for expiring catalog contents in the future

$
0
0

The customer expires catalog categories under Commerce. We are able to capture the event when the expiry datetime is set to “now” but if the user set expiration to a future date and that date comes, will episerver fire an event? 


Failed loading content url after saveCatalogNode

$
0
0

Hi Everyone,

I am trying to call saveCatalogNode of ICatalogSystem inside the PublishedContent event but unfortunately, after clicking publish button I always get this error

after several attempts of figuring the cause, i noticed that as soon as after calling saveCatalogNode, the HttpContext.Current.Request.Url was updated to this wrong url. The correct url in our set up is "epi.cms.contentdata:///1073742255_CatalogContent" but after saveCatalogNode, it added 2122933 on the middle part. Any ideas on why it changes the request url? and is there a way to retain the original one even after calling savecatalognode method? Thanks.

Lineitem does not have a price or get tax calculated with Customer Price Group

$
0
0

Im trying to implemet customer price groups and have added an organization with a customergroup and an assosiated price on a variant. When I on a customer connected to that organization adds the product to the cart our custom PlacedPriceProcessor retreaves the correct prise for that group and everything seems fine. but later when I run "lineItem.GetDiscountedPrice(...)" it's returned with 0, and the same with all calculators assosiated with the lineItem, and as an extension the "cart.GetTotal()" as well. Inside the TaxCalculator the method "Money GetSalesTax(...)" is hit with 0 in the variable "Money basePrice". Im out of idéas why the lineItem does not seem to contain a price, even though the PlacedPrice is set. I have been unable to find where the actual price is retreaved so I cant determine why its not working.

/Regards Erik

Edited pages scheduled for publish or ready to publish no longer found in Find

$
0
0

Hi all, 

When we edit a page in EpiServer CMS and mark it as either 'Schedule for publish' or 'Ready to publish' the page is no able to be found by EpiServer Find.

Does anyone have the same issue, and is there a fix?

Thank you!

Organization on OrderGroup

$
0
0

Hi all,

We are currently building a commerce website and are using the Serializable Cart. I am trying to register the Id of the organization of a contact on the cart. I found a property on the cart "Organization", type nullable Guid. Looks great...

However after saving the ICart as PurchaseOrder: orderRepository.SaveAsPurchaseOrder(cart), the organizationId is nowhere to be found on the PurchaseOrder.
After some decompiling I found out that the SaveAsPurchaseOrder copies the Organization property from the cart to the purchase order.
Which eventually results in calling the setter on the Mediachase.Commerce.Orders.OrderGroup class. This property contains the following code:

Guid? IOrderGroup.Organization
    {
      get
      {
        if (string.IsNullOrEmpty(this.OwnerOrg))
          return new Guid?();
        Guid result;
        return Guid.TryParse(this.OwnerOrg, out result) ? new Guid?(result) : new Guid?();
      }
      set
      {
        if (value.HasValue)
          this.OwnerOrg = value.ToString();
        this.OwnerOrg = (string) null;
      }
    }

I do not get the last line: setting the property to null again ...

Any ideas why, or how to store the current contact organizationId on the cart and propagating it to the PurchaseOrder?

Override TinyMCE markup when a file is dragged in

$
0
0

I would like to override the markup generated when a file (pdf in this case) is dropped into the TinyMCE editor. as I would like to add some extra properties to the markup which are present on the file itself.

the PdfFile type is a expandsion on the MediaData class, with things like filesize and title.

currently it generates this:

<p><a title="some-pdf.pdf" href="some-pdf.pdf">some pdf</a></p>

I would like something more like:

<p><a title="pdfTitle" href="some-pdf.pdf" data-some-attribute="pdfTitle">some pdf (PdfFileSize)</a></p>

I am unsure as to

  1. how to amend the template which is used by TinyMCE - if that is how it works
  2. how to grab the extra properties in this instance to insert into the template

I know when the file is dropped into the editor, it calls an ajax method, which returns the markup /EPiServer/cms/Stores/contentdata/contentId_workID but that is about it

thanks

Viewing all 6894 articles
Browse latest View live