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

Remove the limit of 3 keywords for the block registration #13848

Merged
merged 3 commits into from
Feb 13, 2019
Merged

Conversation

gziolo
Copy link
Member

@gziolo gziolo commented Feb 13, 2019

Description

Opened to rebase and close #11953. All work was done by @jameelmoses.

Fixes: #11949
Instead of failing to register a block if more than 3 keywords are given, only return the first 3 by slicing the keywords array.

How has this been tested?

npm run lint

Types of changes

Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.

@gziolo gziolo changed the title Pr/11953 Remove the limit of 3 keywords for the block registration Feb 13, 2019
@gziolo gziolo added this to the 5.1 (Gutenberg) milestone Feb 13, 2019
@gziolo gziolo added [Feature] Block API API that allows to express the block paradigm. [Type] Enhancement A suggestion for improvement. labels Feb 13, 2019
@gziolo
Copy link
Member Author

gziolo commented Feb 13, 2019

#11953 was ✅ by @aduth and myself. Merging based on that.

@gziolo gziolo merged commit 26e3255 into master Feb 13, 2019
@gziolo gziolo deleted the pr/11953 branch February 13, 2019 08:37
youknowriad pushed a commit that referenced this pull request Mar 6, 2019
* Fixes #11949: Error: The block "xxx" can have a maximum of 3 keywords.

* Fixes #11949: Error: The block "xxx" can have a maximum of 3 keywords.

* Fixes #11949: Error: The block xxx can have a maximum of 3 keywords.
youknowriad pushed a commit that referenced this pull request Mar 6, 2019
* Fixes #11949: Error: The block "xxx" can have a maximum of 3 keywords.

* Fixes #11949: Error: The block "xxx" can have a maximum of 3 keywords.

* Fixes #11949: Error: The block xxx can have a maximum of 3 keywords.
@hacknug
Copy link

hacknug commented Sep 25, 2019

@gziolo why was this undocumented when it's still something that applies? Docs should be clear about it, no?

Also, why the hard limit? Couldn't find anything about the reasoning behind this limitation. Asking just for curiosity, not sure I'd ever need more than three keywords when I can have more than one in each string.

@gziolo
Copy link
Member Author

gziolo commented Sep 25, 2019

There is no limit anymore.

@hacknug
Copy link

hacknug commented Sep 26, 2019

But only the first three keywords are used when searching for a block. Am I missing something?

@gziolo
Copy link
Member Author

gziolo commented Sep 26, 2019

But only the first three keywords are used when searching for a block. Am I missing something?

Can you reproduce it?

Looking at code, I can't find any logic which would ignore any keywords:

keywords: blockType.keywords,

return matchSearch( item.title ) || some( item.keywords, matchSearch ) || ( itemCategory && matchSearch( itemCategory.title ) );

@hacknug
Copy link

hacknug commented Sep 26, 2019

You're right. I've just tested with a couple blocks I built from scratch and it definitely shows up. Issue was with ACF blocks so it might be something on their side. I'll look into it and follow up there. Sorry for the trouble ❤️

@gziolo
Copy link
Member Author

gziolo commented Sep 26, 2019

You're right. I've just tested with a couple blocks I built from scratch and it definitely shows up. Issue was with ACF blocks so it might be something on their side. I'll look into it and follow up there. Sorry for the trouble ❤️

It's totally fine. Thank you for testing with custom blocks 👍

This was referenced Apr 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Block API API that allows to express the block paradigm. [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error: The block "xxx" can have a maximum of 3 keywords.
3 participants