diff --git a/CHANGELOG.md b/CHANGELOG.md index 35042d5dc..3168c24df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Telemetry in PnP PowerShell has been removed due to the costs of collecting the data didn't outweigh the benefits to the PnP PowerShell team to have insights into its usage. The involved cmdlets `Get-PnPPowerShellTelemetryEnabled`, `Enable-PnPPowerShellTelemetry` and `Disable-PnPPowerShellTelemetry` have been marked as deprecated and no longer function, but will stay in v3 for backwards compatibility with existing scripts. These cmdlets will be removed in the next v4 release. All versions of PnP PowerShell will no longer be able to submit telemetry. You might see background requests for this failing. This will not interfear with the normal execution of your PowerShell script. [#5460](https://github.com/pnp/powershell/pull/5460) ### Fixed +- `Set-PnPDefaultColumnValues` and `Invoke-PnPSiteTemplate` failing with 'Error applying default column values' since September 2026, because SharePoint Online rejects registering the LocationBasedMetadataDefaultsReceiver event receiver through CSOM. PnP Framework now registers it through REST. Should that also fail, the values are stored and `Set-PnPDefaultColumnValues` warns that SharePoint will not apply them to newly added items. Requires the accompanying PnP Framework change. [#5467](https://github.com/pnp/powershell/issues/5467) - Using UPNs with an apostrophe in it not working with `Remove-PnPUserProfile`, `Export-PnPUserProfile`, `Export-PnPUserInfo`, and `Remove-PnPUserInfo`. The apostrophe is now escaped in the API request. [#5459](https://github.com/pnp/powershell/pull/5459) ## [3.4.1] diff --git a/src/Commands/Lists/SetDefaultColumnValues.cs b/src/Commands/Lists/SetDefaultColumnValues.cs index 2e02c0c17..c41ba8279 100644 --- a/src/Commands/Lists/SetDefaultColumnValues.cs +++ b/src/Commands/Lists/SetDefaultColumnValues.cs @@ -74,6 +74,14 @@ protected override void ExecuteCmdlet() } IDefaultColumnValue defaultColumnValue = field.GetDefaultColumnValueFromField(ClientContext, Folder, Value); list.SetDefaultColumnValues(new List() { defaultColumnValue }); + + // SharePoint applies the stored defaults through this event receiver. PnP Framework registers it, but + // when SharePoint Online rejects the registration the values are stored yet never applied to newly + // added items, so make that visible (#5467) + if (list.GetEventReceiverByName("LocationBasedMetadataDefaultsReceiver ItemAdded") == null) + { + LogWarning("The default column values have been stored, but the 'LocationBasedMetadataDefaultsReceiver ItemAdded' event receiver could not be registered on the list, so SharePoint will not apply them to newly added items."); + } } else {