Caveat for customaction registration when list exists on parent site
I found a problem where I was expecting a web feature with a content type registration custom action to enable a custom menu item on a sub-site. The document library DraftDocuments with a specific content type id lived on the root site. Sub-sites had views of this document library. I was attempting to activate the feature on the sub sites thinking it would use the menu items defined there when rendering the view of the list. Turns out, the feature needed to be activated on the root site (Where the document library lives).
Situation: Https://wwwSiteHere/
Document Library "DraftDocuments"
Https://wwwSiteHear/SubSiteA/
Page with view of DraftDocuments limited by specific content type Activated feature here with RegistrationType=ContentType here for custom action. Expectation was that custom action would be visible, but it wasn't.
Feature needed to be activated on https://wwwSiteHere/
I think this page should include a warning that the custom action registrations need to be enabled by a feature on the web that is hosting the document library that the custom actions are intended for. That information was missing for my scenario causing much confusion.
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
- ID: 36340596-ef52-b6b1-c9e0-f8ab54b83e85
- Version Independent ID: 7590fbd4-7f7c-8806-e9ed-e6626c4c1b8c
- Content: CustomAction Element
- Content Source: docs/schema/customaction-element.md
- Service: sharepoint-online
- GitHub Login: @VesaJuvonen
- Microsoft Alias: vesaj
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.
Scope where the action is enabled depends on the scope of the feature to which the CustomAction element is associated. If the scope of that feature is Site then the CustomAction is associated automatically at site collection level, including all sub sites. If the scope of the feature is Web, then feature needs to be activated on each site.
So - the scope of the CustomAction is not controlled in the CustomAction element level, it's controlled on the feature level and depends on the Scope attribute of that - and where it's being activated.
Good thing to clarify at least in these comments as well.
Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues