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

Content Expired Event

$
0
0

Hello,

There is already a post for this question but it seems to be archived for new posts. Please refer to https://world.episerver.com/forum/developer-forum/-Episerver-75-CMS/Thread-Container/2017/8/content-expired-event/

Is there an event that runs when the content is expired or is expiring? I tested SavingContent but it does not get fired in this case. I am also not interested in scheduling/scheduled content since they run at the time when the page is marked with an expiration date, not at the time of the expiration date.


Intercept private NormalizeData of EPiServer.Forms CSVDataExporter

$
0
0

Hi all,

what would be the correct way to intercept NormalizeData method (which is private) of CSVDataExporter class to add additional normalization, without creating additional option for form submissions export ("Exaport as...")?

Intercept private NormalizeData of EPiServer.Forms CSVDataExporter

$
0
0

Hi all,

what would be the correct way to intercept NormalizeData method (which is private) of CSVDataExporter class to add additional normalization, without creating additional option for form submissions export ("Exaport as...")?

Upgrade to Episerver CMS 11

$
0
0

Hi,

I'm doing an upgrade on Episerver CMS version 10.3.2.

When I run Update-EPiDatabase in "Package Manager Console" all packages from 7.8.0.sql to 11.0.0.sql runs however when 

11.2.0.sql is beeing processed epideploy.exe breaks with the error:

EPiDeploy was stopped due to an exception, more details:


System.Data.SqlClient.SqlException (0x80131904): Invalid object name 'dbo.netProjectItemDelete'.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.Td
sParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at EPiDeploy.Sql.ScriptRunner.<>c__DisplayClass5.<ExecuteScript>b__3()
at EPiDeploy.Sql.DatabaseHandler.Execute[T](Func`1 f, Boolean commit)
at EPiDeploy.Sql.ScriptRunner.ExecuteScript(StreamReader stream)
at EPiDeploy.Sql.ScriptRunner.ExecuteScripts(IEnumerable`1 files, Boolean requiresValidation)
at EPiDeploy.Sql.ScriptRunner.<>c__DisplayClass1.<Execute>b__0()
at EPiDeploy.Sql.DatabaseHandler.Execute[T](Func`1 f, Boolean commit)
at EPiDeploy.Common.Executor.Execute(ILocation location)
at EPiDeploy.Common.Executor.Execute(ILocation location)
at EPiDeploy.Common.Executor.Execute(ILocation location)
at EPiDeploy.Common.Executor.Execute(ILocation location)
at EPiDeploy.Common.Executor.Execute(ILocation location)
at EPiDeploy.Common.Executor.Execute(ILocation location)
at EPiDeploy.Common.Executor.Execute(ILocation location)
at EPiDeploy.Common.Executor.Execute(ILocation location)
at EPiDeploy.Common.Executor.Execute(ILocation location)
at EPiDeploy.Deploy.Execute(Options options, ILocation startPosition)
at EPiDeploy.Deploy.Run(Options options)
at EPiDeploy.Program.Main(String[] args)
ClientConnectionId:59b1bd10-70dd-4337-b43f-d70206bae42e
Error Number:208,State:6,Class:16

How come dbo.netProjectItemDelete is missing?

How do I fix this?

In advance thanks for your help!

Kind regards,

Jon Haakon Ariansen

How to export submissions of Episerver Form with local timestamp instead of UTC time

$
0
0

Hey here,

Does anyone konw how to export submissions of Episerver Form with local timestamp instead of UTC time? There is column "Time" in a form's submissions. I can see it's local date/time. However, if I export these submissions to csv, json, or xml, all date/time value are UTC date/time. 

Would it possible to configure the Epiform to update it?

Thanks in advance

Bill 

Static Helper Class vs Dependency Injection

$
0
0

Hi guys, 

very simple question, 

I had a static helper class that provides for me the Content References for some of the most used pages in the solution. 

Then other developer said, let' not use it but create an interface and class implementation with ServiceConfiguration  attrubute. And later on use it as a constructor injection to get the instance.

As far as I understand there is nothing wrong in the static helper class when i am not referencing none of the shared variables.. which in my case should not as I only get the references to the instances of the pages.. 

Where the approach with the dependency injection seems to me an overkill..  

In any way, just would like to hear the opinions of fellow EpiServer developers on this subject. Thank you

By the way, why Injected<T> is anti-pattern?

Trigger an event while removing a block from a content area on a page (using "Remove" on the Content Area) and when a user click on "Move to Trash"

$
0
0

I want to trigger an event whenever editor removes a block (using "Remove" on the Content Area) and when a user click on "Move to Trash" on a block in the asset pane.

which event and how can i do this.

Commerce 12 OrderContext.GetMostRecentPurchaseOrder() obsolete

$
0
0

Anyone know a new shorthand method for this, or do I have to implement the myself (copy/paste from the obsolete)?


Commerce 12 OrderContext.GetMostRecentPurchaseOrder() obsolete

$
0
0

Anyone know a new shorthand method for this, or do I have to implement the myself (copy/paste from the obsolete)?

Exception when adding/updating cart or listing cart items, problem with workflow

$
0
0

Hi!

We are running Commerce 11.2.2 and are still using workflows. We just found out that exceptions are caught when we run the CartValidate workflow.

Our code:

public bool AddToCart(string code, decimal quantity, out string warningMessage)
        {
            var entry = CatalogContext.Current.GetCatalogEntry(code);
            if (SiteContext.Current.Currency != _cartHelper.Cart.BillingCurrency)
            {
                SiteContext.Current.Currency = _cartHelper.Cart.BillingCurrency;
            }
            var lineItem = _cartHelper.AddEntry(entry, quantity, false);
            // If this is not set explicitly, 
            // place price does not get updated by workflow
            _cartHelper.Cart.ProviderId = "frontend";
            ValidateCart(out warningMessage);
            return _cartHelper.LineItems.Select(x => x.Code).Contains(code);
        }

Running this code gives us this exception:

Mediachase.BusinessFoundation.Data.Meta.ObjectNotFoundException: Object Contact.PrimaryKeyId = 'c0105be4-02c0-4bb5-a257-0b9c76dfa12e' not found
  at Mediachase.BusinessFoundation.Data.Meta.MetaObject.GetRowSource
  at Mediachase.BusinessFoundation.Data.Meta.MetaObject.Load
  at Mediachase.BusinessFoundation.Data.Meta.MetaObject..ctor
  at Mediachase.BusinessFoundation.Data.Meta.MetaObject..ctor
  at Mediachase.BusinessFoundation.Data.Meta.MetaObjectActivator.CreateInstance
  at Mediachase.BusinessFoundation.Data.Meta.MetaObjectActivator.CreateInstance
  at Mediachase.BusinessFoundation.Data.Meta.MetaObjectActivator.CreateInstance
  at Mediachase.BusinessFoundation.Data.Business.EntityObjectDefaultRequestHandler.Load
  at Mediachase.BusinessFoundation.Data.Business.EntityObjectDefaultRequestHandler.Execute
  at Mediachase.BusinessFoundation.Data.Business.BaseRequestHandler.Mediachase.BusinessFoundation.Data.Business.IRequestHandler.Execute
  at Mediachase.BusinessFoundation.Data.Business.BusinessManager.ExecutePipeline
  at Mediachase.BusinessFoundation.Data.Business.BusinessManager.ExecutePipelineInTransaction
  at Mediachase.BusinessFoundation.Data.Business.BusinessManager.Execute
  at Mediachase.BusinessFoundation.Data.Business.BusinessManager.Load
  at Mediachase.BusinessFoundation.Data.Meta.MetaObject.GetRowSource
  at Mediachase.BusinessFoundation.Data.Meta.MetaObject.Load
  at Mediachase.BusinessFoundation.Data.Meta.MetaObject..ctor
  at Mediachase.BusinessFoundation.Data.Meta.MetaObject..ctor
  at Mediachase.BusinessFoundation.Data.Meta.MetaObjectActivator.CreateInstance
  at Mediachase.BusinessFoundation.Data.Meta.MetaObjectActivator.CreateInstance
  at Mediachase.BusinessFoundation.Data.Meta.MetaObjectActivator.CreateInstance
  at Mediachase.BusinessFoundation.Data.Business.EntityObjectDefaultRequestHandler.Load
  at Mediachase.BusinessFoundation.Data.Business.EntityObjectDefaultRequestHandler.Execute
  at Mediachase.BusinessFoundation.Data.Business.BaseRequestHandler.Mediachase.BusinessFoundation.Data.Business.IRequestHandler.Execute
  at Mediachase.BusinessFoundation.Data.Business.BusinessManager.ExecutePipeline
  at Mediachase.BusinessFoundation.Data.Business.BusinessManager.ExecutePipelineInTransaction
  at Mediachase.BusinessFoundation.Data.Business.BusinessManager.Execute
  at Mediachase.BusinessFoundation.Data.Business.BusinessManager.Load

Removing this line of code:

 ValidateCart(out warningMessage);

Which runs the CartValidate workflow, and the exception goes away so I guess there is something in the workflow.

The web works just fine, but I'm nort sure if this affects the perfrormance in any way?

/Kristoffer

Add hover on list item in admin area

$
0
0

Hi!
Could you possibly mark active list item in admin area(where jobs/tools/etc.)? Even with adding "epi-navigation-selected" class to li it looks much better(and informative, that important when you have a lot of items in a list).

After dxc migration getting error in form submission

$
0
0

After dxc migration getting error in form submission:

1) HTTP500: SERVER ERROR - The server encountered an unexpected condition that prevented it from fulfilling the request. (XHR)POST

2) WebSocket Error: Network Error 12030, The connection with the server was terminated abnormally

UnifiedSearchHit, i want more details about my hits

$
0
0

When implementing a global search using Unified search i get a list of UnifiedSearchHit as a searchresult. Most of the properties in UnifiedSearchHit is useful to me but i would like to add a few more.

I know i can customize the data in the UnifiedSearchHit by using a Custom projection or by giving the different types different implementations of ISearchContentproperties

Is it possible to achive this somehow?

Promotions - Only apply discounts if item is in stock

$
0
0

Im working with a customer that recently upgraded to the new promotion engine. A type of promotion they frequently used in the old engine was something along the lines of: 

"% discount as long as the item is in stock" 

Is there any simple way to achieve this in the new promotion engine without customizing all pre-existing promotions? 
I basically want an item to be excluded from a promotion if that item is not in stock. 

PromotionTypeHandler.DisablePromotions and DisableBuiltinPromotions no longer works after upgradering to version: 12.11.1.0

$
0
0

As topic says. Neither DisablePromotions or DisableBuiltinPromotions works after upgrading to EPiServer.Business.Commerce 12.11.1.0.


EPiFind Nested Sorting Bad Request

$
0
0

Hi,

I am trying to sort some objects by a nesten field, but cannot seem to get it working. I would like to sort all the results, (each containing the EnumerableField) based on the first element matching the z-lambda function of all the elements.

This is the nested sorting function I am using, which produces a "EPiServer.Find.ServiceException: 'The remote server returned an error: (400) Bad Request".

:

search.OrderBy(x => x.EnumerableField,
         y => y.DecimalNumber,
         z => z.ValidTo.After(DateTime.Now) & z.IsActive.Match(true) & z.ValidFrom.Before(DateTime.Now));

I have also tested sorting with .FirstOrDefault(...) but to no avail. As opposed to the previous approach, this one does not seem to do anything:

search.OrderBy(x => x.EnumerableField.FirstOrDefault(z => z.ValidTo > DateTime.Now & z.IsActive & z.ValidFrom < DateTime.Now).DecimalNumber);

Is there something I am missing, or is this not possible?

The find-index objects is grouped in this way:

{"MetaClassId$$number": ..,"GetTimestamp$$date": ..,
    ...,"EnumerableField": [
        {"___types": ["...","System.Object"
            ],"DecimalNumber$$number": 0.9,"ValidFrom$$date": "2019-01-02T23:00:00Z","ValidTo$$date": "2019-10-17T22:00:00Z","Title$$string": "...","ID$$number": 1,"$type": "....Core","IsActive$$bool": true
        },
        {"___types": ["...","System.Object"
            ],"DecimalNumber$$number": 0.2,"ValidFrom$$date": "2019-01-02T23:00:00Z","ValidTo$$date": "2019-10-17T22:00:00Z","Title$$string": "...","ID$$number": 1,"$type": "....Core","IsActive$$bool": true
        },
    ],
    ..."IsPendingPublish$$bool": false,
}

Cannot find product detail page outside of edit mode.

$
0
0

Hi

I am experiencing something that I cannot figure out. I can view our product details page in edit mode with the Commerce Catalog. When I try to browse the URL, it gives a 404. Cannot seem to figure out what the issue is. 

Regards

Farhad

Dependency Injecting IContentResolver error - No default Instance registered

$
0
0

Hi Guys,

in one of my controller i try to inject IContenResolver. Example..All the other DI's services work, but the IContentResolver doesnt. 

 public class OrphanedBlocksReportController : Controller
    {
        private readonly IContentTypeRepository contentTypeRepository;
        private readonly IAdministrationSettingsService administrationSettingsService;
        private readonly ContentTypeAvailabilityService contentTypeAvailabilityService;
        private readonly ModuleTable moduleTable;
        private readonly ServiceAccessor<SiteDefinition> currentSiteDefinition;
        private readonly ContentTypeModelRepository contentTypeModelRepository;
        private readonly IContentModelUsage contentModelUsage;
        private readonly IContentRepository repository;
        private readonly IContentSoftLinkRepository linkRepository;
        private readonly IContentResolver resolver;
        public OrphanedBlocksReportController(IContentTypeRepository contentTypeRepository, IAdministrationSettingsService administrationSettingsService,
                                                    ContentTypeAvailabilityService contentTypeAvailabilityService,
                                                    ModuleTable moduleTable,
                                                    ServiceAccessor<SiteDefinition> currentSiteDefinition,
                                                    ContentTypeModelRepository contentTypeModelRepository,
                                                    IContentModelUsage contentModelUsage,
                                                    IContentRepository repository,
                                                    IContentSoftLinkRepository linkRepository,
                                                    IContentResolver resolver)
        {
            this.contentTypeRepository = contentTypeRepository;
            this.administrationSettingsService = administrationSettingsService;
            this.contentTypeAvailabilityService = contentTypeAvailabilityService;
            this.moduleTable = moduleTable;
            this.currentSiteDefinition = currentSiteDefinition;
            this.contentTypeModelRepository = contentTypeModelRepository;
            this.contentModelUsage = contentModelUsage;
            this.repository = repository;
            this.linkRepository = linkRepository;
            this.resolver = resolver;
        }
}

But get the error:

No default Instance is registered and cannot be automatically determined for type 'EPiServer.Web.IContentResolver'

There is no configuration specified for EPiServer.Web.IContentResolver

1.) Container.GetInstance(EPiServer.Web.IContentResolver)

Even if i just try the ServiceLocation way, i get the same.. what am i missing?

var contentResourceFolder = repository.GetDefault<ContentAssetFolder>(block.ParentLink);
                        var guid = contentResourceFolder.ContentOwnerID;
                        var resolver = ServiceLocator.Current.GetInstance<IContentResolver>();                        
                        var ref4 = resolver.ResolveContent(guid);

Multiple tinyMce Settings for different properties

$
0
0

Episerver 11 with TinyMce 2.

How can i create multiple tinyMce Settings for different properties in same pagetype?

I tried to do this:

config.Default()
  .ContentCss("/Content/Editor.css")
  .AddPlugin("epi-link epi-image-editor epi-dnd-processor epi-personalized-content print 
   code")
  .Toolbar("bold italic strikethrough forecolor | epi-link image epi-image-editor epi- 
   personalized-content | code")
  .AddEpiserverSupport()
config.For<StandardPage>(p => p.Text1, basicTinyMceSettings);
config.For<StandardPage>(p => p.Text2, otherTinyMceSettings);
var basicTinyMceSettings = config.Empty()
 .AddPlugin("epi-link", "code")
 .Toolbar("epi-link unlink || bold italic underline || cut copy paste || undo redo || 
  code")
var basicTinyMceSettings = config.Empty()
 .Toolbar("bold italic || cut copy paste || undo redo")

but i didnt work. It only show default for all XhtmlString. 

Thanks in advance!

CMS edit pages redirect issue

$
0
0

Hi Team,

I have a requirement of displaying child pages into grid format instead of out-of-box content tree structure. So i have implemented the logic in parent page type and getting all children pages into rows and binded to grid view. It's wokring fine, But i am facing couple of issues with this approach in CMS edit mode.

1) I need to provide "Edit" link to each row and by clicking on this, it should be open the child page in edit mode. I have tried with below code, it is opening but complete header & left menu reloaded inside.

            <a class="js-edit-link" href="@EPiServer.Editor.PageEditing.GetEditUrl(item.ContentLink)">Edit</a>

2) On child page publish, i should be able to redirect to parent page

3) Need to add "Add New" button on top of grid and by clicking on this it should open the child page to add new record.

I am assuming these issues should be addressed with DoJo scripting in CMS edit mode. Can anyone help me on the DoJo script sample references to override the behavior.

Viewing all 6894 articles
Browse latest View live