-
-
Notifications
You must be signed in to change notification settings - Fork 119
Description
I am currently involved in a project where we are migrating to SPO from an On Premise instance of SP. Before performing the initial cut over we want to run the On Premise and SPO in parallel, uploading to both instances.
I am using the example here as my base code:
https://github.com/vgrem/phpSPO/blob/master/examples/SharePoint/Files/UploadAndSetProps.php
This uploads and set the props fine for SPO, however, I get the following error when trying to set props using On Premise:
{"error":{"code":"-1, Microsoft.SharePoint.Client.ResourceNotFoundException","message":{"lang":"en-US","value":"Cannot find resource for the request ListItemAllFields."}}}
The file uploads to On Premise but attempting to set and update the props yields the error.
I then tried a different approach where I upload the file and then use Example 4 in the README for Sharepoint. This code tries to get the item by ID and then set the props. This method doesn't seem to work at all for either SPO or On Prem. I get the following error when trying to get the item by ID:
{"error":{"code":"-1, Microsoft.SharePoint.Client.InvalidClientQueryException","message":{"lang":"en-US","value":"The expression \"Web/Lists/getByTitle('Statements')/items({***MY ID***})/parentlist\" is not valid."}}}
For SPO, to get the ID I use $file->getUniqueId()
and for On Prem I parsed the value in $file->getETag()
.
I am using v3.1.1 and php v8.1.7