{"action":"created","issue":{"url":"https://api.github.com/repos/n2cms/n2cms/issues/668","labels_url":"https://api.github.com/repos/n2cms/n2cms/issues/668/labels{/name}","comments_url":"https://api.github.com/repos/n2cms/n2cms/issues/668/comments","events_url":"https://api.github.com/repos/n2cms/n2cms/issues/668/events","html_url":"https://github.com/n2cms/n2cms/issues/668","id":108021995,"number":668,"title":"Error when adding EditableNumber to ContentItem with eisting records","user":{"login":"kodeo","id":996340,"avatar_url":"https://avatars.githubusercontent.com/u/996340?v=3","gravatar_id":"","url":"https://api.github.com/users/kodeo","html_url":"https://github.com/kodeo","followers_url":"https://api.github.com/users/kodeo/followers","following_url":"https://api.github.com/users/kodeo/following{/other_user}","gists_url":"https://api.github.com/users/kodeo/gists{/gist_id}","starred_url":"https://api.github.com/users/kodeo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kodeo/subscriptions","organizations_url":"https://api.github.com/users/kodeo/orgs","repos_url":"https://api.github.com/users/kodeo/repos","events_url":"https://api.github.com/users/kodeo/events{/privacy}","received_events_url":"https://api.github.com/users/kodeo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-09-23T22:44:11Z","updated_at":"2015-10-03T06:22:54Z","closed_at":null,"body":"Adding a new `[EditableNumber]` field of type `double` or `decimal` to a record with existing content results in a `Specified cast is not valid` error when attempting to edit an existing record.\r\n\r\n    Line 122:            PropertyInfo info = item.GetType().GetProperty(expression);\r\n    Line 123:            if (info != null)\r\n    Line 124:                return info.GetValue(item, new object[0]);\r\n    Line 125:            else if (expression.IndexOf('.') > 0)\r\n    Line 126:            {\r\n\r\n**Source File**: C:\\dev_temp\\n2cms-master\\src\\Framework\\N2\\Utility.cs    **Line**: 124 \r\n\r\nI'm fairly sure in earlier n2cms versions the newly added numeric used to default to a zero in its new input element."},"comment":{"url":"https://api.github.com/repos/n2cms/n2cms/issues/comments/145209564","html_url":"https://github.com/n2cms/n2cms/issues/668#issuecomment-145209564","issue_url":"https://api.github.com/repos/n2cms/n2cms/issues/668","id":145209564,"user":{"login":"bherila","id":1422004,"avatar_url":"https://avatars.githubusercontent.com/u/1422004?v=3","gravatar_id":"","url":"https://api.github.com/users/bherila","html_url":"https://github.com/bherila","followers_url":"https://api.github.com/users/bherila/followers","following_url":"https://api.github.com/users/bherila/following{/other_user}","gists_url":"https://api.github.com/users/bherila/gists{/gist_id}","starred_url":"https://api.github.com/users/bherila/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bherila/subscriptions","organizations_url":"https://api.github.com/users/bherila/orgs","repos_url":"https://api.github.com/users/bherila/repos","events_url":"https://api.github.com/users/bherila/events{/privacy}","received_events_url":"https://api.github.com/users/bherila/received_events","type":"User","site_admin":false},"created_at":"2015-10-03T06:22:54Z","updated_at":"2015-10-03T06:22:54Z","body":"Sorry, I misunderstood your initial issue. I thought you were changing a member from (e.g.) decimal to double. I think the issue is that N2 is trying to cast `null` to the desired type and it's not working. The proper fix would detect the `null` value and then use `default(T)` to populate the correct value.\r\n\r\nDoes it work if you make the field `double?` or `decimal?`?"}}