Skip to content

Commit

Permalink
Fix: batch issue with Add/Set-PnPListItem (#1890)
Browse files Browse the repository at this point in the history
* Fix batch issues with nonstring values

* Added changelog
  • Loading branch information
gautamdsheth authored May 22, 2022
1 parent f2ddb1d commit fd16734
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Fixed `Get-PnPGroup` , `Get-PnPGroupPermissions` and `Set-PnPGroupPermissions ` cmdlets by making them more consistent. They will also throw error if a group is not found. [#1808](https://github.com/pnp/powershell/pull/1808)
- Fixed `Get-PnPFile` issue with every 3rd file download in PS 5.
- Fixed `Add-PnPContentTypesFromContentTypeHub`, if `Site` parameter is specified, it will be used now to sync content types from content type hub site.
- Fixed `Get-PnPTeamsTeam`, the cmdlet now also returns additional properties like `WebUrl, CreatedDateTime, InternalId` [#1825](https://github.com/pnp/powershell/pull/1825)
- Fixed `Add/Set-PnPListItem` , the cmdlet now works correctly with `-Batch` parameter for field types other than string. [#1890](https://github.com/pnp/powershell/pull/1890)
- Fixed `Get-PnPTeamsTeam`, the cmdlet now also returns additional properties like `WebUrl, CreatedDateTime, InternalId`. [#1825](https://github.com/pnp/powershell/pull/1825)
- Fixed `Set-PnPListPermission`, it will now throw error if the list does not exist. [#1891](https://github.com/pnp/powershell/pull/1891)
- Fixed `Invoke-PnPSPRestMethod` invalid parsing for SharePoint number columns. [#1877](https://github.com/pnp/powershell/pull/1879)
Expand Down
5 changes: 3 additions & 2 deletions src/Commands/Utilities/ListItemHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ public static Dictionary<string, object> GetFieldValues(PnP.Core.Model.SharePoin
}
if (value != null && value.GetType().IsArray)
{
var fieldValueCollection = field.NewFieldValueCollection();
var fieldValueCollection = field.NewFieldValueCollection();
foreach (var arrayItem in value as object[])
{
Term taxonomyItem;
Expand Down Expand Up @@ -548,7 +548,8 @@ public static Dictionary<string, object> GetFieldValues(PnP.Core.Model.SharePoin
}
default:
{
item[key as string] = values[key];
object itemValue = values[key] is PSObject ? ((PSObject)values[key]).BaseObject : values[key];
item[key as string] = itemValue;
break;
}
}
Expand Down

0 comments on commit fd16734

Please sign in to comment.