Breaking Changes - sf:my-user-control
My User Controls that I registered in the toolbox are broken
Once you install 4.1 your user controls that you registered in the toolbox all break if you used hyphens in the paths.
ex: ~/UserControls/some-user-control.ascx
If you had this registered in your toolbox your application will be broken when you upgrade to 4.1.
Hi Jaime Weise,
My bad. There is a problem and it comes by the fact that the class naming in .NET does not allow hypens to be used. When we are registering user controls to the page we create a tag sf:UsercontrolName. What you will have to do is
1) Go to the ToolboxesConfig.config file under ~/App_Data/Sitefinity/Confiturations/ and change the control type attribute of your user controls not to use hyphens.
2) Rename the your user control files so that they do not use those hyphens.
3) Run a script similar to the bellow one to fix controls added to pages:
var pageManager = PageManager.GetManager();
var brokenControls = pageManager.GetControls<PageControl>().Where(c => c.ObjectType.Contains(
"some-user-control.ascx"
));
foreach
(PageControl brokenControl
in
brokenControls)
brokenControl.ObjectType =
"~/UserControls/someusercontrol.ascx"
;
pageManager.SaveChanges();
var brokenDraftControls = pageManager.GetControls<PageControl>().Where(c => c.ObjectType.Contains(
"some-user-control.ascx"
));
foreach
(PageControl brokenDraftControl
in
brokenDraftControls)
brokenDraftControl.ObjectType =
"~/UserControls/someusercontrol.ascx"
;
pageManager.SaveChanges();
Sure, but this should be fixed in future versions. It is pretty annoying since I have about 30 controls where the folders and control names are all hyphenated.
This worked before 4.1
I will try the script