U4-1712 - ApplicationContext.Current.Services.ContentService.GetById() not returning all properties

Created by Vincent Baaij 14 Feb 2013, 10:22:00 Updated by Rob Johnson 22 May 2013, 14:38:37

I have the following setup: Master doctype has tab Content with property umbracoNaviHide Child doctype has property Title (alias: title) which is placed on inherited Content tab (displayed in backoffice as (inherited from ... Master)

In code I do: IContent child = ApplicationContext.Current.Services.ContentService.GetById(child.Id);

When I try to get the Title property with child.GetValue("title")

I get the following error: The given key was not present in the dictionary. Examening the properties in the debugger shows that child indeed has only one property. If I move the Title property away from the inherited Content tab, the property is found and has the correct value.

Comments

Morten Christensen 19 Feb 2013, 16:12:14

@Vincent Is this code used against the 6.0.0 release? I tried to reproduce the issue in the 6.0.1 branch, which already has a bunch of issues fixed and I think this issue might already be fixed. Here is the scenario I tried: Master ContentType "Web" has Content and Seo tab, and the child ContentType "Page" adds a property "pageTitle" to the Content-tab. Getting the property with child.GetValue("pageTitle") works fine.

If possible try to update the assemblies in your bin-folder with those from this latest nightly build: http://nightly.umbraco.org/umbraco%206.0.1/UmbracoCms.6.0.1-build.18.zip


Vincent Baaij 20 Feb 2013, 08:32:12

Morten, This was indeed used against the 6.0.0 release. I've updated to the mentioned nightly and now the code works as expected. Thanks.


Rob Johnson 22 May 2013, 14:37:38

I have moved onto 6.1.0 (beta 2) and this issue is no longer present. However, I have tried to reproduce using 6.0.5 (using Nuget / running from Visual Studio) and no longer can. The only thing I can think of is that there was a unique set of circumstances that caused this problem for me in 6.0.5 at the time.


Priority: Critical

Type: Bug

State: Fixed

Assignee: Morten Christensen

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions: 6.0.0

Due in version: 6.0.1

Sprint:

Story Points:

Cycle: