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

Discrepancy between On Premise and Sharepoint Online #344

Open
badger-mark opened this issue May 7, 2024 · 0 comments
Open

Discrepancy between On Premise and Sharepoint Online #344

badger-mark opened this issue May 7, 2024 · 0 comments
Labels

Comments

@badger-mark
Copy link

badger-mark commented May 7, 2024

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

@vgrem vgrem added the question label May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants