pnp / pnp/pnpframework

GetRecycleBinItems will not return items from both the first and the second stage if RecycleBinItemState.None is specified

Open
#920 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
259
Forks
161
Avg merge
10h 33m
Merged PRs (30d)
1

Description

I am using the method GetRecycleBinItems of the site object to retrieve the items in the recycle bin. I pass the RecycleBinItemState.None enum value to the method and I expect that both the 1st and 2nd stage recycle bin items are returned. However, only the 1st stage recycle bin items are returned.

I've reproed this using Powershell as follows.

$items = $ctc.site.GetRecycleBinItems($null, 5000, $false, [Microsoft.SharePoint.Client.RecycleBinOrderby]::DefaultOrderBy, [Microsoft.SharePoint.Client.RecycleBinItemState]::None)
$ctc.Load($items)
$ctc.ExecuteQuery()

The returned values are those of the 1 stage only, not both stages as expected.
Here a screenshot of the results using RecycleBinItemState.None

image

And the results using RecycleBinItemState.FirstStageRecycleBin
image

And the results using RecycleBinItemState.SecondStageRecycleBin

image

As you see the content are different and only the 1st stage is returned.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the GetRecycleBinItems method and use the PowerShell reproduction in this issue with RecycleBinItemState.None, FirstStageRecycleBin, and SecondStageRecycleBin. Confirm the implementation and returned results, then verify that None returns items from both recycle-bin stages.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, powershell
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.