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

Custom ContentProvider performance issue

$
0
0

Hello

We're writing a custom ContentProvider to enable editors to reference data from an external system in the page properties.

It seems that when there are a lot of child nodes for a content item, then expanding that item will take a very long time to open. 

Even if we cache our entire content tree in memory, EPiServer will take minutes to expand a node with 1500 children.

What is the best practice here? Do we need to divide our content into smaller folders? If so, what is the optimal folder size for such a folder?

Looking at a SQL profiler, EPiServer is doing a lot of SQL calls when expanding a tree. Is that to be expected?


FOREIGN KEY constraint SQL Error while creating a new page programmatically

$
0
0

I get this DB Error on saving a new page programmatically:

"The INSERT statement conflicted with the FOREIGN KEY constraint \"FK_tblWorkContentProperty_tblContent\". The conflict occurred in database \"MyDbName\", table \"dbo.tblContent\", column 'pkID'."

The code which always worked is:

public static ContentReference SaveContentToPublishWithNoAccess(this IContentRepository contentRepository, IContent content)
{
    return contentRepository.Save(content, SaveAction.Publish, AccessLevel.NoAccess);
}

What can be the reason? This happens only for one page that i am creating but i cannot see a difference to the others.
I have restarted IIS and cleared the trash. Since it's on local i can also debug.

Regex-validation on properties

$
0
0

Would be nice if we could specify an regular expression for validation on a property.

Render Block in XhtmlString field

$
0
0

Hi!

I use Episerver 11 and a standalone Nuxt front-end. I having problem rendering blocks (which are Vue components) in XhtmlString field. 

It work well when I write the same code into Views/shared/cshtml, but I want to do it with a standalone front-end.

Does anyone have experience with this?

Stuck in publishing loop

$
0
0

Essentially, I'm attaching to the publishing event like so

contentEvents.PublishedContent += MyMethodOnPublish;

then eventually saving my content like so

contentRepository.Save(editablePage, SaveAction.ForceCurrentVersion, AccessLevel.NoAccess);

but then the event for the content keeps getting called in an infinite loop, which kinda makes sense but obviously is not the desired behaviour, is there a recommended method to prevent this publishing loop?

using CMS 11.11.1.0

Cannot change the order of available content types when creating pages. Sorts in alphabetical order.

$
0
0

I am unable to change the order of available page types in edit mode when creating new pages.

I have tried in code to change "order" for the content type (see code below), but the pages are sorted in alphabetical order no matter what I do. If I change the page types Display Name, the order changes.

Is there a setting i´m missed to change order from alphabetic to index?

    [ContentType(
        GUID = "ce73b558-c476-485c-aedc-6edaf055efc2",
        DisplayName = "Lokal Page",
        Description = "Page for locals",
        Order = 20,
        GroupName = Global.GroupNames.Local,
        AvailableInEditMode = true)]

Share cart across devices/browsers

$
0
0

Hi there,

I have a case where I would like to share an "anonymous" cart across devices. Here it is possible for me to send "CustomerId" in a QueryString to the other device.

I use this code to share the cart between devices:

public ICart CloneAndLoadCart(Guid customerId)
        {
            var existingCart = _orderRepository.LoadCart<ICart>(customerId, DefaultCartName, _currentMarket);
            if (existingCart == null)
                return null;
            var clonedCart = (ICart)((Mediachase.Commerce.Orders.Internal.IDeepCloneable)existingCart).DeepClone();
            clonedCart.CustomerId = CustomerContext.Current.CurrentContactId;
            SaveCart(clonedCart);
            return clonedCart;
}

Can it be done in a better / nicer way?

It is said here, that "IDeepCloneable Interface""is not intended to be used directly from your code".

Br

Lasse

Advice for packages with optional variants

$
0
0

I want to let buyers configure their own package. 

The package can by default contain variant A, B and C, but the user should be allowed to swap C with D.

Can this be solved by extending PackageContent, BundleContent or SalesCampaign?

Borrowed the example by K Khan to show a package with one expensive option selected, causing the total price to increase:

Computer package (cheapest price $299)

Motherboard cheap option: $100
Motherboard expensive option: $200

