Uh oh!
There was an error while loading. Please reload this page.
Fix listeners declaration in case of occ usage - #30889
Conversation
icewind1991
commented
Feb 2, 2022
I would prefer not stuffing this into the already bloated server.php, always initiating
That is fine. |
come-nc
commented
Feb 3, 2022
That works too, as long as occ commands get the same context as web ui. @icewind1991 Do you know where the |
come-nc
commented
Feb 3, 2022
In the web UI @icewind1991 Would you prefer this as a solution then: |
icewind1991
commented
Feb 3, 2022
That should be fine yes |
e263600 to
2519d72Comparecome-nc
commented
Feb 3, 2022
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 |
come-nc
commented
Feb 3, 2022
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… |
icewind1991
commented
Feb 3, 2022
Probably something related to trying to setup to much on an uninstalled setup You can wrap it in a |
be0aca8 to
9127292Comparecome-nc
commented
Feb 7, 2022
It works. Are we sure this was the only init path where |
Uh oh!
There was an error while loading. Please reload this page.
9127292 to
43ac7beComparecome-nc
commented
Feb 22, 2022
Maybe we can move this to base.php to have it in only one place? |
come-nc
commented
Feb 24, 2022
(At this point PR should be squashed before merge) |
…ers correctly Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
8c2bbb9 to
63d7e7cComparecome-nc
commented
Mar 1, 2022
/backport to stable23 |
come-nc
commented
Mar 1, 2022
/backport to stable22 |
come-nc
commented
Mar 1, 2022
/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. |
CarlSchwan
commented
Mar 11, 2022
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