Code Monkey home page Code Monkey logo

Comments (9)

rande avatar rande commented on June 6, 2024

This is not an issue with the SonataAdminBundle. You need to define an userManager property and inject the related service into the Admin.

from sonatauserbundle.

mattsches avatar mattsches commented on June 6, 2024

Ok, I see. Thanks for your reply!

from sonatauserbundle.

DerekRoth avatar DerekRoth commented on June 6, 2024

Sorry to bump this up after 2 years, but i had the same issue today.

Since the $userManager property is used in the code of Sonata\UserBundle\Admin\Model\UserAdmin (there is a getter and a setter for this property), the property itself should be declared too, as pointed by mattsches:

protected $userManager;

Then, the question is: should we force the user to configure the service injection (http://sonata-project.org/bundles/admin/master/doc/reference/saving_hooks.html) like this:

<service id="fos.user.admin.user" class="%fos.user.admin.user.class%">
    <tag name="sonata.admin" manager_type="orm" group="fos_user" />
    <argument />
    <argument>%fos.user.admin.user.entity%</argument>
    <argument />

    <call method="setUserManager">
        <argument type='service' id='fos_user.user_manager' />
    </call>
</service>

...or should the UserAdmin class choose the fos_user.user_manager by default in the getter with mattsches' code ?

I think mattsches solution is much simpler.

from sonatauserbundle.

DerekRoth avatar DerekRoth commented on June 6, 2024

Ping

from sonatauserbundle.

Bladrak avatar Bladrak commented on June 6, 2024

@rande ^

from sonatauserbundle.

rande avatar rande commented on June 6, 2024

@Bladrak I actually sent the ping from @DerekRoth account ;)

from sonatauserbundle.

rande avatar rande commented on June 6, 2024

fixed

from sonatauserbundle.

greg0ire avatar greg0ire commented on June 6, 2024

@rande I ran into this bug today, and I'm using the ORM for managing users, while using the ODM to manage everything else. If you can point out which piece of code is in charge of this, I could have a look at it. I worked around my problem by injecting the manager.

from sonatauserbundle.

webdevilopers avatar webdevilopers commented on June 6, 2024

👍

from sonatauserbundle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.