Commit 25f7381
fix: add ensureProtocol helper to handle URLs without protocol (calcom#26667)
* fix(event-types): keep slug in sync with title until manually edited
Changed from checking `touchedFields` to `dirtyFields` when deciding
whether to sync the slug with the title. This fixes the issue where
merely focusing on the slug field would stop the sync, even if the
user didn't actually edit it.
Now the slug stays in sync with the title until the user actually
modifies the slug value.
Note: The hardcoded "Slug" label for platform users was preserved from
the original code. Localizing it would be a separate enhancement.
Fixes calcom#26265
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: add ensureProtocol helper to handle URLs without protocol
Some container orchestration tools (like Coolify) strip the protocol
from URL environment variables. This causes `new URL()` to throw
`ERR_INVALID_URL` because strings like "sub.domain.com" are invalid
without a protocol prefix.
This fix adds an `ensureProtocol` helper function that:
- Returns empty string for null/undefined URLs
- Preserves URLs that already have http:// or https://
- Prepends https:// to URLs missing the protocol
Applied to WEBAPP_URL, WEBSITE_URL, and CAL_URL env var parsing.
Fixes calcom#25774
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Clarify URL protocol handling in comments
Updated comment to clarify handling of URLs.
* Refactor slug handling in CreateEventTypeForm
---------
Co-authored-by: simiondolha <simiondolha@users.noreply.github.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com>1 parent 463987c commit 25f7381
1 file changed
Lines changed: 14 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
1 | 12 | | |
2 | 13 | | |
3 | 14 | | |
| |||
10 | 21 | | |
11 | 22 | | |
12 | 23 | | |
13 | | - | |
| 24 | + | |
14 | 25 | | |
15 | 26 | | |
16 | 27 | | |
| |||
23 | 34 | | |
24 | 35 | | |
25 | 36 | | |
26 | | - | |
| 37 | + | |
27 | 38 | | |
28 | 39 | | |
29 | 40 | | |
| |||
38 | 49 | | |
39 | 50 | | |
40 | 51 | | |
41 | | - | |
| 52 | + | |
42 | 53 | | |
43 | 54 | | |
44 | 55 | | |
| |||
0 commit comments