-
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
Added a min length of 3 and per_page to 20 to avoid infinite query #23841
Added a min length of 3 and per_page to 20 to avoid infinite query #23841
Conversation
…re search for nothing. And minLenght 3 was the classic editor base lenght search before. Limited searc hto 20 per_page. The old -1 was triggering many XHR request on a simple search, for nothing since we have a MAX_TERMS_SUGGESTIONS of 20.
packages/editor/src/components/post-taxonomies/flat-term-selector.js
Outdated
Show resolved
Hide resolved
packages/editor/src/components/post-taxonomies/flat-term-selector.js
Outdated
Show resolved
Hide resolved
if ( search.length >= 3 ) { | ||
this.searchRequest = this.fetchTerms({search}); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@draganescu BTW, since you are the main one who answer:
This part could be removed. It was just here to keep the OLD way, but searching with 1 letter with a peR_page of 20 and a max_suggestion of 20 doesn't create anymore XML request. It's just useless call (IMHO) since no one in UI will select a tags after 1 letter type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is part of FlatTermSelector
that is reused by other components, so keeping the length
check here seems okay to me.
So, can someone merge this? it seems pretty much done and ready |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @mgrenierfarmmedia, thanks for your work here! Just fix your linting issues and you'll be good to go 👍
packages/editor/src/components/post-taxonomies/flat-term-selector.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you and congrats on your first PR in GB @mgrenierfarmmedia - also kudos for finding this issue 💯
Congratulations on your first merged pull request, @mgrenierfarmmedia! We'd like to credit you for your contribution in the post announcing the next WordPress release, but we can't find a WordPress.org profile associated with your GitHub account. When you have a moment, visit the following URL and click "link your GitHub account" under "GitHub Username" to link your accounts: https://profiles.wordpress.org/me/profile/edit/ And if you don't have a WordPress.org account, you can create one on this page: https://login.wordpress.org/register Kudos! |
Hi @ntsekouras and @draganescu, Also, thanks for fixing the lint error there @ntsekouras, it was firing for no reason and was successful on my computer. I do not know what was the problem. Probably environment setup... Anyway, do any of you knows when this will be release? Best regards, |
Hey @mgrenierfarmmedia! It will be included in GB 8.9. |
Description
Edited the post_tag block, for editor, with a minLength of 3 since it was the classic editor base length search before. I also Limited search to 20 per_page. The old -1 was triggering many AJAX request on a simple search, for nothing since we have a MAX_TERMS_SUGGESTIONS of 20. Per consequence, with a large table of terms (We're talking about >> 2000 terms) we might have been hogging resources on the server for nothing.
How has this been tested?
Types of changes
Bug fix. Fixing issue #20734, my own. Also fixing some support request
Change is really small.
Checklist: