Fixes null exception issue when using 'umbracoFile' as the alias of an upload property. Work items: 30980
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user