sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

Caveat for customaction registration when list exists on parent site

Open SPDEVGUY opened this issue 3 years ago • 1 comments

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.

SPDEVGUY avatar Sep 20 '22 23:09 SPDEVGUY

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

ghost avatar Sep 20 '22 23:09 ghost

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.

VesaJuvonen avatar Dec 27 '22 13:12 VesaJuvonen

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

ghost avatar Jan 03 '23 18:01 ghost