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

Unable to handle action addContentType. No action handler was registered for this action.

Open expiscornovus opened this issue 8 years ago • 4 comments

Category

  • [ ] Question
  • [ ] Typo
  • [x] Bug
  • [ ] Additional article idea

Expected or Desired Behavior

I expect when I use the addContentType verb in a json schema I can add it to a site script.

Observed Behavior

When using the Add-SPOSiteScript or Add-PnPSiteScript cmdlets I am getting the "Unable to handle action addContentType" error. I am using SharePointPnPPowerShellOnline version 2.24.1803.0 and Microsoft.Online.SharePoint.PowerShell version 16.0.7414.0 on a Targeted Release tenant.

Steps to Reproduce

  1. Create a script for the addContentType action
PS C:\> $script = @'
>> {
>>     "$schema": "schema.json",
>>         "actions": [
>> {
>>    "verb": "addContentType",
>>    "name": "MyFirstContentType"
>> }
>>         ],
>>         "bindata": { },
>>         "version": 1
>> };
>> '@
  1. Add the json action to a site script via SPO PowerShell
PS C:\> Add-SPOSiteScript -Title "Add Content Type Site Script" -Description 
"Content Type Script" -Content $script

The result of this script is the following error: Unable to handle action addContentType. No action handler was registered for this action.

unabletohandleaction

expiscornovus avatar Mar 28 '18 16:03 expiscornovus

It looks like this is a case of RTFM ;)

When using existing content types and using it as subaction in a list it works.

expiscornovus avatar Mar 30 '18 14:03 expiscornovus

That's correct - but we have some updates on content types that we'll share next week. Thanks!

seansquires avatar Apr 07 '18 21:04 seansquires

Is the issue as been fixed ? I have the same error with the remove content type verb. Add-SPOSiteScript : Unable to handle action removeContentType. No action handler was registered for this action. At line:1 char:51

  • ... teScriptFile -Raw | Add-SPOSiteScript -Title $siteScriptTitle) | Sele ...
  •                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [Add-SPOSiteScript], ServerException
    • FullyQualifiedErrorId : Microsoft.SharePoint.Client.ServerException,Microsoft.Online.SharePoint.PowerShell.AddSPOSiteScript

Please let me know, Thanks.

umaknow-alain avatar Oct 16 '18 14:10 umaknow-alain

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

msft-github-bot avatar Jan 28 '20 00:01 msft-github-bot