If you have 2 templates with the same name, then you need to delete one of them. I am using 4.5 and was getting that 'deleting...' and not doing anything as I had a document type which had the template I wanted to delete checked in the list of allowed templates. So, what I had to do was uncheck the template I wanted to delete from the list of allowed templates from any document types that they were selected on.
Just ran into the same issue. Added this to the codeplex site.
Any ideas?
So I had the bright idea to manually go in and delete the item from the database. I change the templateId in the cmsDocument table to Null for all references to the template. Then removed the reference in cmsDocumentType. Then was able to delete the entries in cmsTemplate. Now, my Template Folder won't even display any templates and i get the following error:
At /umbraco/webservices/TreeDataService.ashx?rnd=a2bfe1de5e864b14b263d20c3e8acde4&id=-1&treeType=templates&contextMenu=true&isDialog=false&rnd2=33.8 (Referred by: http://localhost/umbraco/umbraco.aspx):
At this point, I'm hosed and don't know where to go from here.
Chad: I was pretty close to start editing th DB myself, but to afraid to start mess up something :) Have an appointment with my DB administrator tomorrow, so I'll hope we'll figure out something then. Though I really hope there is an easyer way than start fiddling with the cmsTables. I'll get back to u on how it wen't with my DBA guy.
I wish I could give @jbreuer19 a hive five, since he just saved my behind.
Apparently, even though there isn't a data dependency, you still have to delete the item in UmbracoNodes table. I had some data conflicts, but once I fixed those, my templates folder now contains content again and I'm saved!
You can still thank me ;). Glad your problem is solved. Had the exact same thing today. Don't know why the data also needs to be removed from the umbracoNode table, but that fixes it.
OK, so it was 10 months ago that there was any activity in this thread, but I'm experiencing this same problem where i cannot delete a template and am not getting a helpful message, my guess is because there are older document versions that still reference my template and thus are preventing its deletion.
It's impossible to delete a template if you have a document/node which uses this template. This seems logical, but if you give the document another template you still can't delete the old template because the document/node still has a relation to the old template in an old version of the document/node. You should be able to delete the template if the newest version of the document/node doesn't use the template.
Although the work item says this was "resolved", I'm not sure how that is the case, since in my 4.7.1 installation when I right-click to delete the template, i get this very confusing message in the bubble:
I have made certain that I have no current documents or document types referencing this template. (I checked the [cmsDocument] and [cmsDocumentType] tables to ensure this.) However, I **do** see lots of prior document versions that still reference my template.
So it seems that the only way to delete a template that (A) was once used somewhere and (B) is no longer needed, you need to crack open the database and reset a bunch of templateId references in the cmsDocument table first. Then you can probably delete the template from the backoffice. It would be nice if the backoffice would do this for you as a prerequisite step. (See following comment for why I think this should be the assumption)
...
One final note: there is a comment in the aforementioned work item from Hartvig himself that says:
This won't be changed as it makes perfectly sense in a versioned environment. As the template is associated to an old version of the document it's only natural that it can't be deleted. I agree on the message though!
I am having a hard time accepting this claim, because while yes the documents themselves are versioned, the templates are not. For example, if I have an archived (older) document that is referencing a templateID of 1234, that doesn't mean anything, since template 1234 may have been changed a dozen times since then. Thus, why should the number 1234 be so significant as to require permanent archiving?
Thank you for reading this, and hopefully this helps someone else running into this same problem!
As an alternative workaround, I have also used the "UnVersion" package to remove older versions of pages without having to resort to mucking in the db -- though I've done that as well :)
I understand and agree that the current issues with changing templates is not ideal.
can't delete a template
Always remain in the 'deleting' , "network service" aave sufficient authority.
thanks for help
Sra,
IIS may have a lock on the template, try recycling the app pool / website.
Thanks,
Chris.
Still does not work, what there are other reasons?
Check to make sure that you don't have 2 templates with the same name or 2 templates with the same alias.
I was also having this problem and in order to delete the template, I had to remove it from all the allowed template sections in my document types.
yes, i had 2 templates with the same name.
Do you mean delete document types first?
There was a bug in 4.5 that was fixed in 4.5.1 related to showing "deleting..." and not doing anything.
generally you want to check if there are no pages still using the template, this prevents it from being deleted.
Thanks a lot, I've started a 4.5.1.
If you have 2 templates with the same name, then you need to delete one of them. I am using 4.5 and was getting that 'deleting...' and not doing anything as I had a document type which had the template I wanted to delete checked in the list of allowed templates. So, what I had to do was uncheck the template I wanted to delete from the list of allowed templates from any document types that they were selected on.
I renamed one of the templates so that they don't have the same name and alias. Then it allowed me to delete. I am using 4.5.1
I'm using Umbraco 4.5.2 and still have these problems. Should this already have been fixed?
Jeroen
Jeroen: Im on same versjon (and .net 4.0) having the same problem.
I've created a workitem for this which also explains why it doesn't work. Please vote for it: http://umbraco.codeplex.com/workitem/29306.
Jeroen
Just voted for it :)
But, are there no easy solution for getting rid of templates that I "accedentialy" created with same alias?
Just ran into the same issue. Added this to the codeplex site.
Any ideas?
So I had the bright idea to manually go in and delete the item from the database. I change the templateId in the cmsDocument table to Null for all references to the template. Then removed the reference in cmsDocumentType. Then was able to delete the entries in cmsTemplate. Now, my Template Folder won't even display any templates and i get the following error:
At /umbraco/webservices/TreeDataService.ashx?rnd=a2bfe1de5e864b14b263d20c3e8acde4&id=-1&treeType=templates&contextMenu=true&isDialog=false&rnd2=33.8 (Referred by: http://localhost/umbraco/umbraco.aspx):
At this point, I'm hosed and don't know where to go from here.
Chad: I was pretty close to start editing th DB myself, but to afraid to start mess up something :)
Have an appointment with my DB administrator tomorrow, so I'll hope we'll figure out something then.
Though I really hope there is an easyer way than start fiddling with the cmsTables.
I'll get back to u on how it wen't with my DBA guy.
I wish I could give @jbreuer19 a hive five, since he just saved my behind.
Apparently, even though there isn't a data dependency, you still have to delete the item in UmbracoNodes table. I had some data conflicts, but once I fixed those, my templates folder now contains content again and I'm saved!
Thanks!
You can still thank me ;). Glad your problem is solved. Had the exact same thing today. Don't know why the data also needs to be removed from the umbracoNode table, but that fixes it.
Jeroen
Working my carma up. when it's passing 70, you'll get a High Five jeroen and Chad
I can actually delete templates again :)
Free cup of tea for you guys at next codegarden :)
Thanks Jeroen & Chad for the hint about also deleting from umbracoNode table - just saved my bacon.
OK, so it was 10 months ago that there was any activity in this thread, but I'm experiencing this same problem where i cannot delete a template and am not getting a helpful message, my guess is because there are older document versions that still reference my template and thus are preventing its deletion.
The descritpion in the work item at http://umbraco.codeplex.com/workitem/29306 is exactly what I would have guessed is happening to me:
Although the work item says this was "resolved", I'm not sure how that is the case, since in my 4.7.1 installation when I right-click to delete the template, i get this very confusing message in the bubble:
I have made certain that I have no current documents or document types referencing this template. (I checked the [cmsDocument] and [cmsDocumentType] tables to ensure this.) However, I **do** see lots of prior document versions that still reference my template.
So it seems that the only way to delete a template that (A) was once used somewhere and (B) is no longer needed, you need to crack open the database and reset a bunch of templateId references in the cmsDocument table first. Then you can probably delete the template from the backoffice. It would be nice if the backoffice would do this for you as a prerequisite step. (See following comment for why I think this should be the assumption)
...
One final note: there is a comment in the aforementioned work item from Hartvig himself that says:
I am having a hard time accepting this claim, because while yes the documents themselves are versioned, the templates are not. For example, if I have an archived (older) document that is referencing a templateID of 1234, that doesn't mean anything, since template 1234 may have been changed a dozen times since then. Thus, why should the number 1234 be so significant as to require permanent archiving?
Thank you for reading this, and hopefully this helps someone else running into this same problem!
As an alternative workaround, I have also used the "UnVersion" package to remove older versions of pages without having to resort to mucking in the db -- though I've done that as well :)
I understand and agree that the current issues with changing templates is not ideal.
Jonathan
is working on a reply...