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 suggestion not working in SharePoint Online #629

Closed
limcysam opened this issue Aug 10, 2020 · 9 comments
Closed

TaxonomyPicker suggestion not working in SharePoint Online #629

limcysam opened this issue Aug 10, 2020 · 9 comments
Labels
status:duplicate Duplicate of another issue. See comments for reference to other issue. Duplicates typically closed.

Comments

@limcysam
Copy link

Category

[ ] Bug

Version

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

Expected / Desired Behavior / Question

Suggestion load as when clicked on the icon

Observed Behavior

Suggestion do not load with spinning wheel in type ahead

Steps to Reproduce

Type in a existing term within the textbox

TaxonomyPickerIssue

@ghost
Copy link

ghost commented Aug 10, 2020

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

@ghost ghost added the Needs: Triage 🔍 label Aug 10, 2020
@limcysam limcysam changed the title TaxonomyPicker Suggesstion not working in SharePoint Online TaxonomyPicker suggestion not working in SharePoint Online Aug 10, 2020
@Matej4386
Copy link

Matej4386 commented Aug 12, 2020

Hello, just found out that suggestions are not working also on on-prem SP 2019.

Rest call (Payload) containst undefined parameter:
<Method Id="6" ParentId="3" Name="GetTerm"><Parameters><Parameter Type="String">**undefined**</Parameter></Parameters></Method><Property Id="9" ParentId="6" Name="Terms" />

it is called from:
termsService.searchTermsByTermId(filterText, this.props.termPickerHostProps.anchorId)];

anchorId is undefined.

Response is:
Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).

Terms are loaded properly in Panel.

@Matej4386
Copy link

Matej4386 commented Aug 12, 2020

Hmm i changed some lines and now it works:

In TermPicker.js -> onFilterChanged function:
termsService.searchTermsByTermId(filterText, this.props.termPickerHostProps.termsetNameOrID)]; was anchorId

In SPTermStorePickerService.js -> searchTermsByTermId function i have replaced data with this one:
var data = '<Request xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0" ApplicationName="Javascript Library"><Actions><ObjectPath Id="1" ObjectPathId="0" /><ObjectIdentityQuery Id="2" ObjectPathId="0" /><ObjectPath Id="4" ObjectPathId="3" /><ObjectIdentityQuery Id="5" ObjectPathId="3" /><ObjectPath Id="7" ObjectPathId="6" /><ObjectIdentityQuery Id="8" ObjectPathId="6" /><ObjectPath Id="10" ObjectPathId="9" /><Query Id="11" ObjectPathId="6"><Query SelectAllProperties="true"><Properties /></Query></Query><Query Id="12" ObjectPathId="9"><Query SelectAllProperties="false"><Properties /></Query><ChildItemQuery SelectAllProperties="false"><Properties><Property Name="IsRoot" SelectAll="true" /><Property Name="Labels" SelectAll="true" /><Property Name="TermSet" SelectAll="true" /><Property Name="TermsCount" SelectAll="true" /><Property Name="Id" SelectAll="true" /><Property Name="Name" SelectAll="true" /><Property Name="PathOfTerm" SelectAll="true" /><Property Name="LocalCustomProperties" SelectAll="true" /><Property Name="IsDeprecated" ScalarProperty="true" /><Property Name="IsAvailableForTagging" ScalarProperty="true" /></Properties></ChildItemQuery></Query></Actions><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">'+ termId +'</Parameter></Parameters></Method><Method Id="9" ParentId="6" Name="GetAllTerms" /></ObjectPaths></Request>';

Now it works.

@TheThor59
Copy link

Hello,

I encountered the same issue on this component through an integration with SPFx ListCommand. I found the same issue in the query as @Matej4386 did.

@Matej4386 In terms of correction that should not be suffisant to fix that way as if I'd like to let users select or search terms in the children of a specific term of my TermSet, it should use anchorId if it's not null and, if it's null, use the TermSetId. The change of the query is pretty much mandatory to be able to search without using a sub term as root of your field.

I tested the correction of @Matej4386 and it's working for TermSet without needing an anchorId, this should be implemented.

@TheThor59
Copy link

TheThor59 commented Aug 12, 2020

A correction has already been made on DEV so fix will arrive soon. I added a fix in a pull request that allow to directly provide result from sharepoint rest query loading list's fields. When passing the AnchorId parameter from a field's properties, the empty GUID was in use, making the suggestion query crash. I fixed this point.
We will need to wait for the next version for this fix.

@limcysam
Copy link
Author

@TheThor59 when will the next version be released?

@AJIXuMuK AJIXuMuK added status:duplicate Duplicate of another issue. See comments for reference to other issue. Duplicates typically closed. and removed Needs: Triage 🔍 labels Aug 14, 2020
@AJIXuMuK
Copy link
Collaborator

Thank you @limcysam for reporting this.
It seems like a duplicate of #604 that has been fixed and will be available in the next version.

@limcysam
Copy link
Author

Caan you please let me know when will the next version with the fix be released?

@AJIXuMuK
Copy link
Collaborator

@limcysam we plan to release the next version in next 2 weeks or so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:duplicate Duplicate of another issue. See comments for reference to other issue. Duplicates typically closed.
Projects
None yet
Development

No branches or pull requests

4 participants