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
7
votes
1 answer

sonata_type_collection : set default field value from current entity instance

I need help with "sonata_type_collection" : Is there any way to define a default value (here : instance of existing entity) for a "sonata_type_collection" specific field? Or maybe a way to give him parameters? Let me clarify this : Here is a…
Sir McPotato
  • 899
  • 7
  • 21
7
votes
1 answer

Update ACL on programmatically created object with Sonata Admin

I'm using the Sonata-Admin bundle with ACL, but I have to create some objects programmatically. But I can't figure out how I properly update the ACL tables for the created entity. So I always have to execute php app/console…
n3on
  • 2,051
  • 1
  • 16
  • 16
7
votes
1 answer

sonata admin bundle symfony

I tried to install sonata admin bundle to administrate my users. I use FOS user bundle. I have folowed the instructions, but anything went wrong and I don't find what. I have the error: Cannot automatically determine base route name, please define a…
anubis
  • 1,425
  • 5
  • 18
  • 47
7
votes
1 answer

Adding related items using Sonata Admin and Propel

I have Sonata Admin up and running Using Propel with two models/Admin class defined; Portfolio and Image, where a portfolio item can have many images. I have an ImageAdmin that allows for the images to be uploaded, associated with a portfolio item…
Rooneyl
  • 7,802
  • 6
  • 52
  • 81
7
votes
2 answers

Modal window for edit model in Sonata Admin

How can I set-up the an Admin class in SonataAdminBundle, to display the form for adding/editing an entity in a modal window? Like below:
Guillermo Gutiérrez
  • 17,273
  • 17
  • 89
  • 116
7
votes
5 answers

How to pass variables to sonata admin custom list action?

How would I pass an array of variables to SonataMediaBundle:MediaAdmin:list_image.html.twig? There does not seem to be any option available. class MediaAdmin extends Admin { protected function configureListFields(ListMapper $listMapper) { …
wilsonrufus
  • 449
  • 1
  • 5
  • 14
7
votes
4 answers

Avoid empty password field when edit a specific user with SonataAdminBundle

I have a problem when I want to edit an existing user from the Backend (using SonataAdminBundle and FOSUserBundle). In configureFormFields method of my UserAdmin class, the password field appears empty and this is a problem when I need to edit…
jfontecha
  • 77
  • 1
  • 4
7
votes
2 answers

SonataAdminBundle - check changes in `preUpdate` hook

Is it possible to check if field was changed on preUpdate hook? I'm looking for something like preUpdate hasChangedField($fieldName) Doctrine functionality. Any ideas?
NHG
  • 5,807
  • 6
  • 34
  • 45
7
votes
3 answers

Sonata Admin search feature

I recently updated my symfony2 project vendors. Thus I got latest Sonata Admin Bundle version (updated from 2.2.5 to 2.2.6). I saw there is a new search feature in this release but I can't get it work. I can't figure out what I'm doing wrong. Drives…
Thehyunkel
  • 135
  • 1
  • 5
7
votes
2 answers

SonataAdmin: replace ID in breadcrumbs

How can I replace Object's ID in SonataAdmin breadcrumbs by some other text? If I set __toString() in my document, it works only for editing. When I attempt to create new record, there is something like MyDocument:0000000000e09f5c000000006a48ef49 in…
ozahorulia
  • 9,798
  • 8
  • 48
  • 72
7
votes
0 answers

Dynamic relationship and the SonataAdminBundle

I use the SonataAdminBundle for the first time in my life and I have some problems with it. At first, I had a PageBundle which has a Page and a Author entity. Then I started using SonataAdminBundle and used the sonata_type_model to nicely display…
Wouter J
  • 41,455
  • 15
  • 107
  • 112
7
votes
1 answer

How to set format for datetime and date in sonata admin filters symfony2

How to set the datetime or date filters in sonata admin datagridfilters? I want to do the following for the sonata admin filters, which works for edit form ->add('createdAt', 'datetime', array('label' => 'Created at', 'disabled' => true, …
dagger
  • 515
  • 2
  • 6
  • 17
7
votes
3 answers

How to use existing Symfony FormType in Sonata Admin Bundle configureFormFields?

SonataAdminBundle gives a method configureFormFields when you extend the Admin class. That method takes a FormMapper class. For the entity that I have created this class for, I have already built a FormType class in the typical Symfony fashion. How…
7
votes
1 answer

Sonata Admin - Only allow show what logged in user has created

I've setup a sonata admin interface which allows users to create specific content, but how do I restrict users from editing content created by other users? For arguments sake, a user logs in and creates a blog. In the list view of blogs, only the…
user1697652
  • 248
  • 4
  • 6
7
votes
2 answers

Sonata: Fatal error: Maximum function nesting level of '100' reached.. when embedding forms

EDIT: For anyone interested on solving the same issue, that did the trick: echo `'xdebug.max_nesting_level = 250' >> /etc/php5/conf.d/xdebug.ini` I've created 3 Admins for 3 entities linked to each other, where A Admin is embedding B Admin and B…
peris
  • 943
  • 3
  • 20
  • 33