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

TaxonomyPicker - suggestions are not working. Error #425

Closed
Matej4386 opened this issue Dec 5, 2019 · 9 comments
Closed

TaxonomyPicker - suggestions are not working. Error #425

Matej4386 opened this issue Dec 5, 2019 · 9 comments
Labels
status:tracked Triaged and are being investigated further status:working-on-it Known issue / feature being addressed. Will use other "status:*" labels & comments for more detail. type:bug
Milestone

Comments

@Matej4386
Copy link

Matej4386 commented Dec 5, 2019

Category

[ ] Enhancement

[X ] Bug

[ ] Question

Version

Please specify what version of the library you are using: [ 1.15.0 ]

Expected / Desired Behavior / Question

TermSetPicker - suggestions should list available suggestions under input element.
TermSet and TermSetItems are correctlly displayed in Panel. I can select, ...

Observed Behavior

After typing letters there is error in console and suggestions are not displayed.

Error: Uncaught (in promise) TypeError: Cannot read property '_ObjectType_' of null
    at SPTermStorePickerService.js:129
    at Array.filter (<anonymous>)
    at SPTermStorePickerService.js:129

Steps to Reproduce

<TaxonomyPicker
allowMultipleSelections={false}
termsetNameOrID="9e9e3b0b-f9b6-4814-9dc9-5639aed4ea64" //this is ID of my TermSet, strange is that this works only for ID, not for Term Set Name
panelTitle="Choose"
label="Taxonomy"
context={this.props.context}
onChange={this.onTaxPickerChange}
isTermSetSelectable={false}
/>

@ghost
Copy link

ghost commented Dec 5, 2019

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

@ghost ghost added the Needs: Triage 🔍 label Dec 5, 2019
@AJIXuMuK
Copy link
Collaborator

AJIXuMuK commented Dec 5, 2019

Hi @Matej4386,
I've tested your code and it works correctly.
could you please check that you use correct term set id and testing things in SharePoint, not a local workbech?
tax-picker

@Matej4386
Copy link
Author

Hi @AJIXuMuK,
thanks for reply. I am not using local workbench.

I think i use correct TermSet ID:
image

After click on button next to the input, Panel is working, i can select terms, everything works:
image

But when i start typing in input, suggestions are not working:
image

@AJIXuMuK
Copy link
Collaborator

AJIXuMuK commented Dec 6, 2019

@Matej4386,
Are you on-prem or online?

Could you please investigate Network tab? There should be request to ProcessQuery.svc. And in the response you should see your term store objects.
Could you share it with me or at least investigate what object in there miss __ObjectType__ property?

@Matej4386
Copy link
Author

@AJIXuMuK ,
I am on-prem.
Och, i am at home and will have vacation for whole week ... I can share it on monday 16.12.
I looked at it few days ago, compared it to the query in panel (which is working) and there was difference - working query (i thing "get all") had in response all terms, but filtered query had null.

@Matej4386
Copy link
Author

Matej4386 commented Dec 16, 2019

@AJIXuMuK ,
finally at work ... Here is response:

[
{
"SchemaVersion":"15.0.0.0","LibraryVersion":"16.0.10351.20000","ErrorInfo":null,"TraceCorrelationId":"c8f8219f-e457-408b-7c4e-a43af68b26ab"
},2,{
"IsNull":false
},3,{
"_ObjectIdentity_":"c8f8219f-e457-408b-7c4e-a43af68b26ab|fec14c62-7c3b-481b-851b-c80d7802b224:ss:"
},5,{
"IsNull":true
},6,null,7,null
]

Query for Panel:
[
{
"SchemaVersion":"15.0.0.0","LibraryVersion":"16.0.10351.20000","ErrorInfo":null,"TraceCorrelationId":"e7f8219f-2419-408b-7c4e-a6a9b889a46d"
},1,{
"IsNull":false
},2,{
"_ObjectIdentity_":"e7f8219f-2419-408b-7c4e-a6a9b889a46d|fec14c62-7c3b-481b-851b-c80d7802b224:ss:"
},4,{
"IsNull":false
},5,{
"_ObjectIdentity_":"e7f8219f-2419-408b-7c4e-a6a9b889a46d|fec14c62-7c3b-481b-851b-c80d7802b224:st:2lcTDuEg90avCv6W6CkbwA=="
},7,{
"IsNull":false
},8,{
"_ObjectIdentity_":"e7f8219f-2419-408b-7c4e-a6a9b889a46d|fec14c62-7c3b-481b-851b-c80d7802b224:se:2lcTDuEg90avCv6W6CkbwE5cBNvHQCZOiQ3IfdgAGboLO56etvkUSJ3JVjmu1Opk"
},10,{
"IsNull":false
},11,{
"_ObjectType_":"SP.Taxonomy.TermSet","_ObjectIdentity_":"e7f8219f-2419-408b-7c4e-a6a9b889a46d|fec14c62-7c3b-481b-851b-c80d7802b224:se:2lcTDuEg90avCv6W6CkbwE5cBNvHQCZOiQ3IfdgAGboLO56etvkUSJ3JVjmu1Opk","CreatedDate":"\/Date(1573720149003)\/","Id":"\/Guid(9e9e3b0b-f9b6-4814-9dc9-5639aed4ea64)\/","LastModifiedDate":"\/Date(1573720149003)\/","Name":"CEZ_TypZmluvy","CustomProperties":{

},"CustomSortOrder":null,"IsAvailableForTagging":true,"Owner":"blblbaaaa","Contact":"","Description":"","IsOpenForTermCreation":false,"Names":{
"1033":"CEZ_TypZmluvy"
},"Stakeholders":[

]
},12,{
"_ObjectType_":"SP.Taxonomy.TermCollection","_Child_Items_":[
{
"_ObjectType_":"SP.Taxonomy.Term","_ObjectIdentity_":"e7f8219f-2419-408b-7c4e-a6a9b889a46d|fec14c62-7c3b-481b-851b-c80d7802b224:te:2lcTDuEg90avCv6W6CkbwE5cBNvHQCZOiQ3IfdgAGboLO56etvkUSJ3JVjmu1Opk1dypGhbPVkeyLxKg7cgkWw==","IsRoot":true,"Labels":{
"_ObjectType_":"SP.Taxonomy.LabelCollection","_Child_Items_":[
{
"_ObjectType_":"SP.Taxonomy.Label","_ObjectIdentity_":"e7f8219f-2419-408b-7c4e-a6a9b889a46d|fec14c62-7c3b-481b-851b-c80d7802b224:la:;1033;Biela;2lcTDuEg90avCv6W6CkbwE5cBNvHQCZOiQ3IfdgAGboLO56etvkUSJ3JVjmu1Opk1dypGhbPVkeyLxKg7cgkWw==","IsDefaultForLanguage":true,"Language":1033,"Value":"Biela"
}
]
},"TermsCount":0,"CustomSortOrder":null,"Id":"\/Guid(1aa9dcd5-cf16-4756-b22f-12a0edc8245b)\/","Name":"Biela","PathOfTerm":"Biela","Parent":null,"LocalCustomProperties":{

},"IsDeprecated":false,"IsAvailableForTagging":true
},{
"_ObjectType_":"SP.Taxonomy.Term","_ObjectIdentity_":"e7f8219f-2419-408b-7c4e-a6a9b889a46d|fec14c62-7c3b-481b-851b-c80d7802b224:te:2lcTDuEg90avCv6W6CkbwE5cBNvHQCZOiQ3IfdgAGboLO56etvkUSJ3JVjmu1OpkXS3hiucm4kqFg\u002fBvD7U8FA==","IsRoot":true,"Labels":{
"_ObjectType_":"SP.Taxonomy.LabelCollection","_Child_Items_":[
{
"_ObjectType_":"SP.Taxonomy.Label","_ObjectIdentity_":"e7f8219f-2419-408b-7c4e-a6a9b889a46d|fec14c62-7c3b-481b-851b-c80d7802b224:la:;1033;Cierna;2lcTDuEg90avCv6W6CkbwE5cBNvHQCZOiQ3IfdgAGboLO56etvkUSJ3JVjmu1OpkXS3hiucm4kqFg\u002fBvD7U8FA==","IsDefaultForLanguage":true,"Language":1033,"Value":"Cierna"
}
]
},"TermsCount":0,"CustomSortOrder":null,"Id":"\/Guid(8ae12d5d-26e7-4ae2-8583-f06f0fb53c14)\/","Name":"Cierna","PathOfTerm":"Cierna","Parent":null,"LocalCustomProperties":{

},"IsDeprecated":false,"IsAvailableForTagging":true
},{
"_ObjectType_":"SP.Taxonomy.Term","_ObjectIdentity_":"e7f8219f-2419-408b-7c4e-a6a9b889a46d|fec14c62-7c3b-481b-851b-c80d7802b224:te:2lcTDuEg90avCv6W6CkbwE5cBNvHQCZOiQ3IfdgAGboLO56etvkUSJ3JVjmu1OpktJ6cVqWwqEOXYNcsc9KMiw==","IsRoot":true,"Labels":{
"_ObjectType_":"SP.Taxonomy.LabelCollection","_Child_Items_":[
{
"_ObjectType_":"SP.Taxonomy.Label","_ObjectIdentity_":"e7f8219f-2419-408b-7c4e-a6a9b889a46d|fec14c62-7c3b-481b-851b-c80d7802b224:la:;1033;Fialova;2lcTDuEg90avCv6W6CkbwE5cBNvHQCZOiQ3IfdgAGboLO56etvkUSJ3JVjmu1OpktJ6cVqWwqEOXYNcsc9KMiw==","IsDefaultForLanguage":true,"Language":1033,"Value":"Fialova"
}
]
},"TermsCount":0,"CustomSortOrder":null,"Id":"\/Guid(569c9eb4-b0a5-43a8-9760-d72c73d28c8b)\/","Name":"Fialova","PathOfTerm":"Fialova","Parent":null,"LocalCustomProperties":{

},"IsDeprecated":false,"IsAvailableForTagging":true
},{
"_ObjectType_":"SP.Taxonomy.Term","_ObjectIdentity_":"e7f8219f-2419-408b-7c4e-a6a9b889a46d|fec14c62-7c3b-481b-851b-c80d7802b224:te:2lcTDuEg90avCv6W6CkbwE5cBNvHQCZOiQ3IfdgAGboLO56etvkUSJ3JVjmu1OpkhoeAP4WfRUGXnk10656ruw==","IsRoot":true,"Labels":{
"_ObjectType_":"SP.Taxonomy.LabelCollection","_Child_Items_":[
{
"_ObjectType_":"SP.Taxonomy.Label","_ObjectIdentity_":"e7f8219f-2419-408b-7c4e-a6a9b889a46d|fec14c62-7c3b-481b-851b-c80d7802b224:la:;1033;Mala;2lcTDuEg90avCv6W6CkbwE5cBNvHQCZOiQ3IfdgAGboLO56etvkUSJ3JVjmu1OpkhoeAP4WfRUGXnk10656ruw==","IsDefaultForLanguage":true,"Language":1033,"Value":"Mala"
}
]
},"TermsCount":0,"CustomSortOrder":null,"Id":"\/Guid(3f808786-9f85-4145-979e-4d74eb9eabbb)\/","Name":"Mala","PathOfTerm":"Mala","Parent":null,"LocalCustomProperties":{

},"IsDeprecated":false,"IsAvailableForTagging":true
},{
"_ObjectType_":"SP.Taxonomy.Term","_ObjectIdentity_":"e7f8219f-2419-408b-7c4e-a6a9b889a46d|fec14c62-7c3b-481b-851b-c80d7802b224:te:2lcTDuEg90avCv6W6CkbwE5cBNvHQCZOiQ3IfdgAGboLO56etvkUSJ3JVjmu1OpkBmNhYedip0OlAAisPAYMEQ==","IsRoot":true,"Labels":{
"_ObjectType_":"SP.Taxonomy.LabelCollection","_Child_Items_":[
{
"_ObjectType_":"SP.Taxonomy.Label","_ObjectIdentity_":"e7f8219f-2419-408b-7c4e-a6a9b889a46d|fec14c62-7c3b-481b-851b-c80d7802b224:la:;1033;Modra;2lcTDuEg90avCv6W6CkbwE5cBNvHQCZOiQ3IfdgAGboLO56etvkUSJ3JVjmu1OpkBmNhYedip0OlAAisPAYMEQ==","IsDefaultForLanguage":true,"Language":1033,"Value":"Modra"
}
]
},"TermsCount":0,"CustomSortOrder":null,"Id":"\/Guid(61616306-62e7-43a7-a500-08ac3c060c11)\/","Name":"Modra","PathOfTerm":"Modra","Parent":null,"LocalCustomProperties":{

},"IsDeprecated":false,"IsAvailableForTagging":true
},{
"_ObjectType_":"SP.Taxonomy.Term","_ObjectIdentity_":"e7f8219f-2419-408b-7c4e-a6a9b889a46d|fec14c62-7c3b-481b-851b-c80d7802b224:te:2lcTDuEg90avCv6W6CkbwE5cBNvHQCZOiQ3IfdgAGboLO56etvkUSJ3JVjmu1OpkIR\u002fO2JJRCECLpzBvn1dH9A==","IsRoot":true,"Labels":{
"_ObjectType_":"SP.Taxonomy.LabelCollection","_Child_Items_":[
{
"_ObjectType_":"SP.Taxonomy.Label","_ObjectIdentity_":"e7f8219f-2419-408b-7c4e-a6a9b889a46d|fec14c62-7c3b-481b-851b-c80d7802b224:la:;1033;Ruzova;2lcTDuEg90avCv6W6CkbwE5cBNvHQCZOiQ3IfdgAGboLO56etvkUSJ3JVjmu1OpkIR\u002fO2JJRCECLpzBvn1dH9A==","IsDefaultForLanguage":true,"Language":1033,"Value":"Ruzova"
}
]
},"TermsCount":0,"CustomSortOrder":null,"Id":"\/Guid(d8ce1f21-5192-4008-8ba7-306f9f5747f4)\/","Name":"Ruzova","PathOfTerm":"Ruzova","Parent":null,"LocalCustomProperties":{

},"IsDeprecated":false,"IsAvailableForTagging":true
},{
"_ObjectType_":"SP.Taxonomy.Term","_ObjectIdentity_":"e7f8219f-2419-408b-7c4e-a6a9b889a46d|fec14c62-7c3b-481b-851b-c80d7802b224:te:2lcTDuEg90avCv6W6CkbwE5cBNvHQCZOiQ3IfdgAGboLO56etvkUSJ3JVjmu1Opk7F4FtrZFI0GuwRfcHuiaug==","IsRoot":true,"Labels":{
"_ObjectType_":"SP.Taxonomy.LabelCollection","_Child_Items_":[
{
"_ObjectType_":"SP.Taxonomy.Label","_ObjectIdentity_":"e7f8219f-2419-408b-7c4e-a6a9b889a46d|fec14c62-7c3b-481b-851b-c80d7802b224:la:;1033;Velka;2lcTDuEg90avCv6W6CkbwE5cBNvHQCZOiQ3IfdgAGboLO56etvkUSJ3JVjmu1Opk7F4FtrZFI0GuwRfcHuiaug==","IsDefaultForLanguage":true,"Language":1033,"Value":"Velka"
}
]
},"TermsCount":0,"CustomSortOrder":null,"Id":"\/Guid(b6055eec-45b6-4123-aec1-17dc1ee89aba)\/","Name":"Velka","PathOfTerm":"Velka","Parent":null,"LocalCustomProperties":{

},"IsDeprecated":false,"IsAvailableForTagging":true
}
]
}
]

