Try our conversational search powered by Generative AI!

Lee Crowe
Nov 2, 2011
  3657
(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
Optimizely and the never-ending story of the missing globe!

I've worked with Optimizely CMS for 14 years, and there are two things I'm obsessed with: Link validation and the globe that keeps disappearing on...

Tomas Hensrud Gulla | Apr 18, 2024 | Syndicated blog

Visitor Groups Usage Report For Optimizely CMS 12

This add-on offers detailed information on how visitor groups are used and how effective they are within Optimizely CMS. Editors can monitor and...

Adnan Zameer | Apr 18, 2024 | Syndicated blog

Azure AI Language – Abstractive Summarisation in Optimizely CMS

In this article, I show how the abstraction summarisation feature provided by the Azure AI Language platform, can be used within Optimizely CMS to...

Anil Patel | Apr 18, 2024 | Syndicated blog

Fix your Search & Navigation (Find) indexing job, please

Once upon a time, a colleague asked me to look into a customer database with weird spikes in database log usage. (You might start to wonder why I a...

Quan Mai | Apr 17, 2024 | Syndicated blog