From 788dcd9ee39ca076cc33ea974254b2ef68a5395f Mon Sep 17 00:00:00 2001 From: BollietMZK Date: Tue, 31 Jan 2023 14:42:44 +0100 Subject: [PATCH] Cast TaxonoxyField with appropriate method from web context --- .../Provisioning/ObjectHandlers/ObjectListInstance.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/PnP.Framework/Provisioning/ObjectHandlers/ObjectListInstance.cs b/src/lib/PnP.Framework/Provisioning/ObjectHandlers/ObjectListInstance.cs index cdf83b01e..781926d2a 100644 --- a/src/lib/PnP.Framework/Provisioning/ObjectHandlers/ObjectListInstance.cs +++ b/src/lib/PnP.Framework/Provisioning/ObjectHandlers/ObjectListInstance.cs @@ -2838,7 +2838,8 @@ private ListInstance ExtractFields(Web web, List siteList, List conten if (field.TypeAsString.StartsWith("TaxonomyField")) { // find the corresponding taxonomy field and include it anyway - var taxField = (TaxonomyField)field; + var taxField = web.Context.CastTo(field); + taxField.EnsureProperties(f => f.TextField, f => f.Id); var noteField = siteList.Fields.GetById(taxField.TextField);