Bugfix for What's New Web Part & RSS Feed for SharePoint

Several people reported some problems with the What’s New RSS Feed for SharePoint and the What’s New WebPart. When a user doesn’t has access to a SharePoint list, both components will try to obtain the necessary rights: the webpart will prompt for a new login and the RSS Feed will produce some “unexpected behaviour”. Before I jump into the technical details, here are the links to download the latest versions:

For each SharePoint list on a SharePoint site, the components need to check if the currently logged on user has rights to view the list. I did this using following line:
list.Permissions.DoesUserHavePermissions(SPRights.ViewListItems)
It seems that there are some problems using the DoesUserHavePermissions method, Philip Wheat goes into detail. Patrick Tisseghem recently posted his solution, and Philip responded. Anyway, I’ve used following code snippet to solve the issue:
private bool UserCanViewListItems(SPWeb web, SPList list)
{
            try
            {
                      list.Permissions.CheckPermissions(Microsoft.SharePoint.SPRights.ViewListItems);
                      return true;
            }
            catch
            {
                      return false;
            }
}
To use the function make sure you set the CatchAccessDeniedException property of the current site to false, eg:
web.Site.CatchAccessDeniedException = false;

Kudos to the SharePoint community: thanks guys!

33 Comments

  • Jan,



    I was attempting to use the What's New part and ran into a bug.



    I have a list on my site named fpdatasources. When the part tries to access the DefaultViewURL property, it causes a NullReferenceException.



    Ping me if you need more info.



  • Paul, a quick work around would be to exclude this list by using the ExcludeLists parameters. Thanks for the information!



  • I thought of the same thing. However, the part never renders for me to set the exclusion. I wrapped the entire RenderWebPart method in a try/catch block (and swallow the exception) so that the part displays. Then, I entered the exclusion.

  • Jan, Thanks for providing great tools for WSS! I had a small problem--initially I installed essentials 1.1.1.0, then today saw you had an update 1.1.2.0. I neglected to uninstall the original before installing the update--everything works, but now I have duplicate entries for all 4 of the web parts in my virtual server gallery. I then tried to remove both and only reinstall the update but still have duplicates. Know how to remove them? Thanks in advance!

  • Okay, I guess it was an easy question...tracked down your original installation instructions before you created the .msi package and discovered the part about the wwwroot/wpcatalog. Removed the duplicate entries there and everything is fine again. Is there anything else I need to remove/delete/change?

  • George: You can uninstall every version, remove the entries from the web.config of the SharePoint site, and delete the corresponding .DWP files in the WP_CATALOG directory. If you have any questions, send me an email using the Contact form.

  • Just a question on the List Permission issue, couldn't just use the ListsForCurrentUser setting?



    So:

    foreach(SPList list in web.Lists)



    becomes:

    SPListCollection listColl=web.Lists;

    listColl.ListsForCurrentUser=true;

    foreach(SPList list in listColl)



    I don't know if you gain performance but code is nicer...



    Cheers,

    Thomas

  • After adding a new link in the Links list, the url and description will be the title in the What's new web part. Can I configure it so that it only displays the description part?

    Thanks.

  • Hey Jan I'm trying to install your webpart, I've tried to install your Leadit.SharePoint.Essentials 1.1.2.0 web part. It's registered as a safe control but when I try to drag the WebPart into the WebPart Page I get the error, "Cannot add Web Part to the Web Part Page. For more assistance, contact your site administrator." The only thing is, I am the admin :-\ can someone please help me out. I you want drop me an email (tom.caffrey@cromptoncorp.com) Thank you in advance.

  • Hello all,



    I've installed the Essential webParts because Breadcrumbs and Navigation are excellent but I've got a pretty big problem.



    I used the MSI file and let it install all. I said Yes to installing it in the GAC and Yes to the XML security adjustements.



    Everything works fine for all my local machine users who visit the site but none of my domain users to the WSS web can now even access anything as their username/password is always refused.



    My guess is that only Local Users have access to the GAC environment but no Domain Users do. What should I do guys ? I'm not too comfortable with this whole GAC concept.



    Thanks,

    Philippe

  • Hey Jan have you thought about doing a collapsable version of your navigational menu. I have about 100 sites and it takes up too much room to use your navigation one unless of course it was collapsable. If you do this or plan on it, please contact me. caffrey@hartford.edu



    (I'm using your breadcrumbs and nav right now, and they are working perfect.)

  • I still have the problem that the second person on the list of users is said to be the person who made amendments when it was in fact me as (site) Administrator.

    When other users make changes, the web parts gives their name (i.e the problem seems to be only with Administrator).



    Why it is always the second person on the User list, I don't know. I found this out by adding a new user and this became the second on the list. But before you say, I then added another user lower down and the web part still says it was the second user who made the changes.

  • I am having the same navigation problem as Chris, some subsites don't show the correct tree. I have the following:

    Site

    |-Sub1

    |--SubSub1

    |-Sub2



    It shows the whole tree at Site and SubSub1, but Sub1 only shows:

    Site

    |-Sub2



    and Sub1 shows only:

    Site

    |-Sub1

    |--SubSub1



    Start from root and 5 levels is selected for all of them.



    I am running WSS on W2K3 with MSDE.

  • Michael, see if this fixes your problem.



    In "RenderWebPart", add this else clause after the "if(web.ID != childSite.ID)" that is in the "foreach" clause:



    else

    {

    output.Write("<li>{0}</li>", childSite.Title);

    RenderWeb(output, childSite, 1);

    }



    To make it even cleaner, remove the calls to "RenderWeb(output, childSite, 1)" from the if and else blocks and put it after the whole structure.



    Hope this helps!

  • Steve, I would be glad to make the changes to the source, but I have no idea how. I see the source is available for download, but I don't know what to do with it after I modify it. If there is some way I can modify the web part in place I will be glad to do that, though.

  • This works great, but not as expected. I was hoping that it summed up all new items on my entire portal, not just the subsites below one single top site.

  • I try to install leat-it essentials but I when I install it they didn't ask me for the "Code Access Security Options". When I open my site and try to add this web part I have this error "Web Part Error: A Web Part or Web Form Control on this Web Part Page cannot be displayed or imported because it is not registered on this site as safe. "



    Please Help. Thanks

  • I have setup your Leadit.SharePoint.Essentials 1.1.2.0 to use the what news webpart. In the first time all was running fine. But now, after removing the webpart and reinstalling .... I have the following error...

    The "WhatsNew" Web Part appears to be causing a problem. when I launch the default page of the site. I close the webpart in the webpart manager and the the site is welle functionning.
    And within the webpart gallery when I click on the webpart conponent the following message :
    Value does not fall within the expected range.

    thanks ... frdt@redcross-fr.be

  • I try to installt the Webpart with the MSI-Installer. The Install works korrekt, but i can not use the Webpart.

    Whats wrong?

  • The What's New Web Part suddenly stopped working for me. Not just displaying incorrectly or anything, but a bonafide WSS Web Part error being unable to display.

  • I tried to inject the navigation webpart into a master page (not inside a web part zone), and although it displays properly on the page and in split mode of Sharepoint Designer, the web interface Site Settings--Master Page tells me that my "system master page" is not valid.

    So this means it can't be correctly inherited by subsites, nor can I attach this master page to content pages so that the navigation webpart is consistent across all my sites.

    Any idea as to what is making my page invalid?

  • I've had these webparts up and working on my portals and they are fantastic. I recently did a server move and was unable to get the webparts to move with the portal. I figured I'd just re-install it and now I can't do that either. The problem is that even though the installer asks permission to write to the GAC nothing is ever put in it? I've logged on as a Domain and Local admin. Has anyone else run into this issue? I know with the 1.1.1.0 the .dll was right there in the packaging so I could add it manually, why is the 1.1.2.0 dll not in the package so I can put it in manually or is it somewhere and I just missed it. Any help would be great feel free to e-mail me: chucky303@msn.com. Thanks

    Justin

  • I don't get it, what idiot designed the wss object model? Return true or throw an exception, c'mon ...

  • Jan, Thanks for the parts bro. Quick dumb question....

    If I upgrade to your new webpart Leadit.SharePoint.Essentials 1.1.2.0 from the previous version, what will happen to my current wss sites that use the older webpart?

    Will I have to redeploy the updated webpart to all my wss pages?

    Thanks
    Donavon

  • tried to install this in WSS v3 and didn't seem to work...

    any thoughts?

  • Best generics online:
    pharmacy online. [url=http://www.pharmacy-style.com/]pharmacy online[/url]. erectile dys. [url=http://www.pharmacy-style.com/erectile-dysfunction.htm]erectile dys[/url]. generic viagra. [url=http://www.pharmacy-style.com/viagra.htm]generic viagra[/url]. generic cialis. [url=http://www.pharmacy-style.com/cialis.htm]generic cialis[/url]. generic levitra. [url=http://www.pharmacy-style.com/levitra.htm]generic levitra[/url]. viagra soft. [url=http://www.pharmacy-style.com/viagra-soft.htm]viagra soft[/url]. cialis soft. [url=http://www.pharmacy-style.com/cialis-soft.htm]cialis soft[/url].

  • Jan,

    Does this webpart display for Portal 2003? I have looked at similar webparts, and they seem to be written for WSS not SPS. Can you help me? Saw a post about it displaying the C(site number) in the breadcrumb trail, but it should as that is part of the trail. Anyway, looks llike something I can use.

    You can e-mail me at dale.pratz@definition6.com

    Thanks in advance,
    Dale


  • sexy shemale sex sex date shemale shemale pantie hose sex shemale having sex with woman shemale sex site black gallery sex shemale xxx shemale sex cam hard sex shemale free video clip of shemale sex free shemale sex site

  • Jan? Is it working with WSS 3.0?

    Thanks

  • Hi Jan

    I am trying to get this working but if I install it I don;t see it to add it on my site.
    Is there anything I am missing?

  • Hi Jan

    Ok after finding my cab file I installed the webparts, but I keep getting an error with the webpart and then it ask me to close it..
    Is there any way for me to get this working? I really want to test the What's New webpart?
    Thanks
    Chris


  • I am trying to load balance 2 SharePoint WSS 2.0 SPS 2003 servers pointing to the same SQL database and am coming up with an issue with your LeadIt Navigation webpart.

    If its installed via server 1 on a page and then i view the page on server 2 i get an error that the webpart can not be displyaed. I delete this webpart and add it again on the page from Server 2 and its viewable. But when I go back to server 1 to view page I get the error again.

    I have confirmed that this is installed identically on both servers but cant for the life of me figure out why this is happening.

    Anyone have any ideas? One of my goals for 2007 was to get these servers load balanced by EOY.

    fyi... waiting to see if MOSS is approved as a project so I can upgrade in 2008.. cross your fingers.


  • I've gotten this work on WSS 3.0 by adding 'Master Page Gallery' to the exclusion list. You might need to modify the "Lead-it WhatsNew.dwp" with the following:
    Master Page Gallery

    Hope this works for others.

Comments have been disabled for this content.