Posted on 20 January 2007 @ 19:53
in #MOSS 2007
Today I ran into an error while creating page layouts using a feature. I made a mistake in the XML that provisions the files to install with the feature for my page layouts. My problem was an incorrect value in the attribute for the content type ID linked to my installed page layout.
After realizing my mistake and correcting it, uninstalling the feature and reinstalling it again the original incorrect page layout was still installed. This seems to be normal in SharePoint. Even when deactivating and uninstalling a page layouts feature these pages still stay in the "Master Page and Page Layout Gallery". I still have to find the right documentation on why this happens but I imagine it has to do with ghosting of the pages.
Now back to my problem. Since the incorrect page layout was still installed and giving me error messages I tried to delete it manually from the gallery. This gave me the following error message:
"This item cannot be deleted because it is still referenced by other pages"
Even if this is not the case (there was no page using this page layout), the problem is mentioned in the following KB article:
http://support.microsoft.com/?kbid=926812
The KB proposes to change the properties of the master page to Hidden. This workaround did not solve my problem since everytime I tried to access the page layout's Properties screen I got another error message due to my mistake discussed above.
There was however one workaround that solved the problem:
- Create a new sub-folder in the master page gallery
- Move the page layout to the new folder (I did this by using SharePoint Designer)
- In the MOSS interface, delete the complete folder by using the dropdown menu.
Yep, my page layout is finally gone from the gallery!
While my problem was specific to a page layout I think the same solution will work with master pages as well.
|
Posted on 30 March 2007 @ 00:32
Great post! I've been looking for information on this. Thanks
|
Posted on 07 August 2007 @ 11:35
Great ! The workaround proposed by MS did not solve my issue, but your solution did. I confirm it works also for master pages.
|
Posted on 30 October 2007 @ 22:04
Thanks -- this has been a very annoying issue for me with MOSS 2007 -- solved now thanks to you!
|
Posted on 31 October 2007 @ 19:03
Thanks as well for this post, solved my problem too. Very annoying!
|
Posted on 22 November 2007 @ 16:05
Great Hack... I, too, have been looking for a way to solve this issue. Thanks
|
Posted on 09 January 2008 @ 19:35
Wish I could move the file through the code such as this:
SPFolder cleanupFolder = null;
try
{
cleanupFolder = web.Folders["_catalogs"].SubFolders["Delete"];
}
catch
{
cleanupFolder = web.Folders["_catalogs"].SubFolders.Add("Delete");
}
if (cleanupFolder != null)
{
//Fails right here through code - SUCKS big time!
customFile.MoveTo("_catalogs/Delete", true);
cleanupFolder.Delete();
}
|
Posted on 11 February 2008 @ 23:06
Awesome... making a folder in the master page gallery w/ SharePoint Designer, moving the bad master pages in it and deleting the folder from SharePoint Designer worked like a charm.
|
Posted on 05 March 2008 @ 13:11
Thanks, I'd not come across this problem before, and now I've had it twice in a week. You solution worked fine - but how the heck did you figure that out?
|
Posted on 19 March 2008 @ 23:32
You could also open it up in explorer view and create a new folder and move the file (i.e. you don't need to do this in SP designer)
|
Posted on 08 May 2008 @ 10:06
|
Posted on 14 May 2008 @ 05:44
I encountered similar issue with a masterpage. I tried your solution and viola!... it works very nicely! Wicked solution! Your workaround has helped me a lot. Thanks for sharing this :)
|
Posted on 30 June 2008 @ 14:12
thanks very much, great help! :-)
|
Posted on 06 July 2008 @ 08:34
Thanks a lot. It worked with master pages also (MOSS2007).
|
Posted on 22 July 2008 @ 06:33
Nice one, solved my problem trying to delete master pages. Thanks.
|
Posted on 10 September 2008 @ 06:31
Hi Katrien,
I've run into what I think might be the same problem. From the site's Content Management section - when viewing associated resources for the page in the Master Page Gallery - I can see it uses itself.
I suspect this is a problem similar to the one you described, so I am curious - what did you need to do to resolve this for you?
Kind regards,
Pascal
|
Posted on 10 December 2008 @ 14:48
This post really helped me out! Thanks!
|
Posted on 12 December 2008 @ 09:46
|
Posted on 26 May 2009 @ 22:07
Great post!! you saved my lot of time!!!!
Thanks so much.
|
Posted on 16 June 2009 @ 22:41
Nice one, this was so annoying. I love your work around it worked perfectly!
|
Posted on 16 June 2009 @ 22:42
BTW it fully works for master pages also!
|
Posted on 20 August 2009 @ 19:41
Simple and effective...nicely done.
|
Posted on 27 January 2010 @ 14:07
excellent, works perfectly. suprising how little microsoft knows about their own product as most solutions come from website administrators!
|