sonata-user-bundle

Method “currentAncestor” for object “Knp\Menu\MenuItem” does not exist in Sonata

梦想的初衷 提交于 2019-12-21 21:34:50
问题 I'm new to Symfony2 and I just installed it along with fosUserBUndle 1.3.3, Sonata Admin BUndle, and Sonata User BUndle. Now I get an error that I cannot resolve. Here is my error: (url localhost:8000/profile/ ) : Method "currentAncestor" for object "Knp\Menu\MenuItem" does not exist in SonataBlockBundle:Block:block_side_menu_template.html.twig at line 29 I am able to login succesfully, but I get this error after login. Any help would be greatly appreciated. Thanks 回答1: open file block_side

Adding customised validation rules to SonataUserBundle

限于喜欢 提交于 2019-12-21 08:22:58
问题 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 SonataUserBundle (or FosUserBundle) to add the new rules to the validation sequence. I have tried this, in various ways, but the new rules just don't seem to be picked up at all... Here's the configuration I'm using... (For the sake of this example

Session lost during impersonation

感情迁移 提交于 2019-12-19 03:36:05
问题 I use SonataAdminBundle with configured sonata_user in config.yml : sonata_user: impersonating: route: _profile_logged # more config I have my admin panel under /admin prefix. I've configured UserAdmin (based on User entity) with impersonating field. I've tried to go to impersonate user by clicked link in my admin panel and I saw application (not admin panel) login page. I checked developer toolbar and I noticed that request for impersonate user was redirected to login page. It's quite

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,

User locale does not work at first request

帅比萌擦擦* 提交于 2019-12-11 01:56:18
问题 My website is running Symfony, master version. So far, I was able to use the LocalListener logic from the website, with a slight difference due to code not being compatible with my version. (I think) I only simplified the onKernelRequest method this way: public function onKernelRequest(GetResponseEvent $event) { $request = $event->getRequest(); if (!$request->hasPreviousSession()) { return; } if ($locale = $request->get('_locale')) { $request->getSession()->set('_locale', $locale); } $request

Symfony: Authentication request failed: Invalid CSRF token

只谈情不闲聊 提交于 2019-12-10 19:57:05
问题 I am getting the following error on logging in to a Symfony2 application: [2014-06-27 00:36:22] security.INFO: Authentication request failed: Invalid CSRF token. [] [] Running on: Symfony2 SonataUserBundle Vagrant (using puppet via Puphpet.com) Safari/OSX Same setting is Working on an Ubuntu host system. Thanks for any help. security.yml: firewalls: dev: pattern: ^/(_(profiler|wdt)|css|images|js)/ security: false secured_area: pattern: ^/ form_login: provider: fos_userbundle csrf_provider:

ACL + SonataAdminBundle + SonataUserBundle

无人久伴 提交于 2019-12-07 18:59:34
问题 In my Symfony2 project I managed to setup FOSUserBundle + SonataUserBundle + SonataAdminBundle following official docs. Now comes the time to setup the ACL (Access control list). What I did : Created an AdminClass called AdminReport app/console sonata:admin:setup-acl install ACL for sonata.admin.report update role: ROLE_SONATA_ADMIN_REPORT_GUEST, permissions: ["LIST"] update role: ROLE_SONATA_ADMIN_REPORT_STAFF, permissions: ["LIST","CREATE"] update role: ROLE_SONATA_ADMIN_REPORT_EDITOR,

ACL + SonataAdminBundle + SonataUserBundle

▼魔方 西西 提交于 2019-12-06 05:47:31
In my Symfony2 project I managed to setup FOSUserBundle + SonataUserBundle + SonataAdminBundle following official docs. Now comes the time to setup the ACL (Access control list). What I did : Created an AdminClass called AdminReport app/console sonata:admin:setup-acl install ACL for sonata.admin.report update role: ROLE_SONATA_ADMIN_REPORT_GUEST, permissions: ["LIST"] update role: ROLE_SONATA_ADMIN_REPORT_STAFF, permissions: ["LIST","CREATE"] update role: ROLE_SONATA_ADMIN_REPORT_EDITOR, permissions: ["OPERATOR","EXPORT"] created a new user, granted him with ROLE_SONATA_ADMIN_REPORT_STAFF app

SonataUserBundle override form profile

戏子无情 提交于 2019-12-05 05:42:28
问题 I am using SonataUserBundle and I am trying to override the edit profile form, but I am not sure about the services.yml and the config.yml. Here is the code. ProfileType.php namespace Application\Sonata\UserBundle\Form\Type; use Symfony\Component\Form\FormBuilderInterface; use Sonata\UserBundle\Form\Type\ProfileType as BaseType; class ProfileType extends BaseType { public function buildForm(FormBuilderInterface $builder, array $options) { parent::buildForm($builder, $options); $builder->add(

Method “currentAncestor” for object “Knp\\Menu\\MenuItem” does not exist in Sonata

匆匆过客 提交于 2019-12-04 17:29:57
I'm new to Symfony2 and I just installed it along with fosUserBUndle 1.3.3, Sonata Admin BUndle, and Sonata User BUndle. Now I get an error that I cannot resolve. Here is my error: (url localhost:8000/profile/ ) : Method "currentAncestor" for object "Knp\Menu\MenuItem" does not exist in SonataBlockBundle:Block:block_side_menu_template.html.twig at line 29 I am able to login succesfully, but I get this error after login. Any help would be greatly appreciated. Thanks open file block_side_menu_template.html.twig at /var/www/html/MySymProject/vendor/sonata-project/block-bundle/Resources/views