Description of problem: If I create a ContentType called TestType, delete it, and create it again, I get an exception. This appears to be due to the object type not being cleared from the persistence Metadata. java.lang.IllegalArgumentException: duplicate key: com.arsdigita.cms.TestType at com.arsdigita.persistence.proto.metadata.Mist.add(Mist.java(Compiled Code)) at com.arsdigita.persistence.proto.metadata.Root.addObjectType(Root.java:93) at com.arsdigita.metadata.DynamicObjectType.(DynamicObjectType.java:189) at com.arsdigita.metadata.DynamicObjectType.(DynamicObjectType.java:137) at com.arsdigita.cms.ui.type.CreateType.process(CreateType.java:264) at com.arsdigita.bebop.FormSection.fireProcess(FormSection.java:491) at com.arsdigita.bebop.FormSection$4.process(FormSection.java:465) at com.arsdigita.bebop.FormModel.fireFormProcess(FormModel.java:478) at com.arsdigita.bebop.FormModel.process(FormModel.java:345) at com.arsdigita.bebop.Form.process(Form.java:440) at com.arsdigita.bebop.Form.respond(Form.java:281) at com.arsdigita.bebop.PageState.respond(PageState.java:348) at com.arsdigita.bebop.Page.process(Page.java:695) at com.arsdigita.bebop.Page.process(Page.java:677) at com.arsdigita.bebop.Page.buildDocument(Page.java:731) at com.arsdigita.cms.dispatcher.CMSPage$1.excurse(CMSPage.java:262) at com.arsdigita.cms.CMSExcursion.run(CMSExcursion.java:71) at com.arsdigita.cms.dispatcher.CMSPage.dispatch(CMSPage.java:270) at com.arsdigita.cms.dispatcher.CMSDispatcher.dispatch(CMSDispatcher.java:257) at com.arsdigita.cms.dispatcher.CMSDispatcher.chainedDispatch(CMSDispatcher.java:337) at com.arsdigita.dispatcher.DispatcherChain.dispatch(DispatcherChain.java:74) at com.arsdigita.cms.ContentSectionServlet.doService(ContentSectionServlet.java:134)
Marked as blocking as I think it's a regression.
Oops. Had block order switched.
I don't believe this has ever worked since there is in fact no way to delete an object type, and there never has been. The delete link on the type detail pane actually just removes the item from the section and so it no longer appears in the list, but it doesn't actually get deleted. I've improved the validation code so that we do detect this situation and report it as an error to the user rather than throw an exception, but the behavior is still undesirable since if you create an object type and then delete it, you will never be able to create an object type with that name again.
Given comments above and non-regression status, marking QA_READY. Deleting content types is probably uncommon on a prod system and something we're not going to support right now.