Skip to content

Birthday backend injection - #332

Merged
tchapi merged 5 commits into
mainfrom
birthday-backend-injection
Dec 3, 2026
Merged

tchapi merged 5 commits into
mainfrom
birthday-backend-injection

Conversation

@tchapi

@tchapi tchapi commented Dec 3, 2026

Copy link
Copy Markdown
Owner

No description provided.

0z5a and others added 4 commits December 3, 2026 22:35
Saving or deleting an address book from the admin syncs the user's
birthday calendar, but the birthday service only gets its CalDAV
backend from the DAV server plugin and the sync command. With a
contact that has a birthday, the sync then failed with "Call to a
member function createCalendarObject() on null" and the admin
showed a 500.

Set the backend the same way the sync command does before both
syncUser() calls.

Fixes #328
The birthday service only got its CalDAV backend through setBackend(),
which the DAV server plugin and the sync command called, so any other
caller had to remember it. Get the backend from the container instead,
as a constructor argument, and remove setBackend(). The plugin and the
command no longer deal with the backend, and the admin address book
actions no longer need to set it.

The service is lazy: building the backend opens the database
connection, and the sync command is built on every console run.
The backend was built by the container, from two inline services in
services.yaml, and the service had to be lazy so that depending on it
would not open the database connection.

Inject the DBAL connection instead and build the backend in the
service the first time it is needed. The service definition goes back
to what it was, and no lazy proxy is involved.
@tchapi tchapi self-assigned this Dec 3, 2026
@tchapi tchapi added the bug Something isn't working label Dec 3, 2026
@tchapi tchapi linked an issue Dec 3, 2026 that may be closed by this pull request
3 of 5 tasks
@tchapi
tchapi enabled auto-merge (squash) December 3, 2026 22:08
@tchapi
tchapi merged commit 2f2b7e9 into main Dec 3, 2026
20 checks passed
@tchapi
tchapi deleted the birthday-backend-injection branch December 3, 2026 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Admin UI: enabling a birthday calendar for address book returns 500

1 participant