-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Fix listeners declaration in case of occ usage #30889
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🐘 👍 if it works
I would prefer not stuffing this into the already bloated server.php, always initiating
That is fine. |
That works too, as long as occ commands get the same context as web ui. @icewind1991 Do you know where the |
In the web UI @icewind1991 Would you prefer this as a solution then:
|
That should be fine yes |
e263600
to
2519d72
Compare
Are we sure there are no other initialization paths than those 2? (either I know that deleting users through ocs api does not have the problem so I guess both web UI and ocs api go through |
This new fix does not work, it breaks installation somehow, I get this locally:
The PHP unit in the CI fails with an other error, not sure what is happening here… |
Probably something related to trying to setup to much on an uninstalled setup You can wrap it in a |
be0aca8
to
9127292
Compare
It works. Are we sure this was the only init path where |
9127292
to
43ac7be
Compare
Maybe we can move this to base.php to have it in only one place? |
(At this point PR should be squashed before merge) |
…ers correctly Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
8c2bbb9
to
63d7e7c
Compare
/backport to stable23 |
/backport to stable22 |
/backport to stable21 |
The backport to stable21 failed. Please do this backport manually. |
The backport to stable22 failed. Please do this backport manually. |
The backport to stable23 failed. Please do this backport manually. |
Backports? |
OC\Core\Application does not get constructed when an occ command is
called so some listeners where not correctly plugged, and for instance
calling occ user:delete would not clear user files.
So I moved these listener declarations to Server class instead where there were already some of them. It does fix occ user:delete but I am unsure about other effect.
I replace $container->query(Connection::class) in some listener to $this->get(Connection::class), not 100% sure about this either.
Moving the registerNotifierService calls would crash so I let them in OC\Core\Application instead. Maybe it’s fine that they are not called from occ?
An alternative would be to instantiate OC\Core\Application from occ command, but not sure if it makes sense.
Signed-off-by: Côme Chilliet come.chilliet@nextcloud.com