Skip to content

Bug report: Unable to rename list content type #4885

@ganesh-sanap

Description

@ganesh-sanap

Priority

(Medium) I'm annoyed but I'll live

Description

I am using m365 spo contenttype set cmdlet to rename the content type added to SharePoint list.

Using:

m365 spo contenttype set --name "Document Set" --webUrl $siteUrl --listTitle "DocumentSets" --Name "DocumentSet"

Above cmdlet is throwing error:

Error: Cannot invoke method or retrieve property from null object. Object returned by the following call stack is null. ""

Steps to reproduce

  • Login using m365 login
  • Use site URL parameter like: $siteUrl = "https://contoso.sharepoint.com/sites/contoso"
  • Run below cmdlet with your list name and content type name:
m365 spo contenttype set --name "Document Set" --webUrl $siteUrl --listTitle "DocumentSets" --Name "DocumentSet"

Expected results

Above cmdlet should rename content type added to SharePoint list as per the cmdlet documentation examples: https://pnp.github.io/cli-microsoft365/cmd/spo/contenttype/contenttype-set/#examples

Actual results

Above cmdlet is throwing error:

Error: Cannot invoke method or retrieve property from null object. Object returned by the following call stack is null. ""

Diagnostics

No response

CLI for Microsoft 365 version

v6.8.0

nodejs version

v18.16.0

Operating system (environment)

Windows

Shell

PowerShell

cli doctor

{
  "os": {
    "platform": "win32",
    "version": "Windows 10 Pro",
    "release": "10.0.19045"
  },
  "cliVersion": "6.8.0",
  "nodeVersion": "v18.16.0",
  "cliAadAppId": "31359c7f-bd7e-475c-86db-fdb8c937548e",
  "cliAadAppTenant": "common",
  "authMode": "DeviceCode",
  "cliEnvironment": "",
  "cliConfig": {},
  "roles": [],
  "scopes": [
    "AllSites.FullControl",
    "AppCatalog.ReadWrite.All",
    "Directory.AccessAsUser.All",
    "Directory.ReadWrite.All",
    "Group.ReadWrite.All",
    "IdentityProvider.ReadWrite.All",
    "Mail.Send",
    "Reports.Read.All",
    "TermStore.ReadWrite.All",
    "User.Invite.All",
    "User.Read.All",
    "profile",
    "openid",
    "email",
    "AllSites.FullControl",
    "AppCatalog.ReadWrite.All",
    "Directory.AccessAsUser.All",
    "Directory.ReadWrite.All",
    "Group.ReadWrite.All",
    "IdentityProvider.ReadWrite.All",
    "Mail.Send",
    "Reports.Read.All",
    "TermStore.ReadWrite.All",
    "User.Invite.All",
    "User.Read.All"
  ]
}

Additional Info

No response

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions