Lee Crowe
Nov 2, 2011
  3797
(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
Recraft's image generation with AI-Assistant for Optimizely

Recraft V3 model is outperforming all other models in the image generation space and we are happy to share: Recraft's new model is now available fo...

Luc Gosso (MVP) | Nov 8, 2024 | Syndicated blog

ExcludeDeleted(): Prevent Trashed Content from Appearing in Search Results

Introduction In Optimizely CMS, content that is moved to the trash can still appear in search results if it’s not explicitly excluded using the...

Ashish Rasal | Nov 7, 2024

CMS + CMP + Graph integration

We have just released a new package https://nuget.optimizely.com/package/?id=EPiServer.Cms.WelcomeIntegration.Graph which changes the way CMS fetch...

Bartosz Sekula | Nov 5, 2024

Block type selection doesn't work

Imagine you're trying to create a new block in a specific content area. You click the "Create" link, expecting to see a CMS modal with a list of...

Damian Smutek | Nov 4, 2024 | Syndicated blog

.NET 8 FAQ

I have previously written about .NET compatibility in general and .NET 8 in particular, see blog posts here , here and here . With the end of suppo...

Magnus Rahl | Nov 4, 2024

Dynamic packages in Commerce Connect

In Optimizely Commerce Connect, you can group different items using packages and bundles. Package: A package has one or more versions of a product...

K Khan | Nov 1, 2024