Quantcast
Channel: Developer to developer
Viewing all 9076 articles
Browse latest View live

A lovely cryptic message when publishing content "Culture is not supported. Parameter name: name h is an invalid culture identifier"

$
0
0

h is a veeery strange culture identifier, so the error seems legit.

After some time debugging i came to realise that this is yet another issue caused by having a lot of languages (Our instance has 125 enabled epi languages)

Here is the stacktrace:

at System.Globalization.CultureInfo.GetCultureInfo(String name)
at EPiServer.Commerce.Catalog.Provider.Construction.CatalogBuilder.ReadCatalogProperties(DataTable table, Dictionary`2 contentMap)
at EPiServer.Commerce.Catalog.Provider.Construction.CatalogBuilder.CreateVersions(IList`1 contentLinks)
at EPiServer.Commerce.Catalog.Provider.CatalogContentLoader.ConstructContent(IList`1 contentLinks, Func`3 createContentFunc)
at EPiServer.Commerce.Catalog.Provider.CatalogContentLoader.LoadSpecificContentVersions(IList`1 contentVersions)
at EPiServer.Commerce.Catalog.Provider.CatalogContentProvider.BatchLoad(IList`1 contentLinks, Func`2 dbLoader)
at EPiServer.Commerce.Catalog.Provider.CatalogContentProvider.LoadContents(IList`1 contentReferences, ILanguageSelector selector)
at EPiServer.Core.ContentProvider.GetContentBatch(IList`1 batch, ILanguageSelector selector, List`1& contents, Dictionary`2& contentMap)
at EPiServer.Core.ContentProvider.GetScatteredContents(IEnumerable`1 contentLinks, ILanguageSelector selector)
at EPiServer.Core.Internal.ProviderPipelineImplementation.GetItems(ContentProvider provider, IList`1 contentLinks, LoaderOptions loaderOptions)
at EPiServer.Core.Internal.DefaultContentLoader.GetItems(IEnumerable`1 contentLinks, LoaderOptions loaderOptions)
at EPiServer.Find.Commerce.CatalogEventIndexer.IndexContentInAllLanguages(IContent content)
at EPiServer.Find.Commerce.CatalogContentEventListener.IndexContentsIfNeeded(IEnumerable`1 contents, Action`1 indexAction, IDictionary`2 cachedReindexContentOnEventForType, Func`1 isReindexingContentOnUpdates)
at EPiServer.Find.Commerce.CatalogContentEventListener.IndexContentsIfNeeded(IEnumerable`1 contentLinks, Action`1 indexAction)
at EPiServer.Find.Commerce.CatalogContentEventListener.CatalogNodeUpdated(CatalogContentUpdateEventArgs catalogContentUpdateEventArgs, Action`1 indexAction)
at EPiServer.Find.Commerce.CatalogContentEventListener.CatalogEventUpdated(Object sender, EventNotificationEventArgs e)
at EPiServer.Events.Clients.Event.Raise(Guid raiserId, Object param, EventRaiseOption raiseOption)

After some sql profiling i found this sproc was called: "ecfVersion_ListByWorkIds", which in turn calls this sproc: "ecfVersionCatalog_ListByWorkIds"

When i run it i see the languages for our catalog comes out as "ar-ae;ar-bh;ar-dz;ar-eg;ar-iq;ar-jo;ar-kw;ar-lb;ar-ly;ar-ma;ar-om;ar-qa;ar-sa;ar-tn;ar-ye;az;bg;bg-bg;bs;cs-cz;da-dk;de-at;de-de;el-gr;en;en-ag;en-ai;en-au;en-bb;en-bm;en-bs;en-bz;en-ca;en-dm;en-gb;en-gd;en-gy;en-hk;en-id;en-ie;en-il;en-jm;en-kn;en-ky;en-lc;en-ms;en-my;en-nz;en-ph;en-pr;en-sg;en-si;en-tt;en-us;en-vc;en-vg;en-vi;en-za;es-419;es-ar;es-bo;es-cl;es-co;es-cr;es-do;es-ec;es-es;es-gt;es-hn;es-mx;es-ni;es-pa;es-pe;es-py;es-sv;es-uy;es-ve;fi-fi;fr-be;fr-ca;fr-fr;fr-gp;fr-ht;fr-mq;hi-in;hr-hr;hu-hu;h"

That last one is lovely, right? :)

As it turns out "ecfVersionCatalog_ListByWorkIds" calls a custom function called "fn_JoinCatalogLanguages()" that has this lovely nugget in it: "DECLARE @RetVal nvarchar(512)"

that means that a maximum of 512 characters of combined comma-delimited language codes can be returned, if it goes over then you get to see the if you are lucky to have the alst language code being complete or incomplete.

Could someone at epi please increase the retval of this function for the (admittedly few) of us that have a lot of languages.

Cheers


Evaluate prices for specific customer or visitor groups

$
0
0

I have a need to provide specific customer or visitor groups to the promotion engine when calling Evaluate or GetDiscountedPrices.

The use case is pretty straight forward: a client wants to display two different price on their variant page:

  1. The actual price the customer has to pay for the variant.
  2. The member price that the customer would get if they were a member (hidden if they already are a member).

It must be supported that the displayed member price is applied through promotions as well as a direct price on the variant.

Export Bilingual xliff File

$
0
0

I am trying to update our translated web pages as our English website has some updates. These updates are minor (i.e. adding a sentence or deleting some words), so obviously, it won't make sense to send out the whole page to the translator again. The goal is to sift out the content that has been changed in the CMS and send that to our translators. What I need for the sifting process is a bilingual xliff that contains "not yet updated English content" which corresponds to the "translated content" in the CMS. This way, I can compare the bilingual xliff to the updated English xliff and get the content that has changed. At the same time, leveraging the old translation we have done before.

The existing features in Ektron do not support my need, and I believe this is a very common issue every localization specialist will run into. 

The bilingual xliff will make the translated content more scalable and more convenient for people to manage their translated website. 

DBLocalization Provider in read-only database

$
0
0

Good morning.

Have any of you successfully used the dblocalization provider in a readonly database mode.  i cannot get this to work in a geo replicated db or in dxc enviroment.  Any help would be greatly appreciated.

Error logging with Log4Net is not working in production.

$
0
0

In production environment metods like 'logger.Error("Some error message")' creating a 'EPiServerErrors.log' , but the message text is not written to. We are getting only empty files only. What can be the cause for this issue?. In our local host everything working fine.We are using Episerver version 11.Our configuration:

<?xml version="1.0" encoding="utf-8"?>
<log4net>
<!-- Reduce amount of debug logging -->
<logger name="EPiServer.Core.OptimisticCache" additivity="false">
<level value="Error" />
</logger>
<logger name="EPiServer.Core.ContentProvider" additivity="false">
<level value="Error" />
</logger>
<logger name="EPiServer.Data.Dynamic.Providers.DbDataStoreProvider" additivity="false">
<level value="Error" />
</logger>
<logger name="EPiServer.Data.Providers.SqlDatabaseHandler" additivity="false">
<level value="Error" />
</logger>
<logger name="EPiServer.Data.Providers.ConnectionContext" additivity="false">
<level value="Error" />
</logger>

<root>
<!--Be careful, setting this value to All, Debug or Info will affect performance.-->
<level value="Error"/>
<appender-ref ref="errorFileLogAppender"/>
</root>
<appender name="errorFileLogAppender" type="log4net.Appender.RollingFileAppender">
<!-- Consider moving the log files to a location outside the web application -->
<file value="App_Data\EPiServerErrors.log"/>
<encoding value="utf-8"/>
<staticLogFileName value="true"/>
<datePattern value=".yyyyMMdd.'log'"/>
<rollingStyle value="Date"/>
<lockingModel type="log4net.Appender.FileAppender+MinimalLock"/>
<appendToFile value="true"/>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %level %logger: %message%n"/>
</layout>
</appender>
</log4net>

I have encountered errors when using RestApi and Code first

$
0
0

Error CS0103 The name 'query' does not exist in the current context. 
Error CS0103 The name 'First' does not exist in the current context. 
Error CS0103 The name 'query.First' does not exist in the current context.
Error CS0161 'PurchaseOrderService.GetAllProductstatusdetails()': 
Error CS1519 Invalid token '(' in class, struct, or interface member declaration
Error CS1519 Invalid token '(' in class, struct, or interface member declaration
Error CS1519 Invalid token 'return' in class, struct, or interface member declaration
Error CS1513 } expected

This is my Purchaseorderservices.cs page.

using QFT_POMS_SVC.Domain.POMS;
using System.Collections.Generic;
using System.Linq;

namespace QFT_POMS_SVC.Services.POMS
{
public class PurchaseOrderService : IPurchaseOrderService
{
ProductStatusEntities entities = new ProductStatusEntities();
private DBMapper _dbContext;
private Result _result;
private object query;

public PurchaseOrderService()
{
_dbContext = new DBMapper();
_result = new Result();
}
public IList<Distributor> GetAllDistributorsOp()
{
var query = from d in _dbContext.DistributorRepository select d;
return query.ToList();
}
public IList<PurchaseOrder> GetAllPOByDistributorIdOp(int DistributorId)
{
var query = from po in _dbContext.PurchaseOrderRepository
where po.DistributorId == DistributorId
select po;

return query.ToList();
}

public PurchaseOrder GetPODetailsOp(int PurchaseOrderId)
{
var query = from po in _dbContext.PurchaseOrderRepository
where po.Id == PurchaseOrderId
select po;

return query.First();
}

private void UpdatePurchaseOrderItems(int purchaseorderid, List<PurchaseOrderItem> items)
{
foreach (var item in items)
{
var _item = _dbContext.PurchaseOrderItemsRepository.Where(po => po.Id == item.Id).First();
_item.QtyReceived = item.QtyReceived;
_item.Received = item.Received;
_item.UnitCostReceived = item.UnitCostReceived;
_item.Discontinued = item.Discontinued;
}
_dbContext.SaveChanges();
}

public Result UpdatePurchaseOrderOp(PurchaseOrder po)
{
var _purchaseOrder = GetPODetailsOp(po.Id);
_purchaseOrder.deleted = po.deleted;
_purchaseOrder.InvoiceDate = po.InvoiceDate;
_purchaseOrder.InvoiceDueDate = po.InvoiceDueDate;
_purchaseOrder.InvoiceNumber = po.InvoiceNumber;
//_purchaseOrder.items.Clear();

//_purchaseOrder.items = po.items;
_purchaseOrder.PORcvdAmount = po.PORcvdAmount;

UpdatePurchaseOrderItems(po.Id, po.items);


_dbContext.SaveChanges();
return _result;
}

public List<ProductStatusEntities> GetAllProductstatusdetails()
{
var query = from orditem in _dbContext.OrderItemRepository
from p in _dbContext.ProductRepository
from dpm in _dbContext.DistributorProductMappingRepository
from pwi in _dbContext.ProductWarehouseInventoryRepository
where
p.ProductTypeId == orditem.ProductId &&
dpm.ProductId == pwi.ProductId &&
dpm.ProductId == orditem.ProductId &&
orditem.Order.OrderStatusId == 20
group new { orditem, p, dpm.Distributor, dpm, pwi } by new
{
orditem.ProductId,
orditem.OrderId,
p.Name,
p.ProductTypeId,
Column1 = dpm.Distributor.Name,
dpm.StockStatus,
dpm.UnitPrice,
pwi.StockQuantity,
Column2 = p.StockQuantity
} into g
select new
{
g.Key.OrderId,
g.Key.ProductId,
productname = g.Key.Name,
g.Key.UnitPrice,
Distributorname = g.Key.Column1,
orderquantity = (int?)g.Sum(p => p.orditem.Quantity),
TotalQuantity = (int?)g.Sum(p => p.pwi.StockQuantity + p.dpm.StockStatus + p.p.StockQuantity); }

return query.First();
}

}

Url to views for custom reports and admin plugins

$
0
0

Hello!

I am working on a hobby project that will add an admin plugin and a couple of cms reports. I plan to package it as a nuget package for others to use. Currently I am stuck on how to set the url for the view files (Razor) and where to place them in the project.

I have been looking at a couple projects on GitHub and I currently have this (simplified) file structure:

ProjectRoot
  Controllers
    MyPluginController.cs
  modules
    _protected
      MyProjectName
        Views
          MyPlugin
            Index.cshtml

My controller looks like this:

    [GuiPlugIn(
        Area = PlugInArea.AdminConfigMenu,
        UrlFromModuleFolder = "Views/MyPlugin/Index",
        DisplayName = "This is my plugin"
    )]
    public class MyPluginController : Controller
    {
        public ActionResult Index()
        {
            return View();
        }
    }

To test my code I have set up the AlloyMvc site as a second project in the solution and set Alloy to depend on my project. My plugin is detected and shows up in the admin interface but the view is not found. (error message reports searched physical path as {pathToSolution}\{theAlloyMvcProjectName}\EPiServer\CMS\Admin\MyPlugin\Index)

The EPiServer documentation on custom reports specifies a url in a hardcoded way and adds a route in the global.asax file but that is not an option.

I hope for a solution that makes it easy to test while coding and that also will work when package as a nuget and installed by someone else. What do I need to configure and where?

Open site of particular language depending upon location

$
0
0


I have site with languages en-gb, en-za and master language en-us. However, I want en-gb as default language and en-gb should be opened when the site is opened from all countries other than Uk (en-gb) and South Africa (en-za); en-gb and en-za site should be opened only when they are browsed from the respective countries. Also, if the site is opened without entering language it should go to default language.


Commerce FindSearchProvider not using DXC App Settings

$
0
0

Hi Quan

An update on an issue I raised a few months ago

https://world.episerver.com/forum/developer-forum/Episerver-Commerce/Thread-Container/2019/3/dxc---commerce-config-files-/#202251

We are getting intermittent 401 error in Commerce Manager when doing Catalog search or Rebuild index, due to the FindSearchProvider reading the Find settings (expired dev index) from Mediachase.Search.config. This is inspite of the Find index settings defined in the DXC environment Application Settings.

I discovered that a restart of the CMS and Commerce Manager web apps resolves the issue however it regresses after any subsequent deployments.

We are using

EPiServer.Commerce 12.11.0

EPiServer.Commerce.FindSearchProvider 10.0.2

EPiServer.Find.Commerce 11.0.2

Do you have any insights as to why this is happening ?

Thanks

Going to Next article in News details page

$
0
0

Hi,

 In my website i've News sections, where in it contains News list page(list of all news artciles) and it navigates to details of each item on selecting particular news item.

Now in news details page i've feature of getting previous and Next news article.Currently redirection from news list to details view happens like 

<a href="@Url.ContentUrl(newsItem.ContentLink)">@newsItem.TitleLink</a> in news list page.Can any one help me in finding out efficient way to get Previous and next articles from particular news details page.

SavedAmount on PromotionInfromation is wrong?

$
0
0

I am having issues with getting the correct saved amount from PromotionInfromation. I have written some complicated code to get around it, but I would like to not have to use my workaround as it is fragile.

Here is my example:

I have an order with 2 percentage line item discounts and then 1 order level discount. When I run the engine and get the list of RewardDescriptions back I see the correct saved amounts for all three discounts, but when I get the list of PromotionInformation off the form the second line item discount appears to have the the first one included in the saved amount. In different cases the numbers get very complicated and dont reflect the same numbers from RewardDescriptions.

Here are the numbers from RewardDescriptions:

Line item discount 1 - 10.299% saved $19.26

Line item discount 2 - 8.2% saved $13.75

Order Level discount 3 - Saved $46.5

And now the numbers from PromotionInformations:

Line item discount 1 -  Saved $19.26

Line item discount 2 - Saved $33.01

Order Level discount 3 - Saved $46.5

I am running Epi Commerce 10.4

Updating to Episerver Commerce 13 (NodeContent Extensions)

$
0
0

Hi team,

I have updated my episerver commerce to 13.7.1 version and the NodeContentExtensions class is removed.

In my solution i have used GetCategories() method (from NodeContentExtensions). Can you please suggest me a alternative for this.

Thanks in Advance.

When tried to edit variant of one language in Commerce Manager, it asks to fill properties for all languages

$
0
0

I have an ecommerce site with multiple languages say A, B and C where A is the master language and is disabled now. When I add a variant in language B and try to enter In Stock quantity in Commerce Manager (Commerce Manager>Catalog Management>Warehouse inventory tab), it asks to fill all the required properties of variant for all languages, I have not added the variant for all languages though.

Finding products using properties on Products and Variants.

$
0
0

Hello!

I am wanting to search for products and variants in Episerver Find. I have inherited from ProductContent and VariationContent and created an index. I am able to pull back products using code like this:

var productSearch = SearchClient.Instance.Search<FoodserviceProduct>()
.FilterFacet("BrandFacet", x => x.Brand.Match("Acme"))

This returns results successfully. However, in addition to being able to search by properties on my ProductContent, I also need to be able to search on properties that are apart of the product variants (VariationContent).

Can someone please help me understand how to do that? In other words, if my Product looks like this:

*Product Name
*Brand

and that product has several variants underneath it with properties like this:

*Size
*Color

How do I construct my query so that I can search based on Brand and Color (for instance)?

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


Delete all data in price table

$
0
0

Hello, how to delete all data from pricing programmatically ?
Thank you

Delete all data in price table

$
0
0

Hello, how to delete all data from pricing programmatically ?
Thank you

Rebuild index Json error

$
0
0

Hi!

I have a clean Quicksilver local project installed. Just after migration step, when going to Commerce Manager I have the following error when rebuilding index:

2019-09-16 20:14:57,146 [17] ERROR Mediachase.Search.Extensions.BaseCatalogIndexBuilder: Failed to index catalog entry Womens Beauty Package(755) in Fashion. Exception: System.AggregateException: One or more errors occurred. ---> Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: <. Path '', line 0, position 0.
   at Newtonsoft.Json.JsonTextReader.ParseValue()
   at Newtonsoft.Json.JsonTextReader.Read()
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ReadForType(JsonReader reader, JsonContract contract, Boolean hasConverter)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
   at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
   at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value)
   at EPiServer.Reference.Commerce.Shared.CatalogIndexer.RestIndexer.<GetDocument>d__5.MoveNext() in C:\Projects\2\quicksilverLOCAL2\Quicksilver-master\Sources\EPiServer.Reference.Commerce.Shared\CatalogIndexer\RestIndexer.cs:line 89
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at System.Threading.Tasks.Task`1.get_Result()
   at EPiServer.Reference.Commerce.Shared.CatalogIndexer.RestIndexer.OnCatalogEntryIndex(SearchDocument& document, CatalogEntryRow entry, String language) in C:\Projects\2\quicksilverLOCAL2\Quicksilver-master\Sources\EPiServer.Reference.Commerce.Shared\CatalogIndexer\RestIndexer.cs:line 64
   at Mediachase.Search.Extensions.BaseCatalogIndexBuilder.IndexCatalogEntryDto(IndexBuilder indexer, CatalogEntryRow entryRow, String defaultCurrency, String[] languages)
   at Mediachase.Search.Extensions.BaseCatalogIndexBuilder.<>c__DisplayClass16_3.<BuildIndex>b__0(CatalogEntryDto entryDto)
---> (Inner Exception #0) Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: <. Path '', line 0, position 0.
   at Newtonsoft.Json.JsonTextReader.ParseValue()
   at Newtonsoft.Json.JsonTextReader.Read()
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ReadForType(JsonReader reader, JsonContract contract, Boolean hasConverter)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
   at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
   at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value)
   at EPiServer.Reference.Commerce.Shared.CatalogIndexer.RestIndexer.<GetDocument>d__5.MoveNext() in C:\Projects\2\quicksilverLOCAL2\Quicksilver-master\Sources\EPiServer.Reference.Commerce.Shared\CatalogIndexer\RestIndexer.cs:line 89<---

Steps taken to this point:

  1. Clone github Quicksilver repo
  2. Change databases names in web.config and in SetupDatabases.cmd.
  3. Build solution
  4. Run SetupDatabases.cmd.
  5. Change basePath in web.config (Site) to App_Data for the migration step to not bork up.
  6. Fire up the site, login with admin@example.com/store
  7. Wait for the migration to end. Migration successful
  8. Change basePath back to ../appdata (for search catalog path to be the same for manager and site).
  9. Open site go to mens to check if everything is ok. Looks good.
  10. Go to CommerceManager tab in CMS, go to Administration > Logs > SearchIndex
  11. Hit Rebuild index.
  12. Every product has this error. Products no longer visible on frontend /mens or /womens

Any suggestions?

Now what possibly could be wrong here?

I would want to put a breakpoint at that RestIndexer, but visual dosnt want to hit that breakpoint, with the symbols loaded.

Expired pages are still appearing in the search bar at the front end

$
0
0

Expired pages are still appearing in the search bar at the front end

Filter content by language

$
0
0

Hi Team,
I want to filter page by exiting languages . 

The below method always retrnng me null value. 

Is the any thing wrong with my query.

 public T GetPageData<T>() where T:PageData
        {
            return this.searchClient.Search<T>()
                .Filter(x => x.ExistingLanguages.Select(y => y.Name).MatchContained(z => z, "en"))
                .GetContentResult().Items.FirstOrDefault();
        }

I am using the latest verion of Find

 <package id="EPiServer.Find" version="13.0.5" targetFramework="net472" />
Regards
Phani
Viewing all 9076 articles
Browse latest View live