Questions tagged [sonata-admin]

SonataAdminBundle is a Symfony bundle to generate robust user friendly administration interfaces.

Useful links

The Sonata Project is an open source set of bundles which are built on top of Symfony2. It's majorly based on the community work around the globe and uses the most known bundles released by:

2072 questions
9
votes
2 answers

FosuserBundle ( The path "fos_user.from_email.address" cannot contain an empty value, but got null. )

I have a problem when I Install FOsuserbundle. This is my problem in result: this is my config.yml: fos_user: db_driver: orm # other valid values are 'mongodb' and 'couchdb' firewall_name: main user_class: AppBundle\Entity\User …
Hamza Najemi
  • 243
  • 3
  • 9
  • 15
9
votes
2 answers

Remove specific routes per user role in Sonata without SonataUserBundle

I make use of SonataAdminBundle in Symfony 3. Because I use Symfony 3, I still can't make use of SonataUserBundle. So I am using SonataAdminBundle with FOSUserBundle only. Now what I try to achieve is to hide specific routes per role. For example, I…
Mentos93
  • 581
  • 1
  • 7
  • 28
9
votes
1 answer

SonataAdminBundle ACL usage in configureFormFields

I've installed SonataAdminBundle, SonataUserBundle and FOSUserBundle as well as CoopTilleulsAclSonataAdminExtensionBundle while using ACL in the SonataAdminBundle. The listings are filtered by owners and all is fine. Customer A can see just his…
Michael
  • 178
  • 1
  • 11
9
votes
1 answer

Adding a custom form inside the show template of a Sonata Admin Entity

I want to generate a small form inside a Sonata Admin show template. What I have done so far is creating the function in the custom CRUD for that specific entity (order) that extends from Sonata's default CRUD; public function approveOrderAction($id…
Jack Brummer
  • 583
  • 1
  • 6
  • 14
9
votes
1 answer

Sort list view in Sonata Admin by related entity fields

Using Sonata Admin Bundle, which is a great add-on for Symfony, I have bumped into the problem described as follows. Let's say we have 3 entities: City, State and Country. They all have the properties id and name. City has a many-to-one relation to…
cezar
  • 11,616
  • 6
  • 48
  • 84
9
votes
6 answers

SonataAdmin, add menu on left

I'm working on Symfony2 and SonataAdminBundle. I need to know how to add a menu in the left part of my dashboard ? Like in the screen : I need to have the Dashboard block in the left part on the page (in dark-grey on my screen).. how can i do that…
Clément Andraud
  • 9,103
  • 25
  • 80
  • 158
9
votes
3 answers

Symfony2: SonataAdminBundle - How can i get the object representing the current user inside an admin class?

I use the sonata-admin bundle. I have the relationship with the user (FOSUserBundle) in the PageEntity. I want to save the current user which create or change a page. My guess is get the user object in postUpdate and postPersist methods of the…
user3342506
  • 159
  • 1
  • 2
  • 8
9
votes
3 answers

Symfony2 - Sonata Admin - add javascript before field

In admin class: protected function configureFormFields(FormMapper $formMapper) { $formMapper ->add('name', 'text') ->add('description', 'text') ; } I don't know how I can before "name" add javascript, can you help…
tengopl
  • 453
  • 1
  • 4
  • 9
9
votes
1 answer

Symfony sonata admin bundle without entity

Is there the way to use sonata admin bundle without entity - so without doctrine? I need to list files on some directory, this list is not stored in database. The first approach I tried was to declare my own Model manager, but there are some places…
falinsky
  • 7,229
  • 3
  • 32
  • 56
9
votes
1 answer

Sonata Admin how to read not mapped field?

I added fields with the option "mapped" => false to a SonataAdmin form. Now I need to access the values of the form fields marked with "mapped" => false in the method postUpdate. How can I retrieve them?
Olindo Pindaro
  • 115
  • 2
  • 8
9
votes
1 answer

IntlDateFormatter::format(): datefmt_format: takes either an array or an integer timestamp value or a DateTime object (SonataSanBox)

I have installed SonataAdmin Bundle. All is working fine but, when I add any user from dashboard, it throws a warning: Warning: IntlDateFormatter::format(): datefmt_format: takes either an array or an integer timestamp value or a DateTime object in…
Krishna Ghodke
  • 589
  • 2
  • 6
  • 26
9
votes
1 answer

Add custom button to edit page of sonata admin bundle

As you know, sonata admin bundle comes with three buttons in edit page which are "Add new, update and delete". I can remove delete button with this: protected function configureRoutes(RouteCollection $collection) { $collection …
alpcanaydin
  • 113
  • 1
  • 1
  • 6
8
votes
2 answers

How to access Entity class from Sonata Admin's Admin class?

Let me explain: I have an Entity class Item with a method getName() in it, namespace App\Entity. I have an admin class for it in Sonata Admin, namespace App\Admin, and would like to call that method from within, how to do so? //Symfony2…
Muhammed
  • 1,592
  • 1
  • 10
  • 18
8
votes
2 answers

No entity manager defined for class

I am trying to just display a list. My Supplier and Property list were displaying until I implemented the product list :( Now I get this error with the Supplier and Property lists but not for the newly added product list: Here is my…
Kal
  • 2,239
  • 6
  • 36
  • 74
8
votes
1 answer

Sonata admin, custom query in filter

I'm using SonataAdminBundle and I have a question about filters in the class MyEntityAdmin. I have a first function protected function configureFormFields(FormMapper $formMapper) for list all fields to be shown on create/edit forms. If I have a…
Clément Andraud
  • 9,103
  • 25
  • 80
  • 158