Skip to content

fix: remove url encoding from calendar names#279

Merged
lukasdotcom merged 1 commit into
mainfrom
fix/calendar-names
Sep 15, 2025
Merged

fix: remove url encoding from calendar names#279
lukasdotcom merged 1 commit into
mainfrom
fix/calendar-names

Conversation

@lukasdotcom
Copy link
Copy Markdown
Member

Signed-off-by: Lukas Schaefer <lukas@lschaefer.xyz>
@lukasdotcom lukasdotcom merged commit 5b6b601 into main Sep 15, 2025
20 checks passed
@lukasdotcom lukasdotcom deleted the fix/calendar-names branch September 15, 2025 15:29

$newCalName = urlencode(trim($calName) . ' (' . $this->l10n->t('Google Calendar import') . ')');
$newCalName = trim($calName) . ' (' . $this->l10n->t('Google Calendar import') . ')';
$params['{DAV:}displayname'] = $newCalName;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 🚀

@MarcelRobitaille
Copy link
Copy Markdown
Contributor

MarcelRobitaille commented Sep 15, 2025

@lukasdotcom Thanks for the fix.

With this applied, I'm seeing this:

Error index DbalException An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'principals/users/marcel-Test+%28Google+Calendar+import%29' for key 'calendars_index'

Maybe we need some kind of migration

Manually deleted the corresponding rows from oc_calendars fixed it. Can confirm it now looks correct in the UI.

I'm also still able to delete the calendar, which I understand to be the original motivation of #166. The calendar still exists in the database, but I think that's also the behaviour for manually created calendars in the UI. BTW do you know why it does this?

@lukasdotcom
Copy link
Copy Markdown
Member Author

@lukasdotcom Thanks for the fix.

With this applied, I'm seeing this:

Error index DbalException An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'principals/users/marcel-Test+%28Google+Calendar+import%29' for key 'calendars_index'

Maybe we need some kind of migration

Manually deleted the corresponding rows from oc_calendars fixed it. Can confirm it now looks correct in the UI.

Hi @MarcelRobitaille

Thanks for reporting the problem. When creating the calendar I checked the calendar name instead of uri before creating it. This will be fixed in #280. Thanks for mentioning that.

I'm also still able to delete the calendar, which I understand to be the original motivation of #166. The calendar still exists in the database, but I think that's also the behaviour for manually created calendars in the UI. BTW do you know why it does this?

The reason for the original change was due to the / character. When that character existed in the calendar it would cause issues with deleting it. Luckily there is a display name that also exists that does not have that restriction. You'll notice this pr still encodes the calendar uri which is why the original commit couldn't just be reverted.

@MarcelRobitaille
Copy link
Copy Markdown
Contributor

You'll notice this pr still encodes the calendar uri which is why the original commit couldn't just be reverted.

Yeah I see that

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Calendar names look really bad url encoded

3 participants