Monday, April 2, 2012

Java script error when trying to change Page Layout

Recently, I faced a weird issue with SharePoint publishing pages and changing the layout of the page. I was able to add a new publishing page with different layouts in a pages library. But when I try to change the page layout of an existing page, I got a java script error in cui.debug.js. Just like the one below, I was not even be able to get the drop down with different page layouts to change


To fix this issue I had to debug the java script (CUI.debug.js) file in IE 8 or greater using the Developer tools. Once the exception occurred in the java script, traced the function calls using the "Call Stack" option and found a variable "$v_0.PopulationXML" and inspected the XML in VS and found the malformed XML.



After some research, I came to know that there was a orphaned page layout in the "Master Pages and Page Layouts" gallery. I was testing something else with page layout and content type relationships and left it there. But I removed the content type associated with the page layout.

After I deleted the particular page layout from the gallery, everything started to work fine.

Thanks
Senthil S

No comments:

Post a Comment