Add Baikal compatible DAV route and optimize data fetching#256
Open
lukastrkan wants to merge 4 commits intotchapi:mainfrom
Open
Add Baikal compatible DAV route and optimize data fetching#256lukastrkan wants to merge 4 commits intotchapi:mainfrom
lukastrkan wants to merge 4 commits intotchapi:mainfrom
Conversation
tchapi
reviewed
Apr 18, 2026
| }); | ||
| } | ||
|
|
||
| #[Route('/dav.php/{path?}', name: 'dav-old', requirements: ['path' => '.*'])] |
Owner
There was a problem hiding this comment.
Let's:
- name this dav-legacy so that it's consistent with the method name
- add a comment that explains why it exists (reference to Baikal migration)
| #[Route('/dav.php/{path?}', name: 'dav-old', requirements: ['path' => '.*'])] | ||
| public function davLegacy(Request $request, ?string $path): Response | ||
| { | ||
| return $this->redirect($this->generateUrl('dav', ['path' => $path ?? '']).$this->buildQueryString($request), 301); |
Owner
There was a problem hiding this comment.
If you pass to the generateUrl() method some parameters that are not part of the route definition, they are included in the generated URL as a query string.
So $this->generateUrl('dav', ['path' => $path ?? '', ...$request->query->all()]), should work (no need for a private function)
| return $this->redirect($this->generateUrl('dav', ['path' => $path ?? '']).$this->buildQueryString($request), 301); | ||
| } | ||
|
|
||
| private function buildQueryString(Request $request): string |
Comment on lines
-29
to
+33
| 'users' => $users, | ||
| 'calendars' => $calendars, | ||
| 'addressbooks' => $addressbooks, | ||
| 'events' => $events, | ||
| 'contacts' => $contacts, | ||
| 'users' => $usersCount, | ||
| 'calendars' => $calendarsCount, | ||
| 'addressbooks' => $addressbooksCount, | ||
| 'events' => $eventsCount, | ||
| 'contacts' => $contactsCount, |
Owner
There was a problem hiding this comment.
Let's rename the parameters too so they are explicit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Improvements made during the migration from Baikal to Davis:
findAll()withcount()