Using Sitecore 8.2 Update 3 with the hot fix for the item/branch/template publishing issue.
We are working on functionality for our client where when certain items are moved, the item:moving event is triggered and the template of the item could be changed to another similar template, used for differentiating item categories.
When looking at one of the renderings in this item, pre-move the rendering has parameters that were set to be different from its standard values (for example, an Amount to Show parameter has a value of 6, while the standard value is 5). After the move and template change, the UI shows that all of the rendering parameters have reverted to their standard values. However, if I look in the raw values of the item and scroll down to the Layout section, in the rendering XML string I can see the rendering parameters set correctly. It also appears the incorrect parameters are being read through to the display code as well, as only 5 items show in the designated rendering, but I see the parameter string in raw values in the web database as well.
I would like to find a fix that doesn't involve the client needing to manually reset parameters that, honestly, look like they're still there in one aspect of Sitecore's data handling.
EDIT: The code I'm using to implement the change is this (where
MasterDb have been established):
TemplateItem newTemplate = MasterDb.GetTemplate([templateId]); item.ChangeTemplate(newTemplate);
EDIT 2: Interestingly, if I change the template through the content editor back to the original template it started as, the rendering parameters reappear as they should. As far as I know, there's nothing in the rendering parameters that should tie it to template necessarily, especially if I can see the correct raw values.
EDIT 3: I heard back from Sitecore support...no solution as yet, but I confirmed the same behavior happens if I'm in the content editor and use the Change Template functionality in the ribbon.