Try our conversational search powered by Generative AI!

Lee Crowe
Nov 2, 2011
  3663
(1 votes)

ElencySolutions.MultipleProperty v1.3 Released

Last week it came to my attention that there was an issue when using list based properties with my MultipleProperty assembly within a composer function.

The issue that was occurring was that when the list had only one item the changes were not saved/updated but as soon as there were 2 or more items everything worked fine.

Confused smile

This has confused me and to be honest I am still confused by this issue.  There is no logic within my property data or property data control implementation that checks the number of items and works differently based on them.

For some reason when there was only one item and the function data was being saved the PropertyData object was being instantiated but the Property Control was not being created and therefore ApplyEditChanges was never called.

I tried reflecting the composer code but it didn’t really give me any clues.

The issue only seems to occur when there were no other properties on the composer form!

But fortunately I found a solution Smile


The Solution

I am not too happy with the solution outlined below but it seems to do the job so it’s all good as far as I am concerned.

The MultipleProperty assembly now has a new property named MultiplePropertyComposerFixProperty this property has it’s own associated control that inhertis the PropertyString control but the key difference is the table row is set to not be visible.

To fix the issue you will need to add the following code to your Global.asax.cs:

  1: protected void Application_PostMapRequestHandler(object sender, EventArgs e)
  2: {
  3:    MultiplePropertyHelper.ConfigureForComposer();
  4: }

Essentially what this code does is get hold of the Current IHttpHandler and checks whether the handler dealing with the request is the composer property editor page.

If the page is the composer property editor then when the page InitComplete event fires it will use some dirty reflection to add the MultiplePropertyComposerFixProperty property to the Properties and RenderedProperties PropertyDataCollection objects that belong to the PropertyDataFormFactory.

From the small amount of testing I have done this seems to fix the issue.

As I said this is not a clean solution but seems to work.

Installation

The assembly is dependent on EPiServer CMS 6 and onwards.

The easiest way to install the assembly is to get it from the EPiServer nuget feed or you can download it from codeplex.

Release notes

- Minor UI tweaks

- Composer related issue described above.

Feedback

Feedback as always is greatly received.  If there are bugs/issues please feel free to email or twitter me @croweman

Nov 02, 2011

Comments

Please login to comment.
Latest blogs
Azure AI Language – Extractive Summarisation in Optimizely CMS

In this article, I demonstrate how extractive summarisation, provided by the Azure AI Language platform, can be leveraged to produce a set of summa...

Anil Patel | Apr 26, 2024 | Syndicated blog

Optimizely Unit Testing Using CmsContentScaffolding Package

Introduction Unit tests shouldn't be created just for business logic, but also for the content and rules defined for content creation (available...

MilosR | Apr 26, 2024

Solving the mystery of high memory usage

Sometimes, my work is easy, the problem could be resolved with one look (when I’m lucky enough to look at where it needs to be looked, just like th...

Quan Mai | Apr 22, 2024 | Syndicated blog

Search & Navigation reporting improvements

From version 16.1.0 there are some updates on the statistics pages: Add pagination to search phrase list Allows choosing a custom date range to get...

Phong | Apr 22, 2024