Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Simon Dingley 1474 posts 3431 karma points c-trib
    Feb 19, 2013 @ 15:14
    Simon Dingley
    0

    Document PublishWithSubs Call Throwing Exception

    I have another project I've inherited from an agency that is somewhat of a mess. I'm finishing up a migration from 4.0.2 - 4.11.4 and I have one outstanding issue. There is an API call to PublishWithSubs, something I've never used before - is it still relevant?

    The API call is resulting in the following exception:

    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.

    This will all be refactored in time but for now I just need to get the site back online so refactoring the minimum required at present.

    Thanks

  • Dee 2 posts 23 karma points
    May 14, 2013 @ 00:45
    Dee
    1

    Yeah, I ran into the same issue this morning and it looks like the PublishWithSubs method is broken - we are using Umbraco 4.11.8. The line that is supposed to insert data into the database is missing the updateDate value:

    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)"

     

    I will submit a bug.

     

     

  • Dee 2 posts 23 karma points
    May 14, 2013 @ 01:46
    Dee
    0

    Quick update - issue submitted, but in the meantime you can use PublishWithChildrenWithResult instead of PublishWithSubs.

    Hope this helps.

Please Sign in or register to post replies

Write your reply to:

Draft