Skip to content

Commit ab27d32

Browse files
Add support for SonataBlockBundle 5.0 (#762)
* Add support for SonataBlockBundle 5.0 * Test with 5.0 * Actualizar config.yaml * Create config_sonata_block_v4.yaml * Actualizar AppKernel.php * Actualizar AppKernel.php
1 parent 02032e0 commit ab27d32

File tree

5 files changed

+15
-2
lines changed

5 files changed

+15
-2
lines changed

.github/workflows/test.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ jobs:
4646
dependencies: highest
4747
allowed-to-fail: false
4848
variant: sonata-project/form-extensions:"2.0.0-alpha-1"
49+
- php-version: '8.2'
50+
dependencies: highest
51+
allowed-to-fail: false
52+
variant: sonata-project/block-bundle:"5.0.0-alpha-1"
4953
- php-version: '8.2'
5054
dependencies: highest
5155
allowed-to-fail: false

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"friendsofsymfony/ckeditor-bundle": "^2.0",
2727
"psr/container": "^1.0 || ^2.0",
2828
"psr/log": "^2.0 || ^3.0",
29-
"sonata-project/block-bundle": "^4.11",
29+
"sonata-project/block-bundle": "^4.11 || ^5.0",
3030
"sonata-project/form-extensions": "^1.4 || ^2.0",
3131
"symfony/config": "^5.4 || ^6.2",
3232
"symfony/dependency-injection": "^5.4 || ^6.2",

tests/App/AppKernel.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use FOS\CKEditorBundle\FOSCKEditorBundle;
1919
use Knp\Bundle\MenuBundle\KnpMenuBundle;
2020
use Sonata\AdminBundle\SonataAdminBundle;
21+
use Sonata\BlockBundle\Cache\HttpCacheHandler;
2122
use Sonata\BlockBundle\SonataBlockBundle;
2223
use Sonata\Doctrine\Bridge\Symfony\SonataDoctrineBundle;
2324
use Sonata\DoctrineORMAdminBundle\SonataDoctrineORMAdminBundle;
@@ -80,6 +81,9 @@ protected function configureRoutes(RoutingConfigurator $routes): void
8081
$routes->import(__DIR__.'/config/routes.yaml');
8182
}
8283

84+
/**
85+
* @psalm-suppress DeprecatedClass
86+
*/
8387
protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void
8488
{
8589
$loader->load(__DIR__.'/config/config.yaml');
@@ -88,6 +92,10 @@ protected function configureContainer(ContainerBuilder $container, LoaderInterfa
8892
$loader->load(__DIR__.'/config/config_symfony_v5.yaml');
8993
}
9094

95+
if (class_exists(HttpCacheHandler::class)) {
96+
$loader->load(__DIR__.'/config/config_sonata_block_v4.yaml');
97+
}
98+
9199
$loader->load(__DIR__.'/config/services.php');
92100
$container->setParameter('app.base_dir', $this->getBaseDir());
93101
}

tests/App/config/config.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ sonata_admin:
7575
This is for testing purposes
7676
7777
sonata_block:
78-
http_cache: false
7978
blocks:
8079
sonata.formatter.block.formatter: null
8180

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
sonata_block:
2+
http_cache: false

0 commit comments

Comments
 (0)