Closed simbu-g2t closed 5 years ago
you have a wrong import of the FormMapper class. Just look at the stack trace.
AFAIK this is not a general bug in this bundle.
-- writing from my mobile device
Hi @core23 Thanks for the immediate reply!
I just followed the officia doc The imports there are like this only. Can you please give me the working solutions
Thanks in advance
I think the issue here is that the documentation for the version you're using (3.x) is missing, the docs you're referring to are for the yet unreleased 4.x version (represented by master
branch in this package).
In this case you may try to check if the documentation for 2.x helps:
https://sonata-project.org/bundles/block/2-0/doc/reference/your_first_block.html#first-namespaces
IMO, in the meantime we should try to solve the situation.
/cc @core23.
@phansys Same issue with https://sonata-project.org/bundles/block/2-0/doc/reference/your_first_block.html this doc also. Is there any solution to overcome this issue?
Thanks in advance!
Can you have a look at the current docs? https://github.com/sonata-project/SonataBlockBundle/blob/3.x/docs/reference/your_first_block.rst
@sonata-project/contributors We should update the gitlab project and check all projects
@core23 This is the new issue with 3.x doc
Compile Error: Cannot declare class Sonata\BlockBundle\Block\MyBlockService, because the name is already in use
I don't know what mistake I made for this issue. Kindly give me the solution, Thanks
Sorry, but we try to keep github issues for feature requests and bugs only.
Compile Error: Cannot declare class Sonata\BlockBundle\Block\MyBlockService, because the name is already in use
Maybe your filename and class do not match our you have declared the same class (with same namespace) anywhere else.
Environment
Sonata packages
Symfony packages
PHP version
Subject
I want to create a block for CTA(Call To Action) with HTML code customization. So I tried to create a new block with help of this officia doc. But I got the compatible error like below
I searched it but didn't find any answers. https://github.com/sonata-project/SonataBlockBundle/issues/324 was not resolved my issue. Because I'm useing latest versions. So I'm asking to you, what should I do to solve it ?
Steps to reproduce
1.config/services.yaml
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\OptionsResolver\OptionsResolverInterface; use Sonata\BlockBundle\Block\BlockContextInterface; use Sonata\BlockBundle\Block\Service\AbstractBlockService; use Sonata\BlockBundle\Mapper\FormMapper; use Sonata\BlockBundle\Model\BlockInterface; use Sonata\Form\Validator\ErrorElement;
class MyBlockService extends BaseBlockService { public function getName() { return 'My Block'; }
}
{# blocks/myblock.html.twig #} {% extends sonata_block.templates.block_base %}
{% block block %}
{{ settings.title }}
{% endblock %}
sonata_block: default_contexts: [sonata_page_bundle] context_manager: sonata.page.block.context_manager blocks: sonata.block.service.text: ~ sonata.block.service.container: ~ sonata.media.block.feature_media: ~ sonata.media.block.media: ~ sonata.media.block.gallery: ~ sonata.formatter.block.formatter: ~ sonata.block.service.menu: ~ sonata.product.block.categories_menu: ~ sonata.block.service.myblock: ~