JodliDev / calendar

GNU Affero General Public License v3.0
16 stars 12 forks source link

fix: event edition for caldav driver #4

Closed n-peugnet closed 2 years ago

n-peugnet commented 2 years ago

Set to NULL for real in db values that equals NULL in PHP. Without this change, events can not be edited on Postgres because it tries to set an invalid timestamp instead of NULL:

[28-Apr-2022 15:00:46 +0200]: <tv5na0nh> DB Error: [7] ERROR:  invalid input syntax for type timestamp: ""
LINE 2: ...atus"='', "attendees"='', "alarms"='', "notifyat"='', "calda...
                                                             ^ (SQL Query: UPDATE caldav_events
       SET   changed=now() , "start"='2022-04-29 16:00:00', "end"='2022-04-29 18:00:00', "all_day"='0', "recurrence_id"='0', "isexception"='0', "sequence"='0', "title"='test', "description"='', "location"='', "categories"='', "url"='', "free_busy"='1', "priority"='0', "sensitivity"='0', "status"='', "attendees"='', "alarms"='', "notifyat"='', "caldav_url"='/calendars/nicolas/default//D3F457A307C27F83D74BEE2AA8440C29-DEB97A759EE7B8BA.ics', "caldav_tag"=''
       WHERE event_id='378'
       AND   calendar_id IN ('22','21')) in /usr/share/roundcube/program/lib/Roundcube/rcube_db.php on line 544 (POST /?_task=calendar&_action=event)

Only tested on PostgreSQL

JodliDev commented 2 years ago

Tested it with mysql and seems to work there as well. Thank you!