pnpframework icon indicating copy to clipboard operation
pnpframework copied to clipboard

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

Open pxmonti opened this issue 1 year ago • 1 comments

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.

pxmonti avatar Sep 27 '23 12:09 pxmonti

Site.GetRecycleBinItems is a CSOM method and in no way related to pnpframework. This issue should rather be raised in https://github.com/SharePoint/sp-dev-docs repo.

wilecoyotegenius avatar Dec 21 '23 20:12 wilecoyotegenius