SonataBlockBundle icon indicating copy to clipboard operation
SonataBlockBundle copied to clipboard

Fix init of block settings

Open core23 opened this issue 3 years ago • 1 comments
trafficstars

Subject

This is a bug fix for the usage without the page bundle.

    {{ sonata_block_render({ 'type': 'sonata.media.block.gallery' }, {
        // ...
        "galleryId": 2
    }) }}

When passing a block definition $meta array to this method, the $settings will be ignored for this block itself, they are only passed to the block context. This will result in a null value for different blocks (e.g. https://github.com/sonata-project/SonataMediaBundle/blob/9946d8ac3e0f21f1198050e5f7501766b058e53a/src/Block/GalleryBlockService.php#L169).

I am targeting this branch, because this is a patch.

Changelog

### Fixed
- Fix init of block settings

core23 avatar Oct 09 '22 10:10 core23

@jordisala1991 You worked a little with blocks when upgrading SonataPageBundle, you might know this better than me

VincentLanglet avatar Oct 09 '22 16:10 VincentLanglet

Friednly ping @jordisala1991

VincentLanglet avatar Oct 19 '22 15:10 VincentLanglet