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

Can't search using the Content Search API. Does an instance of IContentApiSearchProvider exists, or do I write my own?

$
0
0

I have installed the Content Delivery API in my solution, and everytime I generate a search request in Postman, I get an error saying:

"ExceptionMessage": "An error occurred when trying to create a controller of type 'ContentApiSearchController'. Make sure that the controller has a parameterless public constructor."

And this is due to the fact that no instance of IContentApiSearchProvider has been added to the dependency resolver.

According to the Episerver documentation, the Content Search API makes use of Episerver Find to query content, and I have Episerver Find installed in my solution. Is there anything, that I might have missed here?


SavingContent event - update block content - values not updated

$
0
0

Hi!

I am updating content on a block in the SavingContent event.

    [InitializableModule]
    [ModuleDependency(typeof(EPiServer.Web.InitializationModule))]
    public class BlockEventsInitialization : IInitializableModule
    {
        private IContentEvents _events;
        public void Initialize(InitializationEngine context)
        {
            _events = ServiceLocator.Current.GetInstance();
            _events.SavingContent += SavingContent;
        }
        private void SavingContent(object sender, ContentEventArgs e)
        {
            var block = e.Content as MyTestBlock;
            if (block != null)
            {
                block.Text = "New text";
                e.Content = block as IContent;
            }
        }
        public void Uninitialize(InitializationEngine context)
        {
            _events.SavingContent -= SavingContent;
        }
    }

In my case I am replacing blocks in a ContentArea, this is just a small example with the same result.

The Text property does not say "New text" until I reload the page, hitting "Ready to Publish", actually publish the block or go to another block/page and then go back the block I am updating.

I do not want to publish my changes, just save.

Anyone have an idea how to update values without reloading or publish the block?

/Magnus

Possible ISelectionQuery bug for GetItemByValue

$
0
0

I've implemented ISelectionQuery to provide a select items from an API. The GetItems query works and sets the property on my block, but when loading that block again the lookup is blank, even though the value is set.

I've ran this in a debugger and found that GetItemByValue always has a value of empty string rather than the string value stored in the property.
Is this a bug?

Programmatically move ContentAreaItem from one Content Area to other Content Area

$
0
0

I am trying to programmatically move content area item from one content area to the other content area but with no luck. 

I made web api controller that sends the page Id from the DOJO widget.

From that page ID I loaded the page detatils via IContentRepository and made a writable clone. Then I load block by content reference and insert that block as new content area item and that part is ok. Than I try to remove the content area item from the other content area and ii debug that is done but on the site it is still there. I am certan that this has something to do with the page versions (drafts).

Part of the code (one version of the code):

var contentRepository = ServiceLocator.Current.GetInstance<IContentRepository>();

var pageRef = new PageReference(data.Id);
var page = contentRepository.Get<LayoutPage>(pageRef);
var pageClone = (LayoutPage)page.CreateWritableClone();

if (pageClone.SecondColumnContentArea != null)
{
     foreach (var areaItem in page.SecondColumnContentArea.Items)
    {
         var block = contentRepository.Get<IContent>(areaItem.ContentLink);
         pageClone.FirstColumnContentArea.Items.Add(new ContentAreaItem
        {
             ContentLink = block.ContentLink
         });
     }

     pageClone.SecondColumnContentArea.Items.Clear();

}

contentRepository.Save((IContent)pageClone, SaveAction.Default | SaveAction.ForceCurrentVersion, AccessLevel.Edit);

I tried all combinations with SaveAction flags and always is the same result.

Any ideas? Did somebody tried something similar?

Cannot call action method 'Void GetFormExternalResources exception during MapMvcAttributeRoutes() after update to 4.24.3

$
0
0

After updating forms to 4.23.3, my website throws the following exception during routeCollection.MapMvcAttributeRoutes():

