IPublishedContent.GetPropertyValue<string> different versions?
IEnumerable<IPublishedContent> pages = UmbracoHelper.TypedContent(NodeId)
.Descendants()
.Where(x => x.IsVisible() && x.DocumentTypeAlias.Equals("TextPage")) /* umbracoNaviHide = False, Document Type name */
.Where(x => x.GetPropertyValue<string>("activityType").Equals("Fotturer")) /* Property name (of a Document Type), Property value */
.Where(x => !String.IsNullOrWhiteSpace(x.GetPropertyValue<string>("turListerCode"))); /* Property name, Property value not null or white space */
This works in Umbraco version 7.7.6, but get an error in Umbraco version 7.3.1 in .Where(x => x.GetPropertyValue<string>("activityType").Equals("Fotturer")) Note that activityType is a data type of dropdown list, and !String.IsNullOrWhiteSpace or !String.IsNullOrEmpty doesn't work like in property value turListerCode below (which is a Umbraco.Textbox).
Anyone who knows why the two different versions behave differently?
And what can I do to eliminate errors in Umbraco version 7.7.6 when GetPropertyValue
In umbracoSettings.config Umbraco version 7.7.6 I'v added these settings below.
Umbraco version 7.3.1 didn't recognized these settings (where I've got an error if none value, the default, is choosen). It works as it should otherwise, just not when empty value is selected. How can I remove this error (see abowe)?
<!-- For LeBlender: Set to false! Activate obsolete Media picker, Content picker, Member picker -->
<!-- Enables value converters for all built in property editors so that they return strongly typed object, recommended for use with Models Builder -->
<EnablePropertyValueConverters>false</EnablePropertyValueConverters>
<!-- For LeBlender: Set to true! Activate obsolete Media picker, Content picker, Member picker -->
<showDeprecatedPropertyEditors>true</showDeprecatedPropertyEditors>
IPublishedContent.GetPropertyValue<string> different versions?
This works in Umbraco version 7.7.6, but get an error in Umbraco version 7.3.1 in
.Where(x => x.GetPropertyValue<string>("activityType").Equals("Fotturer"))
Note that activityType is a data type of dropdown list, and!String.IsNullOrWhiteSpace
or!String.IsNullOrEmpty
doesn't work like in property value turListerCode below (which is a Umbraco.Textbox).Anyone who knows why the two different versions behave differently?
And what can I do to eliminate errors in Umbraco version 7.7.6 when GetPropertyValue
Hi Tom
Are you working with enabled property Value Converters or disabled in version 7.7.6?
Alex
In umbracoSettings.config Umbraco version 7.7.6 I'v added these settings below.
Umbraco version 7.3.1 didn't recognized these settings (where I've got an error if none value, the default, is choosen). It works as it should otherwise, just not when empty value is selected. How can I remove this error (see abowe)?
is working on a reply...