sonata-user-bundle

SonataUserBundle - Neither property nor methods exist

三世轮回 提交于 2020-01-13 19:31:06
问题 I have installed Sonata User, Admin, Media and a few other bundles successfully. I want to add profile pic to user entity so I've added a $profilePic property to it (with setter and getter) as follow: /** * @ORM\OneToOne(targetEntity="Application\Sonata\MediaBundle\Entity\Media",cascade={"persist"}) * @ORM\JoinColumn(name="profilePic_id", referencedColumnName="id") **/ protected $profilePic; public function getProfilePic() { return $this->profilePic; } public function setProfilePic(

How to install SonataDoctrineMongoDBAdminBundle properly?

核能气质少年 提交于 2020-01-12 03:41:08
问题 I am really getting nervous because of lacking of enough resource for installing SonataDoctrineMongoDBAdminBundle and it's dependencies like sonataUserBundle. I have been trying to install this bundle for 15 days. I did everyting agaian and again what telling in sonata's official page. But it does not work properly. After extending sonataUserBundle as ApplicationUserBundle my final documents are: User.php <?php /** * This file is part of the <name> project. * * (c) <yourname> <youremail> * *

ClassNotFoundException: Attempted to load class “FOSUserBundle” from namespace “FOS\UserBundle”

人走茶凉 提交于 2020-01-04 06:45:30
问题 (Using WampServer on Windows 10.) I followed the official documentation in order to install Sonata User Bundle over Symfony. I get the following error message (1/1) ClassNotFoundException Attempted to load class "FOSUserBundle" from namespace "FOS\UserBundle". Did you forget a "use" statement for another namespace? AppKernel.php <?php use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Config\Loader\LoaderInterface; class AppKernel extends Kernel { public function registerBundles()

ClassNotFoundException: Attempted to load class “FOSUserBundle” from namespace “FOS\UserBundle”

怎甘沉沦 提交于 2020-01-04 06:45:09
问题 (Using WampServer on Windows 10.) I followed the official documentation in order to install Sonata User Bundle over Symfony. I get the following error message (1/1) ClassNotFoundException Attempted to load class "FOSUserBundle" from namespace "FOS\UserBundle". Did you forget a "use" statement for another namespace? AppKernel.php <?php use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Config\Loader\LoaderInterface; class AppKernel extends Kernel { public function registerBundles()

How to remove fields from the admin user create page of Sonata User Bundle?

五迷三道 提交于 2019-12-29 09:50:11
问题 I have installed Sonata Admin Bundle and User Bundle in my Symfony 2.6 application. I found that the User bundle creates a bundle at src/Application/Sonata/UserBundle . When I go to the admin user creation page ( admin/sonata/user/user/create ), I found a lot of fields there: General Username E-Mail-Address Plain password Groups Profile Date of birth Firstname Lastname Website Biography Gender Locale Timezone Phone Social Facebook Uid Facebook Name Twitter Uid Twitter Name Google+ Uid Google+

How can I assign default role to user in Symfony2

不想你离开。 提交于 2019-12-25 03:05:20
问题 I want to assign default role to user after he is registered. I have implemented FOSUserBundle extended by SonataUserBundle. Unfortunetly SonataUserBundle requires FOSUserBundle ~1.3 and event listeners are only since FOSUserBundle 2.0. Is there another way to solve this problem except eventListener or FOSUserBundle controller override ? Maybe some kind of option in yaml I have missed ? It seems quite standard problem but I am still new in symfony2... 回答1: You can overwrite the getRoles()

SonataUserBundle + FOSUserBundle Annotation Issue Doctrine Primary Key Error

扶醉桌前 提交于 2019-12-25 01:45:41
问题 Using Symfony 4.1, Sonata User Bundle 4.x, and FOSUserBundle 2.1.2. I am trying to override the table names for the User and Group tables. I therefore added annotations to the auto generated user and group classes: use Sonata\UserBundle\Entity\BaseGroup as BaseGroup; use Doctrine\ORM\Mapping as ORM; /** * This file has been generated by the SonataEasyExtendsBundle. * @ORM\Entity() * @ORM\Table(name="aegis_group") * @link https://sonata-project.org/easy-extends * References: * @link http://www

SonataUserBundle + FOSUserBundle - overriding controllers

僤鯓⒐⒋嵵緔 提交于 2019-12-24 23:22:52
问题 I'm using SonataUserBundle with FOSUserBundle. in AppKernel.php it looks like this: new FOS\UserBundle\FOSUserBundle(), new Sonata\UserBundle\SonataUserBundle('FOSUserBundle'), new Application\Sonata\UserBundle\ApplicationSonataUserBundle(), Some controllers from SonataUserBundle are already overriden. Now I want to overridee FOSUserBundle ChangePasswordController. So I made: src/Application/FOS/UserBundle/Controller/ChangePasswordController.php src/Application/FOS/UserBundle

Upgrading Sonata from 2.3 to 3.0

别来无恙 提交于 2019-12-23 23:06:22
问题 I have an existing Symfony + SonataAdmin project which we've been running for a few years. I'd like to upgrade it to SonataAdmin 3.x. 3.0 would be a good start, then moving up to 3.x afterwards once we check it's all working. However, I can't seem to get a viable set of composer dependencies to upgrade. The current settings include: "sonata-project/admin-bundle": "~2.3", "sonata-project/core-bundle": "~2.3", "sonata-project/doctrine-orm-admin-bundle": "~2.3", "sonata-project/user-bundle": "~2

Sonata admin enhanced view for security roles

落花浮王杯 提交于 2019-12-23 04:45:46
问题 In sonata admin the roles are based on admin services name with CRUD export and master permissions but the way it looks not so user friendly to create groups for others user or assign specific permissions to a user considering an example for sonata admin post module the service for admin is named as sonata.news.admin.post and for that service generated roles will look like ROLE_SONATA_NEWS_ADMIN_POST_EDIT ROLE_SONATA_NEWS_ADMIN_POST_LIST ROLE_SONATA_NEWS_ADMIN_POST_CREATE ROLE_SONATA_NEWS