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

[BUG] [Restore-PnPListItemVersion] Got "The object is not associated with an object identity or the object identity is invalid." when list item contains allow multiple value Taxonomy Field #4255

Closed
1 of 6 tasks
wuxiaojun514 opened this issue Sep 10, 2024 · 3 comments · Fixed by #4262 · May be fixed by #4302
Labels
bug Something isn't working

Comments

@wuxiaojun514
Copy link
Contributor

Notice

Many bugs reported are actually related to the PnP Framework which is used behind the scenes. Consider carefully where to report an issue:

  1. Are you using Invoke-PnPSiteTemplate or Get-PnPSiteTemplate? The issue is most likely related to the Provisioning Engine. The Provisioning engine is not located in the PowerShell repo. Please report the issue here: https://github.com/pnp/pnpframework/issues.

    answer: I don't use any PnPSiteTemplate command.

  2. Is the issue related to the cmdlet itself, its parameters, the syntax, or do you suspect it is the code of the cmdlet that is causing the issue? Then please continue reporting the issue in this repo.

  3. If you think that the functionality might be related to the underlying libraries that the cmdlet is calling (We realize that might be difficult to determine), please first double check the code of the cmdlet, which can be found here: https://github.com/pnp/powershell/tree/master/src/Commands. If related to the cmdlet, continue reporting the issue here, otherwise report the issue at https://github.com/pnp/pnpframework/issues

Reporting an Issue

It will throw "Restore-PnPListItemVersion: The object is not associated with an object identity or the object identity is invalid." error if you use Restore-PnPListItemVersion command on a list which contains multiple value allowed taxonomy field.

Expected behavior

It should restore the list item successfully

Actual behavior

You will get error like this if the target list contains "TaxonomyFieldTypeMulti" taxonomy field
image

Steps to reproduce behavior

  1. Make sure your list contains taxonomy field which allows multiple values
  2. Try to use Restore-PnPListItemVersion command to restore this list's item
  3. Then you will get error as the above screenshot shows

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

(you can retrieve this by executing Get-Module -Name "PnP.PowerShell" -ListAvailable)

2.12.0

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

  • Windows
  • Linux
  • MacOS
  • Azure Cloud Shell
  • Azure Functions
  • Other : please specify
@wuxiaojun514 wuxiaojun514 added the bug Something isn't working label Sep 10, 2024
@wuxiaojun514
Copy link
Contributor Author

I think this is due to "Restore-PnPListItemVersion" doesn't use special way (TaxonomyFieldValueCollection) to handle TaxonomyFieldTypeMulti field . I can try to fix it by myself.

@wuxiaojun514 wuxiaojun514 mentioned this issue Sep 11, 2024
3 tasks
@wuxiaojun514
Copy link
Contributor Author

I created a PR to fix it.
This issue only occurs on 'TaxonomyFieldTypeMulti' field.

@wuxiaojun514
Copy link
Contributor Author

My hotfix still has some bug, it cannot work properly when there are multiple fields (including taxonomy field) need to be restored.
I will double check it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant