Closed napso closed 6 years ago
Could you provide an stack trace of the error?
Same problem here! I'm trying to use Froala within Admin class:
protected function configureFormFields(FormMapper $formMapper)
{
$formMapper
->add("text", FroalaEditorType::class)
But that code fails with the error:
Impossible to access an attribute ("options") on a null variable.
It throwns from that line:
vendor\sonata-project\admin-bundle\src\Resources\views\Form\form_admin_fields.html.twig (line 340):
{% if sonata_admin is defined and sonata_admin.options['form_type'] == 'horizontal' %}
I will leave this opened for now, but I dont see how is this suposed to be related with Sonata.
Probably the fix will need to be applied on Froala side.
Can someone take a look at my comment there? https://github.com/froala/KMSFroalaEditorBundle/issues/17#issuecomment-377077882
Once we confirm the bug is there, I will close the issue here.
Closing for now.. if someone wants to fix this and thinks it is on Sonata side, please ping to reopen, with the information we have, it is probably related to Froala form render.
Hello, guys !
Is possible to create own formatter for Froala ? do you have any documentation how to do this ? I am going to implement my own, i think i can to make PR with it to sonata formatter bundle but i do not know tow to implement it in right way.
Hello, @gansky-alexander !
You can find documentation in https://sonata-project.org/bundles/formatter/3-x/doc/index.html and in doc directory for each bundle. You can check how it is work in current code too.
Remember about "Froala Editor" license do not allow use it in Open Source Product (terms). We probably can merge integration code but with license info (like here) and without any Froala Editor
code.
Environment
Sonata packages
Symfony packages
PHP version
Subject
KMSFroalaEditorBundle is a symfony bundle that provides a custom formType to show the froala tich text editor.
normally in Symfony, you can just do the following:
however, when trying to add the froala type i get the follownig error:
Steps to reproduce
Expected results
The froala rich text editor.
Actual results