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
12
votes
2 answers

Get old data in preUpdate Sonata Admin Bundle

I have a product entity and it has an images field that store the images names from the product but the images names depends of a part_number field that is unique, so if the user make a mistake in the part number and he wants to edit it then I also…
tttony
  • 4,944
  • 4
  • 26
  • 41
12
votes
1 answer

Sonata Admin edit form many to many not working - symfony2.1.6

I am having a problem with implementing the many to many relationship in the sonata admin edit form, with the following structure. purchase (id, total_price, discount, created_at) purchase_product (purchase_id, product_id, quantity) product (id,…
dagger
  • 515
  • 2
  • 6
  • 17
12
votes
1 answer

Sonata Admin: Add custom triggers/actions to list/edit action

I'm using SonataAdminBundle for managing entities in my application. The admins of the site can add videos, and some of them first need to be approved by their speakers. There is an authorization system working already - I have working code which…
Teo.sk
  • 2,619
  • 5
  • 25
  • 30
11
votes
1 answer

Sonata Admin custom query in configureListFields

I am stuck on this for several hours. I have admin class to list all categories and in one table column there are related products (Product entity): Table example Related code: protected function configureListFields(ListMapper $listMapper) { …
David K
  • 146
  • 1
  • 5
11
votes
2 answers

Sonata Exception get too many admin registered

I get the message: Unable to found a valid admin for the class: Aman\VarshneyBundle\Entity\ArticleTable, get too many admin registered: sonata.admin.appsreview,sonata.admin.review,sonata.admin.article I am not able to figure out this issue.
Aman Varshney
  • 820
  • 1
  • 9
  • 26
11
votes
4 answers

How to set flash message in sonata admin Admin Controller

im looking for a way to set flash message in admin controller of sonata admin bundle, they allow to set flash messages in CRUDController as $this->get('session')->setFlash('sonata_flash_error', 'flash_batch_merge_error'); but not in the Admin…
Lasith
  • 565
  • 1
  • 6
  • 17
11
votes
7 answers

Format for time display?

I am making application with symfony2 and sonata-admin bundle. public function configureListFields(ListMapper $listMapper) { $listMapper ->addIdentifier('id') ->add('fromDate'); it shows time like this September 1, 2013…
whitebear
  • 11,200
  • 24
  • 114
  • 237
11
votes
4 answers

Softdeletable behaviour and really deleting the entity

I'm using DoctrineExtensions with StofDoctrineExtensionsBundle to get the soft-deleteable behaviour. It works really well in the frontend of my application. In the backend i need the option to "hard" delete entities. I have disabled the filter in…
smoove
  • 3,920
  • 3
  • 25
  • 31
10
votes
2 answers

sonata admin label on breadcrumb

I have a little problem with sonata admin on Symfony. I would like to change the default admin label in the breadcrumb: but I can't find any solution. Can someone help me? I found this function, but it doesn't work. It looks like that this…
10
votes
2 answers

Add custom Sonata page route to the navbar

I've created a custom Sonata page Simple route medapp_adminStreamCommands: path: /admin/stream defaults: { _controller: MedAppBundle:VideoChat/VideoChat:adminStreamCommands } Controller that returns the admin pool public function…
George Irimiciuc
  • 4,573
  • 8
  • 44
  • 88
10
votes
1 answer

Adding customised validation rules to SonataUserBundle

I have installed SonataUserBundle according to the docs and it all works fine. Except that I cannot add custom validation rules. My understanding is that the new rules should be added to a new Validation Group and then config.yml is updated to tell…
caponica
  • 3,788
  • 4
  • 32
  • 48
10
votes
2 answers

many-to-many and sonata-admin-bundle

I have ManyToMany related entities Partner and District, but when i editing relationships between object of entities changes are not saved. Entity District class District { ... /** * @ORM\ManyToMany(targetEntity="Partner",…
10
votes
3 answers

Customize form field rendering

I would like to customize the rendering of a form field in the edit page from sonata admin bundle to include an applet that uses the text content of a field. I know that I have to edit the configureFormFields function in the admin class, but I need…
qdelettre
  • 1,873
  • 5
  • 25
  • 36
10
votes
1 answer

Adding action in SonataAdminBundle

I'm trying to add an action in sonata admin bundle. I changed my Admin class with : protected function configureListFields(ListMapper $listMapper) { $listMapper ->addIdentifier('id') ->add('name') // add custom…
qdelettre
  • 1,873
  • 5
  • 25
  • 36
9
votes
2 answers

Sonata Admin - Order List by calculated value

Is there a way to have a column in a Sonata Admin list that uses a calculated value as the sort by ?? Something like this: ( this does NOT work ) $mapper->add('stock', null, [ 'sortable' => '(stock.real - stock.inCustomerOrder)', …
minychillo
  • 395
  • 4
  • 17