Closed eerison closed 2 years ago
"Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent::getException()" method is deprecated since Symfony 4.4, use "getThrowable()"
is getting fixed by this: #1429
The "Sonata\PageBundle\Twig\Extension\PageExtension" class implements "Twig\Extension\InitRuntimeInterface" that is deprecated since Twig 2.7, to be removed in 3.0.
isn't fixed by #1423 but will be by #1436
The "Sonata\PageBundle\Twig\Extension\PageExtension" class implements "Twig\Extension\InitRuntimeInterface" that is deprecated since Twig 2.7, to be removed in 3.0.
isn't fixed by #1423 but will be by #1436
Ok I changed ;) Thanks :)
2x: Passing a null message when instantiating a "Symfony\Component\Validator\ConstraintViolation" is deprecated since Symfony 4.4. 1x in UniqueUrlValidatorTest::testValidateWithPageFound from Sonata\PageBundle\Tests\Validator 1x in UniqueUrlValidatorTest::testValidateWithRootUrlAndNoParent from Sonata\PageBundle\Tests\Validator
will be fixed by this: https://github.com/sonata-project/SonataPageBundle/pull/1437
The Translator was the culprit
@VincentLanglet how do i fix these two?
1x: The "Sonata\AdminBundle\Admin\AbstractAdmin::getBaseRoutePattern()" method is considered final since sonata-project/admin-bundle 3.102. It may change without further notice as of its next major version. You should not extend it from "Sonata\PageBundle\Admin\SharedBlockAdmin". 1x in CreateSnapshotsCommandTest::setUp from Sonata\PageBundle\Tests\Command 1x: The "Sonata\AdminBundle\Admin\AbstractAdmin::getBaseRouteName()" method is considered final since sonata-project/admin-bundle 3.102. It may change without further notice as of its next major version. You should not extend it from "Sonata\PageBundle\Admin\SharedBlockAdmin".
caused by this: https://github.com/sonata-project/SonataPageBundle/blob/f66917525405ec7ecce0880043089bcf851019a1/src/Admin/SharedBlockAdmin.php#L39-L47
because these are "would be" final, i can't overwrite them like that, and if i would try to set them later, i can't overwrite the cached values?
You can override directly the protected variable https://github.com/sonata-project/SonataAdminBundle/blob/4.x/src/Admin/AbstractAdmin.php#L112-L119
Can't it do the job ?
You can override directly the protected variable https://github.com/sonata-project/SonataAdminBundle/blob/4.x/src/Admin/AbstractAdmin.php#L112-L119
Can't it do the job ?
Yes I could set these but that doesn't work like the current function
Because BaseBlockAdmin doesn't set these values they need to be calculated from class. And when they do, the cache values are set. Now setting the variable doesn't change anything because of the cache ones.
for example i tried this:
public function configure()
{
$this->baseRoutePattern = sprintf('%s/%s', $this->getBaseRoutePattern(), 'shared');
$this->baseRouteName = sprintf('%s/%s', $this->getBaseRouteName(), 'shared');
}
which doesn't work because of cached values
Ok, I have some questions
What are the current values of routePattern and routeName with the override ? I see it's %s/shared
but I need to know the whole value to understand why we can't reproduce it with
protected $baseRoutePattern = 'foo/shared`
protected $baseRouteName = 'foo/shared`
Why does it matter to suffix this with shared
? Can't we just remove the override and let the default behavior ? This is weird for instance to have a /
in the baseRouteName, everywhere else we use _
.
It will help me to find the best solutions.
Ok, I have some questions
* What are the current values of routePattern and routeName with the override ? I see it's `%s/shared` but I need to know the whole value to understand why we can't reproduce it with
protected $baseRoutePattern = 'foo/shared` protected $baseRouteName = 'foo/shared`
* Why does it matter to suffix this with `shared` ? Can't we just remove the override and let the default behavior ? This is weird for instance to have a `/` in the baseRouteName, everywhere else we use `_`.
It will help me to find the best solutions.
the thing is done using %sonata.page.admin.block.entity%
parameter for class and getting the dynamic part, then it uses the function above and adds /shared
to it
for why it does it to not collide with the other page admin that uses the same entity as class
I currently doesn't see a better way than https://github.com/sonata-project/SonataAdminBundle/pull/7867 which would allow the override in PageBundle.
WDYT @jordisala1991 ?
i need to run the tests for this again, but the only thing i see are the big Twig change and the Command + Services change.
and both of them already got PRs
IMHO the command PR need to be restarted since we plan to
For twig there is some changes needed https://github.com/sonata-project/SonataPageBundle/pull/1423
And if you want to help to find a solution, there is this issue https://github.com/sonata-project/SonataPageBundle/issues/1442
1x: The "Sonata\Doctrine\Entity\BaseEntityManager::getConnection()" method is deprecated since sonata-project/sonata-doctrine-extensions 1.15 and will be removed in version 2.0. Use "getEntityManager()->getConnection()" instead. 1x in SnapshotManagerTest::testEnableSnapshots from Sonata\PageBundle\Tests\Entity
hm the snapshotmanager uses sql instead of dql or query builder i will see if i can make that better
On Sql/dql there is this issue https://github.com/sonata-project/SonataPageBundle/issues/1426 dunno if it's the same subject.
yeah partly, but also the enable snapshots query
IMHO the command PR need to be restarted since we plan to
- Remove the BaseCommand
- Inject dependencies in the constructor But it needs Feature/1415/Decouple notification-bundle from cleanup snapshot #1434 I think
For twig there is some changes needed #1423
And if you want to help to find a solution, there is this issue #1442
I'm deprecating the baseCommand in my Pull request ;)
Ok I checked again the 4.x
branch and I can see only 6 direct deprecation
that is a impediment to support Symfony 5 and sonata 4
The first two will need something like this on SonataAdmin 4 https://github.com/sonata-project/SonataAdminBundle/pull/7867
The "Sonata\Doctrine\Entity\BaseEntityManager::getConnection()"
the Connection thing is part of the Query rework I'm trying to do, i just need to write better testcases
https://github.com/sonata-project/SonataPageBundle/pull/1446
1x: The "Sonata\BlockBundle\Block\BlockContextManager" class is considered final since sonata-project/block-bundle 3.0. It may change without further notice as of its next major version. You should not extend it from "Sonata\PageBundle\Block\BlockContextManager". 1x in BlockContextManagerTest::testGetWithValidData from Sonata\PageBundle\Tests\Block
1x: The "Sonata\BlockBundle\Block\Service\ContainerBlockService" class is considered final since sonata-project/block-bundle 3.0. It may change without further notice as of its next major version. You should not extend it from "Sonata\PageBundle\Block\ContainerBlockService". 1x in ContainerBlockServiceTest::testExecute from Sonata\PageBundle\Tests\Block
what to do with these two? the blockbundle ones can't be extended anymore. Are the page bundle ones really needed?
otherwise i will think about something
For the second class,
For the first class, the simpler solution I see is to provide an AbstractBlockContextManager in BlockBundle with everything final except protected configureSettings
. Then it will be extended by BlockBundle and PageBundle differently.
yeah i was thinking about decoration too
also PageBundle still points to 3.x Block Bundle and not 4.x, but that might be work for another PR
yeah i was thinking about decoration too
also PageBundle still points to 3.x Block Bundle and not 4.x, but that might be work for another PR
Two solutions:
If it's not too much work, I prefer the second solution, this avoid a release on an old branch.
Seems like there is https://github.com/sonata-project/SonataPageBundle/pull/1448 for the block deprecations. Help on the review is appreciated @Hanmac :)
public function configure() { $this->baseRoutePattern = sprintf('%s/%s', $this->getBaseRoutePattern(), 'shared'); $this->baseRouteName = sprintf('%s/%s', $this->getBaseRouteName(), 'shared'); }
What about:
public function configure()
{
$this->baseRoutePattern = sprintf('%s/%s', parent::getBaseRoutePattern(), 'shared');
$this->baseRouteName = sprintf('%s/%s', parent::getBaseRouteName(), 'shared');
}
Can you try with that? @Hanmac
public function configure() { $this->baseRoutePattern = sprintf('%s/%s', $this->getBaseRoutePattern(), 'shared'); $this->baseRouteName = sprintf('%s/%s', $this->getBaseRouteName(), 'shared'); }
What about:
public function configure() { $this->baseRoutePattern = sprintf('%s/%s', parent::getBaseRoutePattern(), 'shared'); $this->baseRouteName = sprintf('%s/%s', parent::getBaseRouteName(), 'shared'); }
Can you try with that? @Hanmac
i didn't tried yet, but it doesn't work because calling getBaseRoutePattern would cache the result and then setting baseRoutePattern wouldn't have any effect
I just tried, it cant be done without the Pr opened by @VincentLanglet . So this deprecation will be only fixed on 4.x
I will work on those two deprecations
https://github.com/sonata-project/SonataPageBundle/pull/1470 1x: The "Sonata\AdminBundle\Admin\AbstractAdmin::getBaseRoutePattern()" method is considered final since sonata-project/admin-bundle 3.102. It may change without further notice as of its next major version. You should not extend it from "Sonata\PageBundle\Admin\SharedBlockAdmin". 1x in BaseBlockAdminTest::testSettingAsEditedOnPreBatchDeleteAction from Sonata\PageBundle\Tests\Admin
https://github.com/sonata-project/SonataPageBundle/pull/1470 1x: The "Sonata\AdminBundle\Admin\AbstractAdmin::getBaseRouteName()" method is considered final since sonata-project/admin-bundle 3.102. It may change without further notice as of its next major version. You should not extend it from "Sonata\PageBundle\Admin\SharedBlockAdmin". 1x in BaseBlockAdminTest::testSettingAsEditedOnPreBatchDeleteAction from Sonata\PageBundle\Tests\Admin
I just tried, it cant be done without the Pr opened by @VincentLanglet . So this deprecation will be only fixed on 4.x
tried what? I don't get it!
I just tried, it cant be done without the Pr opened by @VincentLanglet . So this deprecation will be only fixed on 4.x
tried what? I don't get it!
You currently cannot solve the deprecations, we need to finish and release https://github.com/sonata-project/SonataAdminBundle/pull/7867. And this will only be solve in 4.x.
The issue is that you cannot override
public function getBaseRoutePattern()
{
return sprintf('%s/%s', parent::getBaseRoutePattern(), 'shared');
}
public function getBaseRouteName()
{
return sprintf('%s/%s', parent::getBaseRouteName(), 'shared');
}
I just tried, it cant be done without the Pr opened by @VincentLanglet . So this deprecation will be only fixed on 4.x
tried what? I don't get it!
You currently cannot solve the deprecations, we need to finish and release sonata-project/SonataAdminBundle#7867. And this will only be solve in 4.x.
The issue is that you cannot override
public function getBaseRoutePattern() { return sprintf('%s/%s', parent::getBaseRoutePattern(), 'shared'); } public function getBaseRouteName() { return sprintf('%s/%s', parent::getBaseRouteName(), 'shared'); }
Yeah it's the issue, and when this PR pass, should I be able to override getBaseRoutePattern
?
Edit 1: and your PR will fix all those deprecations that are missing?
1x: The "Sonata\BlockBundle\Block\BlockContextManager" class is considered final since sonata-project/block-bundle 3.0. It may change without further notice as of its next major version. You should not extend it from "Sonata\PageBundle\Block\BlockContextManager". 1x in BlockContextManagerTest::testGetWithValidData from Sonata\PageBundle\Tests\Block 1x: The "Sonata\BlockBundle\Block\Service\ContainerBlockService" class is considered final since sonata-project/block-bundle 3.0. It may change without further notice as of its next major version. You should not extend it from "Sonata\PageBundle\Block\ContainerBlockService". 1x in ContainerBlockServiceTest::testExecute from Sonata\PageBundle\Tests\Block
this will be fixed by #1448
Yeah it's the issue, and when this PR pass, should I be able to override getBaseRoutePattern?
You'll be able to override generateBaseRoutePattern. But only in the same PR than the one which bump the SonataAdmin dependency. So it's all or nothing.
I guess it's just missing to add sonata admin 4 to solve this deprecation
1x: The "Sonata\AdminBundle\Admin\AbstractAdmin::getBaseRoutePattern()" method is considered final since sonata-project/admin-bundle 3.102. It may change without further notice as of its next major version. You should not extend it from "Sonata\PageBundle\Admin\SharedBlockAdmin". 1x in BaseBlockAdminTest::testSettingAsEditedOnPreBatchDeleteAction from Sonata\PageBundle\Tests\Admin
It requires a SonataAdmin release first.
I guess it's just missing to add sonata admin 4 to solve this deprecation
1x: The "Sonata\AdminBundle\Admin\AbstractAdmin::getBaseRoutePattern()" method is considered final since sonata-project/admin-bundle 3.102. It may change without further notice as of its next major version. You should not extend it from "Sonata\PageBundle\Admin\SharedBlockAdmin". 1x in BaseBlockAdminTest::testSettingAsEditedOnPreBatchDeleteAction from Sonata\PageBundle\Tests\Admin
Will be done with https://github.com/sonata-project/SonataPageBundle/pull/1485 so we can be close this
⚠️ Deprecations that need to be solved for Symfony 5 upgrade.
Remaining direct deprecation notices (6)
Deprecations related with bundles.