Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement TermGroup UpdateBehavior. #636

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

rompenar
Copy link
Contributor

@rompenar rompenar commented Apr 6, 2022

Update TermGroup properties: Description, Contributors, Managers.
Update TermSet properties: Name (same id), Description, IsOpenForTermCreation, IsAvailableForTagging, CustomProperties.
Update Term properties: Name (same id), Description, IsAvailableForTagging, Labels, CustomProperties, LocalCustomProperties.

Update TermGroup properties: Description, Contributors, Managers.
Update TermSet properties: Name (same id), Description, IsOpenForTermCreation, IsAvailableForTagging, CustomProperties.
Update Term properties: Name (same id), Description, IsAvailableForTagging, Labels, CustomProperties, LocalCustomProperties.
@pschaeflein
Copy link

@rompenar - I'm struggling to understand the change. You've created a method named CreateTermGroup, and this method returns a tuple that includes a boolean. And the boolean indicates whether the group is new? This seems odd - I would expect a method with that name to create a term group, or throw if something goes wrong.

Was there an error you were fixing? Or is this an optimization of the code? Some more details would be helpful.

Thanks.

@rompenar
Copy link
Contributor Author

@pschaeflein

The boolean return value is needed for the "modelTermGroup.Name == "Site Collection"" condition in the CreateTermGroup. When the group to create is the site collection one (<pnp:TermGroup Name="{sitecollectiontermgroupname}" ...), we use the methods termStore.GetSiteCollectionGroup which does not set the Contributors and Managers properties. We use the boolean value to avoid update when it's a new group, but to force it for new site collection group.

This change was made to implement the UpdateBehavior property on TermGroup, TermSet and Term object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants