Skip to content

Commit

Permalink
Fix #3783 : issue with audience targeting in modern lists
Browse files Browse the repository at this point in the history
  • Loading branch information
Gautam Sheth committed Jun 26, 2024
1 parent 3f3a5c7 commit 82a3fc2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/lib/PnP.Framework/Extensions/ListExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2304,6 +2304,9 @@ public static void EnableClassicAudienceTargeting(this List list)

public static void EnableModernAudienceTargeting(this List list)
{
var siteContext = list.ParentWeb.Context as ClientContext;
siteContext.Site.ActivateFeature(new Guid("bc13eaf7-67c7-4f85-a80f-a4b0dae5e5bd"));

// TODO Need to add filter for Site Pages and Documents Library only for modern targeting.
if (!list.FieldExistsByName(Constants.ModernAudienceTargetingInternalName) &&
!list.FieldExistsByName(Constants.ModernAudienceTargetingMultiLookupInternalName))
Expand Down

0 comments on commit 82a3fc2

Please sign in to comment.