sabre-io / dav

sabre/dav is a CalDAV, CardDAV and WebDAV framework for PHP
http://sabre.io
BSD 3-Clause "New" or "Revised" License
1.53k stars 346 forks source link

CardDAV doesn't reserve enough space in the database for calendar colors #1144

Open tadzik opened 5 years ago

tadzik commented 5 years ago

According to iCalendar spec, the calendar color can be any CSS3 color name. The longest of them is "lightgoldenrodyellow", 20 characters long.

Sabre's database specifies calendarcolor column to be 10 characters long, which results in exceptions when trying to set the calendar color to something longer.

The column width should be increased to accommodate the spec requirements.

Thanks for the project, and keep up the good work! :­)

EDIT: FWIW, nextcloud goes all-in on this and reserves a full VARCHAR(255) :)

evert commented 5 years ago

The calendar-color field predates CSS3 and this new property. As far as I know, that property only ever got the 6 or 8 hexidecimal format for colors.

ashatrov-realforce commented 5 years ago

@evert I think @tadzik is asking to extend the column to use CSS valid color names. E.g. https://www.w3.org/TR/2018/PR-css-color-3-20180315/

So by specification all AntiqueWhite, and #FAEBD7, and rgb(250,235,215) are the same and valid.

Even more, they have hsla(240, 100%, 50%, 0.5) or hsl(240, 100%, 50%) as a values

evert commented 5 years ago

Hi @ashatrov-realforce , the issue here is that that property is specifically intended to implement a color feature that's been in calendars for a long time.

If that field starts supporting other formats, it means that existing calendar software will break.

That CalDAV property has existed and been around for many years, and much much longer than the RFC7986 iCalendar property, which is relatively new.

evert commented 5 years ago

If you have a desire to add a new property with more features for creating colors, you can just create it. As long as the PropertyStorage plugin is loaded, sabre/dav will accept any new properties you throw at it.