U4-2229 - PublishWithSubs broken in 4.11.8

Created by Dee Milic 13 May 2013, 23:05:07 Updated by Sebastiaan Janssen 28 May 2013, 17:35:33

In Umbraco 4.11.8, when calling PublishWithSubs, the following error occurs:

System.ServiceModel.FaultException: Server was unable to process request. ---> Umbraco Exception (DataLayer): SQL helper exception in ExecuteNonQuery ---> There are more columns in the INSERT statement than values specified in the VALUES clause. The number of values in the VALUES clause must match the number of columns specified in the INSERT statement.

Further investigation found that the issue lies in the following line of code (umbraco.cms.businesslogic.web.Document) in the PublishWithSubs method:

CMSNode.SqlHelper.ExecuteNonQuery(string.Concat(new object[] { "insert into cmsDocument (nodeId, published, documentUser, versionId, updateDate, Text) values (", base.Id, ", 0, ", u.Id, ", @versionId, @text)" }), new IParameter[] { CMSNode.SqlHelper.CreateParameter("@versionId", guid), CMSNode.SqlHelper.CreateParameter("@updateDate", now), CMSNode.SqlHelper.CreateParameter("@text", this.Text) });

Specifically:

"insert into cmsDocument (nodeId, published, documentUser, versionId, updateDate, Text) values (", base.Id, ", 0, ", u.Id, ", @versionId, @text)"

Basically, updatedDate value is missing in the sql statement. The actual value is there in the parameters, so the fix is quick and easy - just add @updateDate to the SQL statement:

"insert into cmsDocument (nodeId, published, documentUser, versionId, updateDate, Text) values (", base.Id, ", 0, ", u.Id, ", @versionId, @updateDate, @text)"

[Edit]: Patch included

1 Attachments

Download 5387.patch

Comments

Sebastiaan Janssen 28 May 2013, 17:35:23

Thanks for the fix! Added in changeset f9a5218fd0b5


Priority: Normal

Type: Exception

State: Fixed

Assignee:

Difficulty: Easy

Category:

Backwards Compatible: True

Fix Submitted: Patch

Affected versions: 4.11.8

Due in version: 4.11.9

Sprint:

Story Points:

Cycle: