Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
dein1984 opened this issue Oct 8, 2021 · 16 comments · Fixed by #1444
Closed

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

dein1984 opened this issue Oct 8, 2021 · 16 comments · Fixed by #1444

Comments

@dein1984
Copy link

dein1984 commented Oct 8, 2021

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
Copy link
Member

core23 commented Oct 8, 2021

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
Copy link
Member

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
Copy link

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
Copy link
Member

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
Copy link

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
FriendsOfSymfony/FOSUserBundle#2679 (comment)
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:
#1050 (comment)
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
Copy link
Contributor

Hanmac commented Nov 10, 2021

@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
Copy link

@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
Copy link
Contributor

Hanmac commented Nov 10, 2021

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

templating:
    engines:
        twig

@zx86496790
Copy link

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
Copy link
Contributor

Hanmac commented Nov 10, 2021

@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
Copy link

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
Copy link

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
Copy link

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
Copy link
Member

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).

@jordisala1991 jordisala1991 linked a pull request Dec 5, 2021 that will close this issue
@Hanmac
Copy link
Contributor

Hanmac commented Dec 7, 2021

@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
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants