sonata-admin

AclVoter denies access to 'LIST'

随声附和 提交于 2019-12-12 03:54:00
问题 As soon as I set sonata_admin.security.handler to sonata.admin.security.handler.acl the only user who has access is the one with ROLE_SUPER_ADMIN. I think I configured everything right, obviously not. I tried: to give the user the real role ROLE_VIP_CONTACT_ADMIN instead of assigning by a fos_group, no success. all options for security.access_decision_manager.strategy : affirmative, consensus and unanimous to delete all acl tables, acl:init, sonata:admin:setup-acl, with and without sonata

How to configure m2m relationship in Sonata Admin?

两盒软妹~` 提交于 2019-12-12 03:19:58
问题 I am using Symfony 2.6.1. Entities configuration: http://pastebin.com/rMkYHjkE Admin class: class PlaceAdmin extends Admin { // Fields to be shown on create/edit forms protected function configureFormFields(FormMapper $formMapper) { $formMapper //other fields ->add('types', 'collection', array( 'type' => new PlaceType, 'allow_add' => true, )); ; } //other stuff } When I am trying to edit selected entity: Expected argument of type "string, Symfony\Component\Form\ResolvedFormTypeInterface or

Symfony2 + SonataAdmin - assets not loading

纵然是瞬间 提交于 2019-12-12 02:58:59
问题 I have Symfony 2.8 installed with Sonata Admin Bundle: "sonata-project/admin-bundle": "2.4.*@dev", "sonata-project/doctrine-orm-admin-bundle": "^2.3" The Sonata admin is successfully installed and accessible at http://xxxxx.com/admin, but It can't load JS and CSS files (I get error 404). The files live in web/bundles folder: drwxr--r-- 2 rabotnici rabotnici 4096 Dec 13 01:44 ./ drwxr-x--- 4 rabotnici nobody 4096 Dec 13 01:13 ../ lrwxrwxrwx 1 rabotnici rabotnici 91 Dec 13 01:44 framework ->

Optimizing doctrine queries in Sonata Admin with LeftJoin

折月煮酒 提交于 2019-12-12 01:54:58
问题 How do you optimize the DB queries made by sonata admin in the list and edit views ? i LeftJoined some queries that i made using the querybuilder in my entity repository , this already helped a lot, brought my queries down from 100+ to about 22. But the remaining queries are the ones that happen automatically by using the formbuilder and listmapper. Is there anyway i can further optimize the queries made by those classes ? im not even sure at this point where the queries are made... i tried

How to add bundles in the Admin Dashboard Symfony2

时光总嘲笑我的痴心妄想 提交于 2019-12-12 01:29:45
问题 I'm working on Sonata Admin bundles. I've configure the Admin Dashboard and the following components are showing in the "Symfony CMF" group, Here's the snapshot, I've gone through the Symfony CMF sandbox site, http://cmf.liip.ch/en/admin/dashboard In this dashboard there are some other bundles like , Simple Block Container Block etc are appearing. Here's the snapshot, I want to add the Content items as shown in the above pic in my "Symfony CMF" group. How to do it ? Here's my config.yml,

Sonata Admin List Field Template is Ignored

ⅰ亾dé卋堺 提交于 2019-12-11 20:55:24
问题 I'm using Symfony 4.1.1 and Sonata Admin Bundle 3.35.2. I want to use a custom template for a field in an admin's list view. The template is ignored. I am using Twig as my templating engine. In the admin: # /src/Admin/ImageAdmin.php protected function configureListFields(ListMapper $listMapper) { $listMapper ->add('filename', 'string', ['template' => 'list_image.html.twig']) ; } The template: # /templates/list_image.html.twig {% extends 'SonataAdminBundle:CRUD:base_list_field.html.twig' %} {%

SetTemplate in services.yaml doesn't work with my own template

孤街醉人 提交于 2019-12-11 16:29:37
问题 I have a Sonata Admin and I wanna replace his template with another one, but doesn't work, currently my app is running in Symfony 4.3 and the folder structure changes with symfony version and I don't know if my error is in that place. admin.expediente_compra: class: App\Admin\ExpedienteCompraAdmin arguments: [~, App\Entity\ExpedienteCompra, App\Controller\ExpedienteCompraAdminController] calls: - [setTemplate, ['edit', 'ExpedienteCompra/edit.html.twig']] tags: - { name: sonata.admin, manager

Symfony/Sonata template path file not found and how directory structures are arranged

允我心安 提交于 2019-12-11 14:23:32
问题 I am using Symfony v3.3.13 and Sonata Admin Bundle 3.27.0 with TWIG v2.4.4 I have a little problem understanding how twig template paths work. I have recently needed to load a new template for a list view field in SonataAdminBundle . I had to define the path as follows: ->add('coords', null, ['template' => 'SonataAdmin/CRUD/geography_point_list.html.twig']); The geography_point_list.html.twig file was in app/Resources/views/SonatAdmin/Crud I also managed to get this work with the path

Right way to inject container service in Sonata Admin Bundle

一个人想着一个人 提交于 2019-12-11 12:41:42
问题 I'm trying to inject the service container in my Sonata Admin class in order to use it at configureFormFields method. This is what I have: config.yml (sonata services definition) services: tan.product.admin.product: class: Tan\ProductBundle\Admin\ProductAdmin tags: - { name: sonata.admin, manager_type: orm, group: Product, label: Product } arguments: [ null, Tan\ProductBundle\Entity\Product, @service_container] ProductAdmin.php class ProductAdmin extends Admin { /** @var \Symfony\Component

Sonata Admin + Vich Upload inject on load not working

…衆ロ難τιáo~ 提交于 2019-12-11 11:25:34
问题 i am using vich upload with sonata admin & i can able to upload & delete file my issue is i am not able to get uploaded file information i used vich uploader config "inject_on_load" as true vich_uploader: db_driver: orm # or mongodb or propel or phpcr mappings: small_image: uri_prefix: /uploads/images/small upload_destination: %kernel.root_dir%/../web/uploads/images/small namer: vich_uploader.namer_uniqid inject_on_load: true delete_on_update: true delete_on_remove: true now when i dump my