symfony3 & SonataAdmin & Formatter Bundle - Error when using formatter options "target_field" do not exist

namdt55555

I'm using symfony 3.1.4 and install SonataAdminBundle, SonataFormatterBundle. I'm having troubles using the Sonata Formatter Bundle.

  1. Install SonataFormatterBundle by this guide:

  2. I have an Entity: BlogSpost with 3 fields:

/**
 * @var string
 *
 * @ORM\Column(name="body", type="blob")
 */
private $body;
/**
 * @var string
 *
 */
private $rawBody;
/**
 * @var string
 *
 */
private $bodyFormatter ;
  1. Here is my formmapper in BlogPostAdmin class
class BlogPostAdmin extends AbstractAdmin
{
    protected function configureFormFields(FormMapper $formMapper)
    {
        $formMapper->add('title', 'text')
            ->add('bodyFormatter', 'sonata_formatter_type', array(
                'source_field'         => 'rawBody',
                'source_field_options' => array('attr' => array('class' => 'span10', 'rows' => 20)),
                'format_field'         => 'bodyFormatter',
                'target_field'         => 'body',
                'event_dispatcher'     => $formMapper->getFormBuilder()->getEventDispatcher()
            ))
            ->add('draft')
            ->add('published_time');
    }
    // ...
  1. But i receive this error below, when try to create a Post.

The options "event_dispatcher", "format_field", "source_field", "source_field_options", "target_field" do not exist. Defined options are: "action", "allow_extra_fields", "attr", "auto_initialize", "block_name", "by_reference", "compound", "constraints", "csrf_field_name", "csrf_message", "csrf_protection", "csrf_token_id", "csrf_token_manager", "data", "data_class", "disabled", "empty_data", "error_bubbling", "error_mapping", "extra_fields_message", "horizontal_input_wrapper_class", "horizontal_label_class", "horizontal_label_offset_class", "inherit_data", "invalid_message", "invalid_message_parameters", "label", "label_attr", "label_format", "label_render", "mapped", "method", "post_max_size_message", "property_path", "required", "sonata_admin", "sonata_field_description", "sonata_help", "translation_domain", "trim", "validation_groups". 500 Internal Server Error - UndefinedOptionsException

How do I resolve this issue?

viljums

There are a lot of compatibility problems with symfony 3.1.4, option resolver is one of them . I recommend to try 'formatter-bundle 4.x-dev', where it's fixed among other issues.

Also:

    form:
    resources:
        # ...
        - 'SonataFormatterBundle:Form:formatter.html.twig'

is deprecated and

    form_themes:    
        - 'SonataFormatterBundle:Form:formatter.html.twig'

should be used instead.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to reconfigure a logger formatter when using dictConfig

From Dev

jqGrid: using a predefined formatter inside a custom formatter

From Dev

Import IntelliJ formatter options into eclipse?

From Dev

Import IntelliJ formatter options into eclipse?

From Dev

RSpec throws argument error while using -f formatter

From Dev

Special characters not working in excel when using WEB API Media formatter

From Dev

Any way to skip a formatter token when using String.format()?

From Dev

Date formatter is not working when using with ionic and angular v2

From Dev

How to output new line when using Formatter.format?

From Dev

Changing formatter when using logging module with yaml in python

From Dev

CKEditor not showing with Sonata Formatter (Sonata Admin Bundle)

From Dev

How to bind property using a formatter

From Dev

Using row template and column formatter

From Dev

How to specify options to Custom Formatter in Accumulo

From Dev

UrlValidator Symfony "the options "" do not exist"

From Dev

'display_formatter' attribute error in Python

From Dev

Highcharts tooltip formatter using jquery replace

From Dev

Using simple class name in java logging formatter

From Dev

How to append to a file in java using formatter?

From Dev

Using a Formatter for the Currencies in SAPUI5

From Dev

Using a custom JSON formatter for Web API 2

From Dev

Using formatter in appendRow easy-ui

From Dev

use custom Formatter inside another custom formatter

From Dev

Uncaught Error: noUiSlider (10.0.0): must pass a formatter for all handles

From Java

How do you determine which formatter is being used for VS Code?

From Dev

How do I find the DateTime formatter pattern for this type of Date?

From Dev

How do I implement a MongoDB Bson formatter in Web API 2?

From Dev

How do I use a custom formatter for json serialization

From Dev

jqGrid column align does not work when there is formatter for ui-icon

Related Related

  1. 1

    How to reconfigure a logger formatter when using dictConfig

  2. 2

    jqGrid: using a predefined formatter inside a custom formatter

  3. 3

    Import IntelliJ formatter options into eclipse?

  4. 4

    Import IntelliJ formatter options into eclipse?

  5. 5

    RSpec throws argument error while using -f formatter

  6. 6

    Special characters not working in excel when using WEB API Media formatter

  7. 7

    Any way to skip a formatter token when using String.format()?

  8. 8

    Date formatter is not working when using with ionic and angular v2

  9. 9

    How to output new line when using Formatter.format?

  10. 10

    Changing formatter when using logging module with yaml in python

  11. 11

    CKEditor not showing with Sonata Formatter (Sonata Admin Bundle)

  12. 12

    How to bind property using a formatter

  13. 13

    Using row template and column formatter

  14. 14

    How to specify options to Custom Formatter in Accumulo

  15. 15

    UrlValidator Symfony "the options "" do not exist"

  16. 16

    'display_formatter' attribute error in Python

  17. 17

    Highcharts tooltip formatter using jquery replace

  18. 18

    Using simple class name in java logging formatter

  19. 19

    How to append to a file in java using formatter?

  20. 20

    Using a Formatter for the Currencies in SAPUI5

  21. 21

    Using a custom JSON formatter for Web API 2

  22. 22

    Using formatter in appendRow easy-ui

  23. 23

    use custom Formatter inside another custom formatter

  24. 24

    Uncaught Error: noUiSlider (10.0.0): must pass a formatter for all handles

  25. 25

    How do you determine which formatter is being used for VS Code?

  26. 26

    How do I find the DateTime formatter pattern for this type of Date?

  27. 27

    How do I implement a MongoDB Bson formatter in Web API 2?

  28. 28

    How do I use a custom formatter for json serialization

  29. 29

    jqGrid column align does not work when there is formatter for ui-icon

HotTag

Archive