System.ArgumentException: 'Cannot call action method 'Void GetFormExternalResources(System.Collections.Generic.List`1[System.String] ByRef, System.Collections.Generic.List`1[System.String] ByRef)' on controller 'EPiServer.Forms.Controllers.FormContainerBlockController' because the parameter 'System.Collections.Generic.List`1[System.String]& scripts' is passed by reference.
Parameter name: methodInfo'

Has anyone else encountered this, how to resolve the issue?

Hiding Submit Button Until Form is Filled In

$
0
0

Is there a way to disable/hide the submit button until all fields are filled in? With the latest forms update, the Dependencies tab shows up on all the form fields but the submit button. Is this something that was omitted intentionally, or should I be seeing this tab on the submit configuration as well?

Same form twice on page, validator validates both forms

$
0
0

Hi there,

Our users would like to add the same form twice to the page. I guess once near the top and again close to the bottom of the page (not here to debate whether this is good or bad).

After doing some testing, I noticed that if I add the same form twice to the page then the following happens:

Scenario 1

If I fill out the top form only and click submit, I get form input validation errors for both forms and no form is sent off. I guess this is because in the 2nd instance of the form, the input fields are empty, so as far as the validator is concerned something is wrong.

Scenario 2

If I fill out the bottom form only and click submit, then the bottom form is sent off properly, but the button on the top form displayes a circle (it is waiting for feedback on form success I guess).

Is there anything I can do to allow:

  • the same form to be added mutiple times to the same page, and
  • for the validator to validate only the instance that has been clicked

?

Any ideas how to approach this?
What files do I need to look into? (Am new to EPiServer development and did not get very far yet).

Export page with ContentReference to external data (custom ContentProvider and MappedIdentity)

$
0
0

I've implemented a custom ContentProvider and am using MappedIdentity to map to external data, quite similar to this blog post by patkleef:
https://www.patrickvankleef.com/2016/12/11/ascend16-load-and-use-data-from-google-contacts-in-episerver/

All is well, I can map an external id to a ContentReference and the ContentProvider creates IContent properly.

However it seems to have broken the export/import data functionality in CMS/admin. Once I try to export a page with a ContentReference to my custom ContentProvider it breaks. 

I know there's a way to add DDS data to the export, as we're doing it for Geta Tags: https://github.com/Geta/Tags/blob/master/src/TagsTransferModule.cs#L21
However, I'm not storing data in DDS and the DynamicDataTransferHandler is the only TransferHandler that's configured (in Alloy).

Does anyone know how/if you can export MappedIdentities or if there's a different TransferHandler I can use?

The error I receive during export:
"The following errors have occurred:
[Exporting content 244] Exception: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index[]
[Exporting content 244] Can't export package because: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index"


Can't search using the Content Search API. Does an instance of IContentApiSearchProvider exists, or do I write my own?

$
0
0

I have installed the Content Delivery API in my solution, and everytime I generate a search request in Postman, I get an error saying:

"ExceptionMessage": "An error occurred when trying to create a controller of type 'ContentApiSearchController'. Make sure that the controller has a parameterless public constructor."

And this is due to the fact that no instance of IContentApiSearchProvider has been added to the dependency resolver.

According to the Episerver documentation, the Content Search API makes use of Episerver Find to query content, and I have Episerver Find installed in my solution. Is there anything, that I might have missed here?

Disable Episerver Find Temporarily

$
0
0

I swear there's a setting for this but can't for the love of me find it.

I'm doing a bulk update in code and need to ideally in code completely disable find indexing temporarily.

Has anyone got the code for this?

Filter to support Fallback language

$
0
0

Hi I have the following filter where i have to match the language and category id to get the Articles.

So for example get me all Articles that have en-GB languageBranch and Category ID 20 Or en-GB languageBranch and Category ID 21 and so forth e.t.c.

How can i modify this filter to handle fallback language for example en-AU language branch or other fallback languages? If the Article that doesnt exist in en-GB with Catgegory ID 21 , than return the Article with en-AU and Catgeory ID 21. No matter what i do i get duplicate articles for Catgeory Id 21 (One in en-GB and one in en-AU)

public static ITypeSearch<T> MatchCategories<T>(this ITypeSearch<T> search, string languageBranch, List<int> categories) where T : PageData
{
var taxonomyBuilder = search.Client.BuildFilter<T>();

foreach (var category in categories)
{
taxonomyBuilder = taxonomyBuilder.Or(x => x.LanguageBranch.MatchCaseInsensitive(languageBranch) & x.Category.Match(category));
}

return search.orFilter(taxonomyBuilder);
}

Page type restriction to root page

$
0
0

Hi,

  I need to apply page type restriction to root page structure.My cms site page root structure look like this:

   - Root

     -The Table

      -Home

       -Page 1

         -Page 2

          -Page 3

I want to restrict Page 1,page 2 with same page type and page 3 with another page type.Is it possible to implement in cms.

Thanks

EPiServer 11 and SQL Server Web Edition

$
0
0

Hi everyone,

For a customer we are considering the use of Sql Server Web edition over the Standard edition.
Does anyone know if there are there limitations in the Web edition or other arguments why it is better to stick to the Standard edition?

thanks in advance!

Override tab order for a particular page type

$
0
0

Hi,

First of all, i'm very new to EpiServer, so please forgive me for any blatantly incorrect assumptions I might make.

I'm currently reording/restructuring tabs and properties for a particular page type according to a client's specifications and as far as I can tell, tabs are defined globally as are the order values for each tab. Is it possible to change the ordering of tabs for a particular page type without affecting the ordering of others? And if so, how might I go about it?

Thanks for any help you might be able to provide.

Localization for Validation property

$
0
0

As per this thread https://world.episerver.com/forum/developer-forum/Developer-to-developer/Thread-Container/2015/8/localized-property-name-in-validation/ we can fetch localized validation property display name by casting it to PageData type. But we have this limitation set to BlockData, ContentData Block types. How can we update this line of code for specific block type within content area?

var propertyDefinitionId = ((PageData) validationContext.ObjectInstance).Property[propertyName].PropertyDefinitionID;

Configure Azure AD redirect url with wild card

$
0
0

Hi guys,

I got problem when using AAD to login after certain minutes, when login session is timeout EPiServer will redirect to Microsoft login page with current page url of user for AAD to redirect after login. If current page url is not as same as defined Redirect url in AAD, Microsoft login page will display message “AADSTS50011: The reply url specified in the request does not match the reply urls configured for the application”.

Is there any workaround this issue?

I use EPiServer 11.12

User uploaded files may be publicly available

$
0
0

Hi,

Episerver Forms 4.25.0 restricts access to uploaded files by removing the "Everyone" role and leaving everything else as-is. If the instance has defined additional read access for Visitor Groups, Users or other Groups, these remain and allow the users to read the uploaded files without special privileges.

These users, especially "Anonymous" role, should not have any visibility to the uploaded files.

Is this an intentional feature or a security issue? I would be happy to find a more secure workaround to restrict the file access from all but the content editors.

Please see method 
EPiServer.Forms.Core.Internal.DataSubmissionService.GetOrCreateFolderForStoringFiles() in EPiServer.Forms.Core.dll for details.

Connect for Microsoft Dynamics CRM - Error Authenticating

$
0
0

Hi,

We have the latest version 4.2 of the following package installed on a project which sits within DXC EPiServer.MarketingAutomationIntegration.MSDynamics

However our client is unable to connect to their CRM instance using the admin tool

I am assured that the credentials inputted are correct.

Is there any other configuration our client should be aware of? Such as for example permissions neccessary for the CRM user they are using to connect.

The EPiServer user guide linked from this page is no longer online: https://world.episerver.com/documentation/developer-guides/marketing-automation-connectors/connect-for-ms-dynamics-crm/

Thanks in advance!

 

Content Delivery API - 403 for CatalogContent for CatalogNode

$
0
0

Hello,

We have installed the latest Content Delivery API with all the extras like OAuth and Search.

I have setup the contentapiread access group and gave it full rights to the root.

I have also added the following in the web.config.

<add name="contentapiread" type="EPiServer.Security.MappedRole, EPiServer.Framework" roles="WebAdmins, Administrators, WebEditors" mode="Any" />

Set on the ROOT

I have also created a ContentDeliveryApiInitialization class and just added.

public void ConfigureContainer(ServiceConfigurationContext context)
{

context.Services.Configure<ContentApiConfiguration>(config =>
{
config.Default().SetMinimumRoles(string.Empty);
});
}

I have managed to make a successfull call to a product with the following query.

api/episerver/v2.0/content/7AF43301-CDAE-4A46-AACD-A618ECAB7B35 returned 200 with the data as expected.

Then I made another call with the api/episerver/v2.0/content/21bafbbb-b9a6-49f0-850c-547be8eba851 and it returned a 403 - Forbidden: Access is denied.

This is the parentlink of the previous call's response. Basically, I want to get the Product's parent which is the CatalogNode or Category.

Any advice that I can use to get around this problem?

EPiServer Find - AWS vs On-Premise Installation

$
0
0

Hello,

Due to security restrictions, I would like to determine which of the above options is best suited for me.

I would prefer the On-Premise installation (To avoid creating rules + opening ports in firewall),

UNLESS The On-Premise installation still needs to access an outside/3rd party service for some reason - in that case, the firewall will have to be opened either way.

So i guess my question is does the On-Premise installation consume any 3rd party services? and if so, for what purpose?

Thanks,

Ron

Viewing all 6894 articles
Browse latest View live