Welcome Back Mr. Prather!

Maurice just got back from a 2.5 month vacation 🙂

I couldn’t help but think of welcoming him back if I just didn’t do it in style 🙂

For those not old enough to remember Welcome Back Kotter, sorry 🙂

Welcome back

Your dreams were your ticket out.

Welcome back

To that same old place that you laughed about.

Well the IPs have all changed since you hung around,

But those dreams have remained and they’re turned around

Who’d have thought they’d lead ya (Who’d have thought they’d lead ya)

Back here where we need ya (Here where we need ya)

Yeah we tease him alot, cause his power’s always out.

Welcome back.

Welcome back, welcome back, welcome back!

Oh Oh Oh Mr. Kotter!! (I mean Mr. Prather!)

Welcome back buddy 🙂

 – Keith

Deep thoughts by Supermom

My wife just posted this blog entry on her MySpace.  The key thing I’d like to bring out about this post, is the final paragraph in which she notes:

“Giving to others does not have to be grand or expensive. Sometimes it is the most simple things that make the biggest difference. No I can not change the world, just my corner and you can help in your corner. World issues will always be there, we can not change that. We can however put a smile on someones face.

I would encourage you to read the entire post when you have a moment.

Now, I’m going to take a small break, walk out of the office and give her a big hug 🙂

 – Keith

SPWeb.Configuration, bug?

I ran across this the other day while debugging something and thought I would share.

At first, I thought it was a problem in the site building tool I wrote and was using, but later confirmed this to be a problem even in a subweb created from the SharePoint UI.

What I saw

My test sites were generated from my SPSiteBuilder tool that uses SPWebCollection.Add(“site-relative URL”)

V2 Reference

http://msdn2.microsoft.com/en-us/library/ms980143.aspx

V3 Reference

http://msdn2.microsoft.com/en-us/library/ms411806.aspx

When you use this overloaded version of the Add method, in V2, it sets the sites template to the default STS#0 (Default Team Site), and thus SPWeb.Configuration results in 0.  In V3, it still works the same because you can immediately browse the site and it’s just fine, yet SPWeb.Configuration results in -1.

For example, given the following sample code:


public
static
void InspectWeb(SPWeb web, bool bRecurse)

{


Console.WriteLine(“web.Url: “ + web.Url);


Console.WriteLine(“web.ID: “ + web.ID);


Console.WriteLine(“web.Configuration: “ + web.Configuration);


if (bRecurse)

{


foreach (SPWeb subweb in web.Webs)

{

InspectWeb(subweb, bRecurse);

}

}

}

And the web was opened with by passing the URL to the SPSite Constructor, then calling SPSite.OpenWeb()

If I open the parent web first, and recurse I get the following:

C:\dev\sometool http://krichiewss3/sites/SPSiteBuilderSite1

web.Url: http://krichiewss3/sites/SPSiteBuilderSite1

web.ID: 58faab9c-9bb6-46c6-9f99-46a08b5555b0

web.Configuration: 0

web.Url: http://krichiewss3/sites/SPSiteBuilderSite1/SPSiteBuilderSite1_d1_w1

web.ID: 866311ca-c2a0-4d45-941f-ff1551b2954b

web.Configuration: -1

 

Yet, if I use the same code directly at that web:

C:\dev\sometool http://krichiewss3/sites/SPSiteBuilderSite1/SPSiteBuilderSite1_d1_w1

web.Url: http://krichiewss3/sites/SPSiteBuilderSite1/SPSiteBuilderSite1_d1_w1

web.ID: 866311ca-c2a0-4d45-941f-ff1551b2954b

web.Configuration: 0

 

What I found

At first, I thought it was a bug in the SPWebCollection.Add() method. But I just confirmed that you get back the same result when you create a subweb via the UI as well. See below:

 

C:\dev\sometool http://krichiewss3/sites/SPSiteBuilderSite1

web.Url: http://krichiewss3/sites/SPSiteBuilderSite1

web.ID: 58faab9c-9bb6-46c6-9f99-46a08b5555b0

web.Configuration: 0

web.Url: http://krichiewss3/sites/SPSiteBuilderSite1/SPSiteBuilderSite1_d1_w1

web.ID: 866311ca-c2a0-4d45-941f-ff1551b2954b

web.Configuration: -1

web.Url: http://krichiewss3/sites/SPSiteBuilderSite1/UICreatedWeb

web.ID: 130d7487-aa29-4774-b7db-c0a1e048edef

web.Configuration: -1

 

In the following test, I created the Site Collection and the subweb both in the SharePoint UI without custom code, yet enumerating the sub webs via SPWeb.Webs still produces the same result

C:\dev\sometool http://krichiewss3/sites/UICreatedSite

web.Url: http://krichiewss3/sites/UICreatedSite

web.ID: 907eacbe-f673-4c9a-be28-6c3f29bbf9ee

web.Configuration: 0

web.Url: http://krichiewss3/sites/UICreatedSite/UICreatedWeb

web.ID: 97798d22-c3b3-45ea-9bd8-a6b6e9150312

web.Configuration: -1

And if I just open that web directly:

C:\dev\sometool http://krichiewss3/sites/UICreatedSite/UICreatedWeb

web.Url: http://krichiewss3/sites/UICreatedSite/UICreatedWeb

web.ID: 97798d22-c3b3-45ea-9bd8-a6b6e9150312

web.Configuration: 0

 

I see no references to this property being neither deprecated nor obsolete. And I’ll need to let the powers that be know about it, just wanted to share with you that this appears to be a problem in WSS/MOSS RTM bits.

Then again, I could be missing something here, but you get two different results for SPWeb.Configuration depending on how you get a reference to the web.

  • Keith Richie