Hi Stefano,
I'm not an expert in the internal database structure of umbraco, but I would assume
that every template has an entry in db with it's own unique key-id. And the document types refer to this id, but not the name of the templates. So when you delete a referenced template and add a new one with same name, it neverless gets its new own key-id. This new one is of course not referenced by your existing doc types.
Simple solution: Update the doc type references to the templates manually in the Umbraco backend.
Difficuilt solution:
Create and add an package action handler which will do basicly follow steps:
- get the current id of the name of the template to replace, e.g. MyTemplate - ID: 1234
- remove this current template,
- rename your new added template to the old name (this is the template you are about to update, (to avoid the error you described you must give the update template inside the package a different name to the existing one, e.g. MyTemplate_Update)
- change the ID of this new added template back to the ID of the old one (1234).
For this solution you must be able to write C# code. For more informations refer to:
Package Actions Contrib.
May be helpful: For this way you can use my little Package Action Tester:
http://www.ucc-bln.de/en/2009/3/28/package-action-tester.aspxImmo