Ram cheap option: $50
Ram expensive option: $150

Monitor: $200

Total package price: $299 + ($150 - $50) = $399


Inventory level not accurate

$
0
0

We having an issue relating to inventory levels and behaviour that results in the overselling items that should have 0 inventory and be out of stock.
The issue is intermittent and happening a number of times every day.
We are also unable to replicate the issue locally in development nor in internal test environment so appears to be isolated to the DXC live environment.

Has anyone else experienced a similar issues ?

Having added some logging to try understand what is happening, we can see what appears to be happening is inventory is returning to it’s previous level a short period of time after hitting zero, an example from our logs:

Order placed for last item in stock:

  • Purchased at: 09:41
  • Item SKU: XXXXXX11
  • Expected stock level: 1
  • Log shows inventory query returns stock level 1 before placing the order:
    • 09:41:45, [Pre-Purchase] Stock levels for item XXXXXX11: 1
  • Log shows inventory query returns stock level 0 after placing the order:
    • 09:41:48, [Post-Purchase] Stock levels for item XXXXXX11: 0

Next order placed on the same say when item is out of stock:

  • Purchased at: 11:45
  • Item: XXXXXX11
  • Expected stock level: 0
  • Log shows inventory query returns stock level 1 before placing the order
    • 11:45:13, [Pre-Purchase] Stock levels for item XXXXXX11: 1
  • Log shows inventory query returns stock level 0 after placing the order
    • 11:45:23, [Post-Purchase] Stock levels for item XXXXXX11: 0

Note these log entries are from the same application server so we do not believe this is a load balancing issue

The following code snippets detail the processing of orders within the solution:

 

....Following successful payment

// Save cart as purchase order with an initial status of 'On Hold'

var orderReference = _orderRepository.SaveAsPurchaseOrder(cart);

 

// Load saved purchase order asset status

var purchaseOrder = _orderRepository.Load<IPurchaseOrder>(orderReference.OrderGroupId);

purchaseOrder.OrderStatus = OrderStatus.InProgress;

purchaseOrder.PricesIncludeTax = true;

 

// Ensure shipment has warehouse code and inventory status

var shipment = purchaseOrder.GetFirstShipment();

shipment.WarehouseCode = _warehouseSettingsProvider.DefaultWarehouseCode;

shipment.OrderShipmentStatus = OrderShipmentStatus.InventoryAssigned;

 

// Save purchase order changes and remove the cart

_orderRepository.Save(purchaseOrder);

_orderRepository.Delete(cart.OrderLink);

 

// Run inventory activity

_inventoryProcessor.AdjustInventoryOrRemoveLineItem(shipment, purchaseOrder.OrderStatus, (item, issue) => validationIssues.Add(item, issue));

_orderRepository.Save(purchaseOrder);

... Continue with displaying order confirmation

4 times per day an order status import occurs which updates the order status to completed and shipping status to shipped:

var purchaseOrder = _purchaseOrderRepository.Load(trackingNumber);

if (purchaseOrder != null)

{

    order.Id = purchaseOrder.OrderLink.OrderGroupId;

    var shipment = purchaseOrder.GetFirstShipment();

    shipment.ShipmentTrackingNumber = courierTrackingNumber;

    shipment.OrderShipmentStatus = OrderShipmentStatus.Shipped;

    purchaseOrder.OrderStatus = OrderStatus.Completed;

 

    _orderRepository.Save(purchaseOrder);

    _mailService.SendDispatchEmail(emailAddress, order);

}

Has anyone experienced any similar issues ?

Is there anything in the code snippets you can see that should be executed differently, or any steps missing ?

The project is using CMS v11.11.2, Commerce v12.17.2

Thanks,

Stephen

Strategy Block Styling

$
0
0

I am using the Strategy Block that comes with EPiServer.PErsonalization.CMS.UI. I want to override the styling/markup. With EPiServer Forms, I can just create new user controls in my solution with the same name/path as the EPiServer forms controls. This does not seem to work with the Strategy Block. I would prefer not to rebuild the entire thing from scratch as it just works from a content perspective. Is there a way to override the markup its using?

A/B Testing, does it affect content returned by IContentLoader?

$
0
0

So i have an interesting scenario.

We have a site with menu items defined via a settings page, separate to any content pages, these pages then load the menu as part of their loading logic via the IContentLoader,

The business would like to A/B a change to the menu item on the settings page, is it possible for content returned via IContentLoader?

Get Property Attributes

$
0
0

Hi,

I have a content area Property with a Custom Attribute called AllowedTypes which restricts BlockData in this Content area.

I want to find this attribute from code and apply Blockdata based on the allowed type.

Any Suggestions?

 

How to get PrincipalInfo in web api?

$
0
0

Hi!

I have a site which is built on AspNet Identity, and I would like to have an api method (not using Headless) that returns logged in status for the current user.

Is this possible?

It looks like this:

As you can see, I get Name "" and only the "Everyone" and "Anonymous" role, even thought the user is logged in.

EPiServer.TinyMCESpellChecker 2.0.0 makes XHR request to a ressource on HTTP

$
0
0

I seems like it makes XHR request to a ressource on HTTP and therefore cannot be used if you serve your site on HTTPS. Can anyone confirm?

Best,

Bilal

"For This Site" folder is not updating for different sites

$
0
0

We have a multisite setting on DXC with " Use site-specific assets" turned on every site. But when I go to the folder "For this Site" of each site, the content never change. The content I uploaded to current site always saved to the folder of the first site we set up. Not sure why. Any idea of it?


Catalog Import throws "sql duplicate key error" although overwrite option is set as "true"

$
0
0

When we call to Mediachase.Commerce.Catalog.ImportExport.Import method in order to import one catalog from an xml file , we are getting an Sql error regarding "Violation of Unique Key" but it shouldn't happen because we set the method param "overwrite" as true.

Error Number:2627,State:2,Class:14
System.Data.SqlClient.SqlException (0x80131904): Violation of UNIQUE KEY constraint 'UQ__#B5DEE65__C86C24AB46D15906'. Cannot insert duplicate key in object 'dbo.@ContentProperty'. The duplicate key value is (101, 1, <NULL>, 17, en).
The data for table-valued parameter "@ContentProperty" doesn't conform to the table type of the parameter. SQL Server error is: 3602, state: 30

Any comment or direction will be appreciated. 

EPiServer CMS loads slowly

$
0
0

Hi

Our client reported that using the EPiServer CMS is slow. I looked into it and noticed that when opening the CMS about 1000 files are being loaded by the dojo.js. This is causing so much overhead that it takes about half a minute before the CMS loads.

Is there maybe a way to bundle these files to reduce the overhead and make the cms load faster?

Also all the files are uncompressed while we have this in our Web.config:
<episerver.framework updateDatabaseSchema="false">
  <clientResources debug="false" />

Which I thought is supposed to load the compressed versions of the javascript files instead of the uncompressed ones. Is this not working correctly or is there another way to minify the files?

Are there other ways to speed up the CMS?

We are using the latest episerver version 11.13.2.0

Azure Best Practices

$
0
0

Hello folks,

I couldn't find an Azure-related forum, so I'm am going to try my questions here.  Do let me know if there is a better place to discuss the following...

I am the new Dev Ops Engineer/Epi Administrator at a company that I just joined and I'm new both Epi and Azure/Application Insights (AI), although I have a ton of experience with other CMSes and troubleshooting Web apps (on-premises).  Almost all of the AI views for a particular resource are a consolidation of all of the servers and apps, so I'd like to find the most efficient way of viewing the Live Metrics Stream for each individual website/app.  What is the best way to do that?

Also, how can view the IP bindings for each website?

Once I get a good answer, or a number of answers, I'll likely have follow-up questions regarding troubleshooting best practices on a per-website basis.

Thanks in advance,

Bob

EPiServer.TinyMCESpellChecker 2.0.0 makes XHR request to a ressource on HTTP

$
0
0

I seems like it makes XHR request to a ressource on HTTP and therefore cannot be used if you serve your site on HTTPS. Can anyone confirm?

Best,

Bilal

Custom Public Upstream NuGet Feeds in Azure DevOps

Viewing all 6894 articles
Browse latest View live