pnp / PnP-Sites-Core

Microsoft 365 Dev PnP Core component (.NET) targeted for increasing developer productivity with CSOM based solutions.
Other
415 stars 644 forks source link

"The object specified does not belong to a list" SP Language conflict #1705

Open Ralmenar opened 6 years ago

Ralmenar commented 6 years ago

Which PnP repository should you use to report the issue?

Category

[ x] Bug [ ] Enhancement

Environment

[x ] Office 365 / SharePoint Online [x ] SharePoint 2016 [x ] SharePoint 2013

If SharePoint on-premises, what's exact CU version:

Expected or Desired Behavior

If you are reporting a bug, please describe the expected behavior. If you are suggesting an enhancement please describe thoroughly the enhancement, how it can be achieved, and expected benefit.

When adding properties to the homepage file while applying provisioning template via powershell command "Apply-PnPProvisioningTemplate" we expect the site to be created with that template independently of our SP Language.

Observed Behavior

If you are reporting a bug, please describe the behavior you expected to occur when performing the action. If you are making a suggestion, you can delete this section.

When the execution arrives to SetFileProperties method in ObjectFiles.cs it throws an exception with message "The object specified does not belong to a list." which sould be skipped according to the code because the actual exception message is the same but in spanish, which is the language of our SP site. There is a picture with the execution at this point.

image

Steps to Reproduce

If you are reporting a bug please describe the steps to reproduce the bug in sufficient detail to allow testing. Only way to fix things properly, is to have sufficient details to reproduce it. If you are making a suggestion, you can delete this section.

Just try the command Apply-PnPProvisioningTemplate with a SP site in spanish (I guess there is the same problem in any language except english)

Ralmenar commented 6 years ago

I just found on the same file the same case but using ServerErrorCode instead of Message, Would it be fixed changing this? image