-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
buildTermsTree returns only 1 result #20430
Comments
Is there any feedback regarding this? I guess it's not reproduceable, but is there any plan to provide a new SelectControl which behaves more like an autocomplete and searches for typing? It could occure, that there are a lot of Pages/CPT Posts which need to be rendered. So instead doing multiple requests and splitting up, you can just show the "current selected" and search on staring typing. |
@Chrico We experienced this problem today in a site with just over 140 pages. In my opinion the orderby on the query should include post_parent and name/title |
Hi @Chrico. Could you please provide some steps to follow which demonstrates the problem? I'm not sure how to test it otherwise. |
Good morning @noisysocks . Steps are kind of listed in initial issue description: You need a CPT which is hierarchical and >100 Posts in it with "menu_order = 0" (default). When you try to select the "menu_order" it renders not correctly. But in 9 month since i created the issue, a lot has changed...need to re-test, probably even the shown code does not exists anymore like it was before. |
@Chrico checking back in on this and am going to close this out for now. Know that we can easily re-open if upon retesting you can re-confirm the issue. Thanks so much! |
Describe the bug
We're using a CPT which is hierarchical.
In Gutenberg the "Select Parent" only shows 1 item, but we have 198 results splitted up into 2 requests for this select:
When debugging the component i'm seeing, that the
buildTermsTree
just returns an array with 1 result:a
= result from those 2 splitted up requestss
= the result frombuildTermsTree
As far as i could debug, the error occurs in the recursive function
fillWithChildren
, after applying this on the terms, the array will shrink to 1.Additional context
This seems also to be related to #12795 - maybe it is time to avoid rendering such "large" things and adding a select with autocomplete search functionality like e.G. https://react-select.com/home does.
The text was updated successfully, but these errors were encountered: