You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think the problem is on SlackPhp\BlockKit\Blocks\Virtual\VirtualBlock::getIterator inherited by SlackPhp\BlockKit\Blocks\Virtual\CodeBlock.
It must yield from $blocks instead of return the current generator when blockId is null.
publicfunctiongetIterator(): Traversable
{
$blocks = parent::getIterator();
if ($this->blockId === null) {
return yield from $blocks;
// or// yield from $blocks;// return; // It make no diference, just change the return of $generator->getReturn() // https://www.php.net/manual/en/generator.getreturn.php
}
// ...
}
I do not know if this change breaks other components/classes, I just tested here.
The text was updated successfully, but these errors were encountered:
The Slack Block Kit for PHP is not working when use CodeBlock inside an array of blocks/attachments with blockId null.
Expected result
Current result
Possible Solution
I think the problem is on
SlackPhp\BlockKit\Blocks\Virtual\VirtualBlock::getIterator
inherited bySlackPhp\BlockKit\Blocks\Virtual\CodeBlock
.It must yield from
$blocks
instead of return the current generator whenblockId
is null.I do not know if this change breaks other components/classes, I just tested here.
The text was updated successfully, but these errors were encountered: