-
-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow replace AbstractAdminBlockService
by EditableBlockService
#764
Conversation
We should not.
We just need to support BlockBundle 4 on Sonata 4. |
@@ -31,45 +34,97 @@ | |||
*/ | |||
abstract class AbstractAdminBlockService extends AbstractBlockService implements AdminBlockServiceInterface |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class is already deprecated, no need to change anything right here
|
||
namespace Sonata\BlockBundle\Form\Mapper; | ||
|
||
use Sonata\AdminBundle\Form\FormMapper as AdminFormMapper; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not need any AdminBundle
reference. We decoupled this bundle from the admin bundle on the 4.x branch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code is use only when user generate form for Block in Admin site.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would still need to require sonataAdmin on master https://github.com/sonata-project/SonataBlockBundle/blob/master/composer.json
The right way should be to add this code on sonataAdmin instead, if necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIK we only need this mapping for the PageBundle:
https://github.com/sonata-project/SonataPageBundle/blob/3.x/src/Mapper/PageFormMapper.php
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So it could be directly added to the PageBundle then
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So it could be directly added to the PageBundle then
Already done ;)
This PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Subject
Based on sonata-project/dev-kit#785
AbstractAdminBlockService
should be replace byextends AbstractBlockService implements EditableBlockService
. To do it this methods should be replaced:buildEditForm
=>configureEditForm
buildCreateForm
=>confiureCreateForm
validateBlock
=>validate
getBlockMetadata
=>getMetadata
This change will allow move code to new methods with keep BC. In second step in
4.x
branch we can addAbstractAdminBlockService implement EditableBlockService
. In third step we can add support for BlockBundle v4 in sonata 3 (with some little BC-break).I am targeting this branch, because this change respect BC.
Changelog