Question

I want to have a feature which will change some settings on every list on My Site. Problem is i cant change settings for two main list: Shared and Personal Documents.

For testing I have web feature which write to file all web lists titles when activating and list added events. I have second feature which is stapler defined for global template and start first feature on every new site.

When activating on existing site all is ok. When creating my site for new user I have only these lists:

Content type publishing error log
Converted Forms
Customized Reports
Form Templates
Hold Reports
Holds
List Template Gallery
Master Page Gallery
Solution Gallery
Style Library
TaxonomyHiddenList
Theme Gallery
User Information List
Web Part Gallery
wfpub

And listAdded is not fired.

What is special about these two lists that I can't attach to them?

Was it helpful?

Solution

The issue is the lists get created after the feature stapling is called in the Site Collection creation process. The My Site is a new Site Collection, not a new subsite, that's why the event receivers don't fire and the manual activation works.

I have used a thread pool solution like the one in the link below to delay the execution until the lists have been created. You can then modify the settings of them. It takes a while to get the timings correct, so make sure you test thoroughly.

http://social.technet.microsoft.com/Forums/en-US/sharepoint2010programming/thread/68382352-c751-4dea-a67f-69533ee442f6/

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top