Closed ranaictiu closed 3 months ago
Thanks for reporting this @ranaictiu and thanks for pointing out the fix. I've just fixed this in PnP Core SDK, this change will be part of the next nightly build. Hence I'm closing this issue now, if you still see issues then please re-open or create a new issue.
Category
Describe the bug
If you call File.CheckInAsync(comments,CheckinType) with comments having new line '\n', or '%0Abb', the check-in fails with bad request/Invalid URL. Found out that when I try checkin with new line in SharePoint interface, the request looks something like below (uses parameters a1, a2..): _api/web/GetFileByServerRelativePath(DecodedUrl=@a1)/CheckIn(comment=@a2,checkintype=@a3)?@a1=%27%2Fsites%2Fsitename%2FDocumentsLibraryName%2FDocumentName%2Edocx%27&@a2=%27firstline%0Asecondline%27&@a3=0
However the same request is constructed as below in PnpCore (without parameters) _api/Web/lists(guid'doc-list-id')/items(21)/file/checkin(comment='firstline%0Asecondline',checkintype=0)
Steps to reproduce
When use below comments (with newline or encoded) to checkin fails.
However if I use the below - which passes comments as parameter, it works.
Expected behavior
Check-in should work with comments having new-line (encoded).
Environment details (development & target environment)
SharePoint Online
Thanks for your contribution! Sharing is caring.