Fixes null exception issue when using 'umbracoFile' as the alias of an upload property. Work items: 30980

This commit is contained in:
hartvig
2012-08-09 06:41:30 -02:00
parent 493e5c7734
commit 39d0f95c2e
2 changed files with 5 additions and 3 deletions

View File

@@ -512,6 +512,9 @@ namespace umbraco.cms.businesslogic
Guid newVersion = Guid.NewGuid();
bool tempHasVersion = hasVersion();
// we need to ensure that a version in the db exist before we add related data
SqlHelper.ExecuteNonQuery("Insert into cmsContentVersion (ContentId,versionId) values (" + this.Id + ",'" + newVersion + "')");
foreach (propertytype.PropertyType pt in this.ContentType.PropertyTypes)
{
object oldValue = "";
@@ -526,7 +529,6 @@ namespace umbraco.cms.businesslogic
property.Property p = this.addProperty(pt, newVersion);
if (oldValue != null && oldValue.ToString() != "") p.Value = oldValue;
}
SqlHelper.ExecuteNonQuery("Insert into cmsContentVersion (ContentId,versionId) values (" + this.Id + ",'" + newVersion + "')");
this.Version = newVersion;
return newVersion;
}

View File

@@ -17,9 +17,9 @@
<appSettings>
<add xdt:Transform="Replace" xdt:Locator="Match(key)" key="umbracoDbDSN"
value="server=.\sqlexpress;database=v47;user id=DBUSER;password=DBPASSWORD"/>
value="server=.\sqlexpress;database=481;user id=DBUSER;password=DBPASSWORD"/>
<add xdt:Transform="Replace" xdt:Locator="Match(key)" key="umbracoConfigurationStatus"
value="4.7.0.beta"/>
value="4.8.1"/>
</appSettings>
<system.web>