-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[Notifier][Slack] Error trown when having more than 10 fields specified #36346 #36347
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
[Notifier][Slack] Error trown when having more than 10 fields specified #36346 #36347
Conversation
src/Symfony/Component/Notifier/Bridge/Slack/Block/SlackSectionBlock.php
Outdated
Show resolved
Hide resolved
@birkof Have you seen my comment? Do you agree? |
f898a1c
to
2ea2b64
Compare
2ea2b64
to
68b2490
Compare
Thank you @birkof. |
@@ -44,6 +44,11 @@ public function field(string $text, bool $markdown = true): self | |||
'text' => $text, | |||
]; | |||
|
|||
// Maximum number of items is 10 | |||
if (10 <= \count($this->options['fields'])) { |
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.
should be <
, with <=
you throw not only for count > 10
but also for count == 10
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.
Good catch, fixed in 7bac792
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.
@guilliamxavier you're right! I have tested more over here and you're right!
As written in docs of Section block, for fields we have to had maximum 10 items specified.