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
When fetching root blocks, the default behaviour is to order by position. However, the same cannot be said for nested blocks, as the query simply fetches by parent_id without any ordering.
Steps to reproduce
Create a block that uses a block editor that references any block type.
Add an instance of that block to a module, such as a page.
Create a template for both blocks, and use renderChildren(name) in the root block template.
Add some child blocks and re-order them. The order will not be as intended.
Expected result
Nested blocks at all levels should rendered be in the order defined.
Actual result
Nested blocks are ordered as per the database’s default ordering.
Steps to correct
In BlockRenderer, exchange the $childBlocks assignment in getNestedBlocksForBlock to:
Description
When fetching root blocks, the default behaviour is to order by position. However, the same cannot be said for nested blocks, as the query simply fetches by parent_id without any ordering.
Steps to reproduce
renderChildren(name)
in the root block template.Expected result
Nested blocks at all levels should rendered be in the order defined.
Actual result
Nested blocks are ordered as per the database’s default ordering.
Steps to correct
In BlockRenderer, exchange the
$childBlocks
assignment ingetNestedBlocksForBlock
to:(May I open a PR against 3.x?)
Versions
Twill version: 3.0.0-beta2
Laravel version: 9.x
PHP version: 8.1
Database engine: Postgres 14
The text was updated successfully, but these errors were encountered: