Vulnerability in EPiServer.Forms
Shared/global blocks seem to get lost if you change their namespace. The block instances in the 'Blocks-explorer' in editmode is fine, but all pages that have blocks attatched to them all get empty content areas all-of-a-sudden.
Steps to reproduce:
- Install EPiServer 7 and Alloy demosite
- Change namespace on any of the block classes used on the startpage (for example JumbotronBlock or TeaserBlock)
- Browse the startpage to see that the blocks are gone
Whether this is a bug or a feature i don´t know. Is there a workaround for this scenario?
This is "by design" since model type is stored in database. Possible workaround is to change a value in ModelType field in tblContentType table.
In addition to Sergii's answer, if you want to be able to rename a class representing a content types, you need to add a guid to the ContentType attribute. If it's a new type you can use any guid. If the class has already been registered as a content type you need to use the guid stored in the database for that type. You can find the content type guid in admin mode.
Though Per is correct in the statement that you should provide a GUID to the content type attribute this is already done in the template package and there seems to be a bug when you only change namespace and keep the old name. I have filed the following bug for this: Bug #91601: Blocks are not synchronized with model if you only change namespace and keep the same class name.
The workaround for now is to change the class name temporarilly to trigger and sync, start the site, and then change it back (if you want to...). For instance JumbotronBlock = [new namespace].JumbotronBlock2 + start site = [new namespace].JumbotronBlock + start site