Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug report: spo tenant recyclebinitem restore doesn't restore group #6021

Open
1 task
milanholemans opened this issue May 4, 2024 · 3 comments · May be fixed by #6057
Open
1 task

Bug report: spo tenant recyclebinitem restore doesn't restore group #6021

milanholemans opened this issue May 4, 2024 · 3 comments · May be fixed by #6057

Comments

@milanholemans
Copy link
Contributor

milanholemans commented May 4, 2024

Priority

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

Description

When using spo tenant recyclebinitem restore on a team site, the connected group remains in the recycle bin.

Steps to reproduce

Run m365 spo tenant recyclebinitem restore -u https://contoso.sharepoint.com/sites/Marketing on any teams site in the SharePoint recycle bin with its connected group in the group recycle bin.

Expected results

Restore both the group and the site.

Actual results

Only the site is restored, not the group.

Diagnostics

No response

CLI for Microsoft 365 version

v7.8.0

nodejs version

v20.10.0

Operating system (environment)

Windows

Shell

PowerShell

cli doctor

No response

Additional Info

In this command, we're using a SPOInternalUseOnly.Tenant endpoint. However it seems like the UI is using the same request, the UI restores the group without any problem, while this command doesn't.
Maybe we should look to an alternative endpoint.

  • We should also fix the response type of the request, right now, if the request returns an error, it's not parsed as JSON which makes the error hard to read.
    image
@milanholemans milanholemans added bug needs peer review Needs second pair of eyes to review the spec or PR labels May 4, 2024
@waldekmastykarz
Copy link
Member

Good catch. Let's create a separate issue for fixing showing the error message

@waldekmastykarz waldekmastykarz added help wanted and removed needs peer review Needs second pair of eyes to review the spec or PR labels May 8, 2024
@milanholemans
Copy link
Contributor Author

Good catch. Let's create a separate issue for fixing showing the error message

Is that necessary? The only thing we have to do to fix this is add a response type in the request object.

const requestOptions: CliRequestOptions = {
url: `${adminUrl}/_api/SPOInternalUseOnly.Tenant/RestoreDeletedSite`,
headers: {
accept: 'application/json;odata=nometadata',
'content-type': 'application/json;charset=utf-8'
},
data: {
siteUrl: args.options.siteUrl
}
};

@MathijsVerbeeck
Copy link
Contributor

Can I work on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants