sonata-project / SonataUserBundle

Symfony SonataUserBundle
https://docs.sonata-project.org/projects/SonataUserBundle
MIT License
342 stars 487 forks source link

Version 4.12.0's requires sonata-project/admin-bundle: 3.76 #1419

Closed dein1984 closed 2 years ago

dein1984 commented 3 years ago

Hi,

Version 4.12.0 supports PHP8, but it requires sonata-project/admin-bundle 3.76 which only supports PHP7.3. Can the dependency on sonata-project/admin-bundle be changed to support version 4.0.1 please? Thanks.

core23 commented 3 years ago

Can the dependency on sonata-project/admin-bundle be changed to support version 4.0.1 please? Thanks.

Feel free to provide a PR @dein1984

VincentLanglet commented 3 years ago

The SonataUser bundle is currently not compatible with the Sonata 4 bundle. You can only use Sonata 3 version, but you can bump the version you use.

zx86496790 commented 3 years ago

Hi @VincentLanglet I got the same issue as well, Do you mean to use sonataadmin sonatauser both in version 3? seems sonataadmin3 is not compatible with symfony 5.3 could you please share some information on the latest compatible version combination of symfony sonatadmin sonatauser ? thank you very much.

VincentLanglet commented 3 years ago

The combination can be found in the composer.json. SonataUser is only compatible with symfony 4.

One on the main reason is the fact that FosUser is not compatible with symfony 5 https://github.com/FriendsOfSymfony/FOSUserBundle/blob/v2.2.2/composer.json

zx86496790 commented 3 years ago

Hi @VincentLanglet , thank you very much for your quick reply. I tried to install symfony 4.4 instead. after the installation, I tried to install sonata user bundle and got this error: The child node "db_driver" at path "fos_user" must be configured. then I followed this link https://stackoverflow.com/a/49034641 to create fos_user.yaml and I got this error: The service "fos_user.mailer.default" has a dependency on a non-existent service "templating". then I followed this link https://github.com/FriendsOfSymfony/FOSUserBundle/issues/2679#issuecomment-353683644 and I got this error: The service "sonata.user.admin.user" has a dependency on a non-existent service "sonata.admin.manager.orm". and I followed this link: https://github.com/sonata-project/SonataUserBundle/issues/1050#issuecomment-445468679 and I got this error: There is no extension able to load the configuration for "fos_user" (in "/fsys1/home/public_html/mycel7/config/packages/fos_user.yaml"). Looked for namespace "fos_user", found ""framework", "sensio_framework_extra","twig", "web_profiler", "monolog", "debug", "maker", "doctrine", "doctrine_migrations", "security", "twig_extra", "knp_menu", "sonata_doctrine", "sonata_twig", "sonata_form", "sonata_block", "sonata_exporter", "sonata_admin","sonata_doctrine_orm_admin"" in /fsys1/home/public_html/mycel7/config/packages/fos_user.yaml (which is loaded in resource "/fsys1/home/public_html/mycel7/config/packages/fos_user.yaml"). at this step I am not sure what to do then. Do you know if there is any place I can find some pre-configured example?

Thank you

Hanmac commented 3 years ago

@zx86496790 config for fos_user to get it starting, because i had a similar problem:

fos_user:
    firewall_name: main
    db_driver: orm

    from_email:
        address: '%env(MAIL_SENDER)%'
        sender_name: 'sender_name'

    user_class: 'App\Entity\User\User'
    group:
        group_class: 'App\Entity\User\Group'
zx86496790 commented 3 years ago

@zx86496790 config for fos_user to get it starting, because i had a similar problem:

fos_user:
    firewall_name: main
    db_driver: orm

    from_email:
        address: '%env(MAIL_SENDER)%'
        sender_name: 'sender_name'

    user_class: 'App\Entity\User\User'
    group:
        group_class: 'App\Entity\User\Group'

Hi @Hanmac , thank you for your reply. This time I installed symfony first. and configure fos_user.yaml. this time I got the following error: The service "fos_user.mailer.default" has a dependency on a non-existent service "templating". did you have this problem?

Hanmac commented 3 years ago

@zx86496790 yeah i had that too and like you linked, i needed this in framework.yaml

templating:
    engines:
        twig
zx86496790 commented 3 years ago

Hi @Hanmac , after framework.yaml. I got this error: The service "sonata.user.admin.user" has a dependency on a non-existent service "sonata.admin.manager.orm".

I searched online and some people say I should use : composer require sonata-project/doctrine-orm-admin-bundle to solve the problem.

however when I ran that, i got another error as following:

There is no extension able to load the configuration for "fos_user" (in "/fsys1/home/public_html/config/packages/fos_user.yaml"). Looked for namespace "fos_user", found ""framework", "sensio_framework_extra","twig", "web_profiler", "monolog", "debug", "maker", "doctrine", "doctrine_migrations", "security", "twig_extra", "knp_menu", "sonata_doctrine", "sonata_twig", "sonata_form", "sonata_block", "sonata_exporter", "sonata_admin","sonata_doctrine_orm_admin"" in /fsys1/home/public_html/config/packages/fos_user.yaml (which is loaded in resource "/fsys1/home/public_html/config/packages/fos_user.yaml").

did you have this issue before? thank you

Hanmac commented 3 years ago

@zx86496790 for me it helped to "composer require" both "sonata-project/user-bundle" and "sonata-project/doctrine-orm-admin-bundle=3.35.0" at the same time

zx86496790 commented 3 years ago

Hi @Hanmac I got this error when I tried to install

@zx86496790 for me it helped to "composer require" both "sonata-project/user-bundle" and "sonata-project/doctrine-orm-admin-bundle=3.35.0" at the same time

Thank you very much for your help. this version did not give me any errors so far

zx86496790 commented 3 years ago

Hi @Hanmac , I followed sonatauserbundle 4.x document to configure but got the following error: No entity manager defined for class "App\Entity\SonataUserUser". My config/packages/doctrine.yaml file has following content: doctrine: orm: entity_managers: default: mappings: SonataUserBundle: ~ FOSUserBundle: ~ dbal: url: '%env(resolve:DATABASE_URL)%'

Have you got this error before?

Thank you

zx86496790 commented 3 years ago

The combination can be found in the composer.json. SonataUser is only compatible with symfony 4.

One on the main reason is the fact that FosUser is not compatible with symfony 5 https://github.com/FriendsOfSymfony/FOSUserBundle/blob/v2.2.2/composer.json

Hi @VincentLanglet , is there any plan to support role and permission in any other way? or if there is any recommendation on some replacement for symfony 5?

jordisala1991 commented 2 years ago

We plan to update this bundle ASAP, any help is welcome. It will take some time... in the meantime you can implement your own solution or use other bundle. I have implemented a bundle (that it does not have the same flexibility as the sonata one) to be able to transition to Symfony 5 and Sonata 4:

https://github.com/Runroom/RunroomUserBundle

There is a tutorial on the docs of the SonataAdminBundle to implement your own solution too (not sure if it is updated to the new security system tho).

Hanmac commented 2 years ago

@jordisala1991 thanks to know about that RunroomUserBundle ... i was recently switched to https://github.com/nucleos/NucleosUserAdminBundle but i might need to find something new again because it did drop php 7.4 support which i am required to use

the only problem for me is that it uses email for username, i hope i can overwrite that in my project, also it uses email as unique field

jordisala1991 commented 2 years ago

The 5.x branch is already working with Sonata 4 . Keep in mind it is really unstable and soon it will change more because of the removal of FOSUserBundle. This issue can be closed, because Sonata 4 won't land on SonataUserBundle 4.x