spacer
GuestLog inor Sign up ?
 
var a = [{text: "Everything", id: "", empty: true, styleClass: "empty"},{text: "*Umbraco (U4)", id: "51-10", empty: false},{text: "Contour (CON)", id: "51-2", empty: false},{text: "our.umbraco.org (OUR)", id: "51-15", empty: false},{text: "Assigned to me", id: "24-1", empty: false},{text: "Commented by me", id: "24-2", empty: false},{text: "Reported by me", id: "24-0", empty: false}]; cr.findGlobal("l.I.sp.filterFolder", []).update(a);
×
Back to Search
Project
*Umbraco
Priority
Normal
Type
Feature (planned)
State
Fixed
Assignee
Shannon Deminick
Difficulty
Normal
Category
Architecture
Backwards compatible?
No
Affected versions
4.10.0
Due in version
4.11.0
Fix submitted
No fix submitted
Event
No event
Support
-
Build
4.11.0.build.692  
,
6.0.1-build.1  
  • Created by   Shannon Deminick
    4 months ago (12 Nov 2012 03:59)
  • Updated by   Sebastiaan Janssen
    6 weeks ago (31 Jan 2013 16:05)
Voters (1)
U4-1178 IPropertyEditorValueConverter should be used when accessing strongly typed properties using GetPropertyValue
1
Issue is visible to: All Users
  The issue is visible to the selected user group only
Links — Show as list
  • Relates to:
Currently IPropertyEditorValueConverter is only used in dynamic property access, it should also be used in strongly typed property access. However, this is only possible with the GetPropertyValue extension methods and overloads, it is not possible with the GetProperty(alias).Value implementation because this is up to the implementation of IPublishedContent and we cannot guarantee this will happen.
Comments (2)
 
History
 
Linked Issues (?)
 
spacer
  Shannon Deminick
12 Nov 2012 05:49
4 months ago
#
I have listed this as a breaking change because:

  • This requires that the overloads to the GetPropertyValue methods of the PublishedContentExtenions class return an 'object' not a 'string'. This is required in order to get the IPropertyEditorValueConverters to work because they can return any object. If we keep the 'string' returned then there is no point in the value converters as it will always be string. The only other option is to create new extension methods which contain the value conversion but this seems silly and redundant. For the most part, people wont even recognize this change since in their views any 'object' gets rendered to it's string equivalent. The only people who might see breaking changes is when doing things like Linq statements. For example, this used to work:

var result = doc.Ancestors().OrderBy(x => x.Level)
    .Single()
    .Descendants()
    .FirstOrDefault(x => x.GetPropertyValue("selectedNodes", "").Split(',').Contains("1173"));

but now that won't compile because GetPropertyValue returns 'object' not string, so you'll have to either cast it to a string or use the strongly typed method:

var result = doc.Ancestors().OrderBy(x => x.Level)
    .Single()
    .Descendants()
    .FirstOrDefault(x => x.GetPropertyValue<string>("selectedNodes", "").Split(',').Contains("1173"));
spacer
  fabrice loudet
26 Nov 2012 07:34
3 months ago
#
<Comment was deleted>
spacer
  Jeroen Breuer
28 Nov 2012 09:19
3 months ago
#
Didn't know this was already implemented in 4.11. It works great! Here is an example which can be used with the DAMP Property Editor Value Converter package:

Strongly typed example
var brandboxImages = brandboxItem.GetPropertyValue<DAMP.PropertyEditorValueConverter.Model>("brandboxImageDamp");
        
<div class="slide">
            
    @foreach(var media in brandboxImages)
    {
        <img src="/img/spacer.gif"> 
gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.