Skip to content

[HIGH] H1: 66 remaining \OC::$server->get() calls — fatal on Nextcloud 34 #333

Description

@rubenvdlinde

Severity: HIGH

Location: lib/Service/OrganizationSyncService.php lines 282, 401, 448, 661, 847, 886, 1142, 1208, 1311, 1354, 1417, 1760, 1879, 2061, 2142; lib/Service/ContactpersoonService.php lines 169, 180, 192, 193, 207, 394, 489, 615, 738, 871, 1010, 1089, 1236, 1304, 1376; lib/EventListener/UserProfileUpdatedEventListener.php lines 73, 100, 132, 133, 227, 228, 229, 265; lib/Service/GebruikSyncService.php lines 320, 499; lib/Controller/ContactpersonenController.php line 283

Description:
66 \OC::$server->get(...) calls remain across lib/. \OC::$server is removed in Nextcloud 34. PR #317 fixed only the controller subset. The remaining calls are in service and event listener classes that are invoked from cron jobs and event hooks. On NC 34 these throw a fatal Error (not Exception), which is not caught in most call sites, causing entire cron passes and event listeners to die silently.

Scenario:
After upgrading to NC 34: scheduled sync jobs stop executing; UserProfileUpdatedEventListener crashes on every profile update; no error is surfaced to the admin because the Error propagates past existing catch (Exception) handlers.

Suggested fix:
Fan-out constructor injection via ContainerInterface for all remaining \OC::$server->get(...) callsites, following the same pattern used in PR #317.


Source: deep team-reviewer pass 2026-05-27

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions