Error when used in a site template

Topics: Developer Forum, Project Management Forum, User Forum
Jul 1, 2008 at 9:40 AM

Thank you for this pretty WebPart.

I have a little trouble when using it in a site template.
When i create a site from a template containing the Document Libray Browser Web Part, i get this error :
 Error : FillTreeView. 
System.ArgumentException: L'affichage spécifié n'est pas valide. à Microsoft.SharePoint.SPViewCollection.get_Item(Guid guid) à Stramit.WP.DocumentLibraryBrowser.FillTreeView()

By just opening the configuration part and clicking OK, all gets right. It sounds like the web part is created before the document Library.

Here are the steps to reproduce the problem.
1) Create a site
2) Create a document library in this site
3) On the home page (using a web part page template ) of this site, add a Document Library Browser web part (either static or dynamic; i didn't test the multi).
4) Attach it to the document library.
5) Create a site template from this site.
6) Create a new site using the template
7) Get to the newly created site home page and see the error message...

Is there any workaround other than opening the configuration part ?

Thank you for your help...

Oct 13, 2008 at 1:38 PM

Did you ever get a solution to this problem?

// Jarle
Oct 14, 2008 at 10:03 PM
The problem with the webparts is that they assume you have told it what view that is to be used to let the webprt know what items are to be shown. But if you have created a site from a template containing a page with one of the webparts, they don't know what view that should be used.

I have corrected the code so that is uses the default view in the cases where it does not know what view to use. If you are interested in the changes, please let me know.

// Jarle
Oct 6, 2009 at 6:51 PM

I have the error now, only with certain users, ???