Skip to content

[BUG] Can't rename existing term with a localeid #4772

Description

@forzewin

Reporting an Issue or Missing Feature

Issue

Expected behavior

Updating the Name of the designated Term for the english translation using this command :

Set-PnpTerm -Identity "ID of Term" -Name"New Name" -TermSet "My term set" -TermGroup "My term Group" -Lcid 1033

Actual behavior

Image

Image

It is ignoring Lcid parameter and renaming french translation

It is very Odd because if i use same command but replace -Name by -Description, here it is working as expected, english description is changed...

Steps to reproduce behavior

Use Set-PnpTerm -Identity "ID of Term" -Name"New Name" -TermSet "My term set" -TermGroup "My term Group" -Lcid 1033

On a term that as French and English translation set.

What is the version of the Cmdlet module you are running?

2.12.0

Which operating system/environment are you running PnP PowerShell on?

  • Windows
  • Linux
  • MacOS
  • Azure Cloud Shell
  • Azure Functions
  • Other : please specify

Activity

  1. changed the title [-][BUG][/-] [+][BUG] Can't rename existing term[/+] on Mar 6, 2025
  2. KoenZomers commented on Apr 1, 2025

    @KoenZomers
    Collaborator

    I can reproduce the issue. Problem here is that for description, CSOM provides a specific method which allows setting it for a specific language, but it does not provide such an option for a label. Best thing I can do is utilizing the CreateLabel with the default to true, which would cause the current name to be added as a synonim and the new name to be set as the default name. Not ideal either, but the only possibility within CSOM.

    The only alternative would be to deviate from CSOM and start using the v2.1 SharePoint API, which is also what the modern Taxonomy Editor uses in SharePoint Online. This would mean a huge rewrite though spanning multiple days of work to test and implement, for which I don't have time.

    Yet another alternative could be, albeit a long shot, to file a support ticket with Microsoft requesting it to add an API to CSOM for specifically being able to set the default label for a specific language on a taxonomy item. Don't mention you will use it via PnP or they will likely close the case stating it not to be supported. Say you want to use it using CSOM, which is effectively what PnP does as well, and it might stand a (very) small chance of it getting implemented.

    I'll go ahead and push the code change described above so it will set the current name as a synonim for that language as it feels that's better than how it currently works, which is just overwriting the default language and ignoring the LCID as a whole.

  3. changed the title [-][BUG] Can't rename existing term[/-] [+][BUG] Can't rename existing term with a localeid[/+] on Apr 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingreproducedIssue reproduced after testing

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions