Friday, March 20, 2009

Empty ULS (12 Hive) Logs

I was looking into turning on the Usage Analysis Processing and poked into the 12 hive LOGS folder as that is where Usage Analysis log files are stored. I noticed that the ULS log files (which are normally huge, since SharePoint logs every thing it does), were all 0kb. I thought I had this problem before but could not find any answers, so I started searching. I finally found a blog that talked about empty MOSS logs and it jogged my memory that one of the things that will fix this is to restart the Timer job service.



So I went into the services and restarted the Windows SharePoint Services Tracing and Windows SharePoint Services Timer services and the minute they were reset, the logs started filling up.



I have not found a reason for them to stop logging yet, but I am still looking.

Labels: ,

Tuesday, March 10, 2009

Postback Events Don't Fire In FireFox

Today I was looking at our Internet-facing SharePoint site after my roommate told me that the language drop down was not working in Firefox. I thought for sure it must have been something that changed in Firefox since it still worked in IE, Safari, and Chrome. I did some research to see if other people were having any problems with drop down lists or post backs in Firefox and I found many posts about similar problems but none of them matched my case.



Then I found a post where someone was having the same problem and that after hours of them searching for what was wrong, they found that their form tag was outside the body tag. So I poked into SharePoint Designer for my master pages and sure enough my form tag was way up at the top just within the HTML tag and not inside the body tag like it should be.



I have had problems with this before where SPD will move the location of code because it thinks that is where the code should go. This time it nearly caused me to pull out my hair. So if you find that post backs aren't working in Firefox only you may want to check the location of your form tag and make sure that it is inside the body tag.

Labels: ,

Tuesday, March 3, 2009

When IsVisible is not really Visible....

Today I was faced with an interesting project. I have some external users of the Intranet site I am working on that need to only see one list of items on the Intranet site. What makes this tricky is that I have customized the Quick Launch navigation so that every link (and even the headings) are custom, which means SharePoint will not security trim them.



I began searching for ways to hide items in the Quick Launch when I came across a post by Todd Baginski that talked about programmatically adding and removing items from the Quick Launch menu. I followed down the article and found the SPNavigationNode object and decided to search the MSDN for that class. I found a property called IsVisible that allows you to set whether the Menu Item is visible or not. Great!! I thought. This is exactly what I need to hide these items for this external group of users. I added the lines of code to set the property:



menuItem.IsVisible = False

menuItem.Update()

web.Update()



When changing the properties for items such as Menu Items, List Items, or Lists, you should always call the Update method to update the properties. I called the SPWeb.Update method for good measure to make sure that the menu item was updated.



Ran the page and guess what, the menu item was still there. So I checked further into the Internet and found a some people that agreed that the property does not work. So I submitted a question on the MSDN forums and will see if this is a Microsoft bug and if there is a fix for it.



As for the way I finally decided to hide the menu items is a little bit of a hack. For now I am hiding the entire Quick Launch menu and displaying a custom link that I created just for that group of users. I call this a hack because I had to work around that property bug and because I will need to edit the master page and create a new link from hand any time that group of users needs to see another item in the site.

Labels: ,