4

I've installed the latest Sonata admin bundle on symfony 2.1 and got the following problem: strange labels

config.yml:

services:
  app.geo.admin.city:
      class: App\GeoBundle\Admin\CityAdmin
      tags:
        - { name: sonata.admin, manager_type: orm, group: Гео данные, label: Города}
      arguments: [null, App\GeoBundle\Entity\City, SonataAdminBundle:CRUD]

Admin class:

class CityAdmin extends Admin
{
    public function configureFormFields(FormMapper $formMapper)
    {
        $formMapper
            ->add('name', null, array('required' => true))
            ->add('code')
            ->add('region')
            ->add('crest', 'file', array('required' => false))
            ->add('banner', 'file', array('required' => false))
            ->add('sort')
        ;
    }
}
Elnur Abdurrakhimov
  • 44,533
  • 10
  • 148
  • 133
nucleartux
  • 1,381
  • 1
  • 14
  • 36

1 Answers1

1

That's a behaviour that I encountered as well a few weeks back. I think it disappeared after an update.

It usually makes sense to explicitly add labels to fields though, like so

$formMapper
    ->add('name', null, array('required' => true, 
            'label' => 'Lastname'
        ));
likeitlikeit
  • 5,563
  • 5
  • 42
  • 56