Shared/global blocks disapear after changing namespace

Vote:
 

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?

#63161
Nov 12, 2012 13:09
Vote:
 

Hello Niklas,

This is "by design" since model type is stored in database. Possible workaround is to change a value in ModelType field in tblContentType table.

#63170
Edited, Nov 12, 2012 15:18
Vote:
 

Hi

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.

Regards

Per Gunsarfs

 

#63177
Nov 12, 2012 17:09
Vote:
 

Hi!

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

#63257
Edited, Nov 13, 2012 13:40
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.