AJIXuMuK added a commit that referenced this issue Dec 17, 2019
@AJIXuMuK
Copy link
Collaborator

Hey @Matej4386,

Could you please install the beta version and see if it's fixed in there? I committed a potential fix but I can't reproduce the issue so can't tell for sure if it works :)

Here is a link on how to install the beta version: https://sharepoint.github.io/sp-dev-fx-controls-react/beta/

@AJIXuMuK AJIXuMuK added status:tracked Triaged and are being investigated further status:working-on-it Known issue / feature being addressed. Will use other "status:*" labels & comments for more detail. type:bug and removed Needs: Attention 👋 labels Dec 17, 2019
@AJIXuMuK AJIXuMuK added this to the 1.17.0 milestone Dec 17, 2019
@Matej4386
Copy link
Author

Matej4386 commented Dec 17, 2019

Hello @AJIXuMuK,
I have installed beta version - @pnp/spfx-controls-react@1.17.0-beta.28a445d ,
but it did not work ... same error, same result.

I have looked at the code in SPTermStorePickerService.js, in SPTermStorePickerService.prototype.getTermStores there was a call with data:
....
<ObjectPaths> <StaticMethod Id="1" Name="GetTaxonomySession" TypeId="{981cbc68-9edc-4f8d-872f-71146fcbb84f}" /> <Method Id="4" ParentId="1" Name="GetDefaultSiteCollectionTermStore" /> </ObjectPaths>
...
This call returned null parameter.
I changed it to:
<ObjectPaths><StaticMethod Id="0" Name="GetTaxonomySession" TypeId="{981cbc68-9edc-4f8d-872f-71146fcbb84f}" /><Method Id="3" ParentId="0" Name="GetDefaultKeywordsTermStore" /><Method Id="6" ParentId="3" Name="GetTermSet"><Parameters><Parameter Type="Guid">9e9e3b0b-f9b6-4814-9dc9-5639aed4ea64</Parameter></Parameters></Method></ObjectPaths>

And it worked !!!!
image

So i figured it out that there is a problem with "getdefaultsitecollectiontermstore" call -> google -> result: central administration of my dev SharePoint site - one checkbox based on this article https://mohitvash.wordpress.com/2014/02/18/sharepoint-defaultsitecollectiontermstore-is-null/
And now it works as expected (with "getdefaultsitecollectiontermstore" call) .
Thank you for your time, there was problem on my environment.

Just wanted to share this ;-)

AJIXuMuK added a commit that referenced this issue Dec 17, 2019
@Gnanavelvengat
Copy link

Gnanavelvengat commented Sep 1, 2022

Taxonomy not showing items
<TaxonomyPicker
allowMultipleSelections={true}
termsetNameOrID={this.props.terms[0].key}
panelTitle="Select Term"
label="Term Store"
context={this.props.context}
onChange={(setTermstore1: IPickerTerms) =>
this._termstore_value(setTermstore1)
}
isTermSetSelectable={false}
/>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:tracked Triaged and are being investigated further status:working-on-it Known issue / feature being addressed. Will use other "status:*" labels & comments for more detail. type:bug
Projects
None yet
Development

No branches or pull requests

3 participants