Copied to clipboard

Flag this post as spam?

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


  • clinco 1 post 23 karma points
    Apr 11, 2011 @ 13:38
    clinco
    2

    Error deleting template (SQL helper exception in ExcuteNonQuery) v4.7

    I have search around the forum but can not find previous posts.  When we attempt to delete/remove a template that is no longer in use we are receiving the following error- Error handling action: Umbraco Exception (DataLayer): SQL helper exception in ExecuteNonQuery.  If we create a new template and attempt to delete it immediately it works fine.   There are several templates that can not be removed; however, they can be renamed and moved around (under different master templates, etc).

    Setup info

    Windows 2008 R2 IIS7.5
    SQL Server 2005 SP3
    Umbraco 4.7 (upgraded from original v4.5 installation to v4.6 then to v4.7)

    )

  • dillorscroft 193 posts 187 karma points
    Apr 11, 2011 @ 17:19
    dillorscroft
    0

    I've just come across the exact same issue.  

    Any ideas anyone?

  • Laurence Gillian 595 posts 1211 karma points
    Apr 18, 2011 @ 19:19
    Laurence Gillian
    0

    Just come across the same issue too!

  • Sony 20 posts 40 karma points
    Apr 22, 2011 @ 09:05
    Sony
    0

     i too had this issue..

    i tried deleting references(nodes at content section) related to the templates and even from recycle bin..

    it worked

  • jivan thapa 193 posts 659 karma points
    Apr 24, 2011 @ 00:57
    jivan thapa
    8

    if you did not assign template. Open Any document type and assign template first. back to template and delete. it worked for me.

  • Matt Taylor 813 posts 1903 karma points
    Jul 25, 2011 @ 10:50
    Matt Taylor
    0

    I just had the same problem. I couldn't find any references to the template being used within the content or doc type structure.

    Jivan's answer worked for me. I just assigned the template to one of the doc types and then I was able to delete the template.

    Cheers,

    Matt

  • Tony Bolton 83 posts 109 karma points
    Aug 02, 2011 @ 22:23
    Tony Bolton
    0

    At the risk of sounding like a 'me-to', I can also confirm Jivan's answer sorted out the problem.

    Close call - nearly resorted to tweaking the database - yikes!

  • Henri Toivonen 77 posts 111 karma points
    Dec 05, 2011 @ 12:16
    Henri Toivonen
    0

    Wow, weird bug. And it's still there with 4.7.1

  • Jarrod McGuire 1 post 21 karma points
    Feb 09, 2012 @ 15:41
    Jarrod McGuire
    0

    Can confirm as well that the post from jivan helped me out. I had deliberately removed the template associations first because I thought that would have caused the error! Who would have thought...

  • Jeroen Breuer 4860 posts 12127 karma points MVP 3x admin c-trib
    Feb 09, 2012 @ 15:51
    Jeroen Breuer
    0

    Could also be related to this: http://umbraco.codeplex.com/workitem/29306

    Jeroen

  • Palak 3 posts 24 karma points
    May 29, 2012 @ 10:52
    Palak
    1

    I was facing the same problem. But assign any document type with the template we want to remove first. Then go back to that template and delete it. This worked for me.

  • Kyle Skrinak 272 posts 327 karma points
    Jul 19, 2012 @ 20:53
    Kyle Skrinak
    0

    Worked for me too, but does the business rule follow? Wouldn't you want to only be able to delete non-linked objects?

  • suzyb 458 posts 864 karma points
    Dec 18, 2012 @ 12:49
    suzyb
    0

    Over a year later and Jivan's solution worked for me on version 4.9.1.

  • Troels Larsen 75 posts 280 karma points
    Dec 20, 2012 @ 18:00
    Troels Larsen
    0

    Dont u get a more detailed description in the log ? should tell u what relation it has problems with. 

  • Luke Alderton 191 posts 508 karma points
    Mar 19, 2013 @ 14:13
    Luke Alderton
    0

    Same problem on 4.11.5, Jivan's answer corrected the problem. Maybe this is an issue that needs looking into?

  • Pavel Gurecki 55 posts 158 karma points
    Apr 04, 2013 @ 13:33
    Pavel Gurecki
    0

    Same problem on v6.0.3, Jivan's solution worked

  • Robert 11 posts 31 karma points
    May 24, 2013 @ 11:01
    Robert
    0

    Worked for me too. Thanks!

    Robert

  • Dan Diplo 1463 posts 5637 karma points MVP 3x c-trib
    Jun 11, 2013 @ 21:52
    Dan Diplo
    0

    Unbelievably this is still true in 6.11!

  • Sebastiaan Janssen 4847 posts 14391 karma points MVP admin hq
    Jun 24, 2013 @ 12:27
    Sebastiaan Janssen
    0

    Would love to fix it but I don't know how to reproduce the issue. If anyone can tell me what I'm missing I can have a look: http://issues.umbraco.org/issue/U4-2356

  • Funka! 398 posts 660 karma points
    Aug 31, 2013 @ 03:15
    Funka!
    2

    Here are some more detailed steps to reproduce this problem which still exists in 6.1.3. There are a few weird conditions I think others have been missing in trying to reproduce this. I just ran through this very carefully and can reproduce this 100% of the time now. Here's how:

    1. Create a new Document Type called "Deleter Tester" and leave the "Create matching template" box checked.

    2. Create a new document in your site based on this new DeleterTester document type. Name it "Deleter Doc".

    3. Now hit the "Save and Publish" button to ensure this page gets published. (Note that the Audit Trail now has two saved versions of this document in the cmsDocument table.)

    4. Go back to settings and edit the "Deleter Tester" document type. UNCHECK all allowed templates and save the document type.

    5. Now go try to delete the "Deleter Tester" template. (In my case, this was created by default as an MVC view but same problem exists in older WebForms/master pages as well if I recall.) You will get a SQL Exception because of the foreign key reference from cmsDocument to cmsTemplate

    The weird thing is this:

    • If you delete the "Deleter Doc" content node, and then purge it from the recycle bin, you can now delete the template. (Historical audit trail was wiped, no more database references to the cmsTemplate table.)

    • Or, if you go back to any document type and allow the "Deleter Tester" template as one of the choices, ... for some reason now when you try to delete the template, it somehow knows to clean up the old historical references in the cmsDocument table and actually lets you delete the template??

    So. There you go! Hope this helps....

  • Dan Diplo 1463 posts 5637 karma points MVP 3x c-trib
    Aug 31, 2013 @ 12:35
    Dan Diplo
    0

    Nice work, Funka - great to have a definitive way of showing this in action. Hopefully it will help get it fixed.

  • Dincer M. 35 posts 97 karma points
    Dec 27, 2013 @ 04:57
    Dincer M.
    0

    Umbraco v6.1.6 (Assembly version: 1.0.5021.24867)

    Same problem, same solution :-)

  • Benjamin 21 posts 114 karma points
    Mar 19, 2014 @ 11:34
    Benjamin
    0

    Umbraco v 7.0.4 (Assembly version:1.0.5161.21054 )

    Same problem, same solution... :-)

    Here anyone reported this ??

  • Dan Diplo 1463 posts 5637 karma points MVP 3x c-trib
    Mar 19, 2014 @ 21:05
    Dan Diplo
    0

    Yes, I reported it here -> http://issues.umbraco.org/issue/U4-2356  

    Kinda felt that no one believed me, though :)

  • Mark 49 posts 130 karma points
    May 15, 2014 @ 06:45
    Mark
    1

    think I've fixed this in a pull request - https://github.com/umbraco/Umbraco-CMS/pull/379

    was a highly anoying bug!

  • Tom Fulton 2030 posts 4984 karma points c-trib
    May 17, 2014 @ 06:24
    Tom Fulton
    0

    Woohoo - nice work, Mark! #h5yr

  • c0deguy 2 posts 22 karma points
    Dec 30, 2014 @ 21:42
    c0deguy
    0

    ironically after all this time and with the newest 6.2 install...this is still the fix, I can confirm you do indeed have to assign it (use it) before deletion can be completed.  really awkward bug.

Please Sign in or register to post replies

Write your reply to:

Draft