diff options
author | Mario <mario@mariovavti.com> | 2022-12-02 15:18:01 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2022-12-02 18:06:20 +0100 |
commit | 697a74f37e78bf5e1df7b779c8912be8b6eb877e (patch) | |
tree | 5be1a54e803056aa0c641ee12fd7403794db6f70 /include/event.php | |
parent | 131ffcf582918321b044c99add30007dd1654ce2 (diff) | |
download | volse-hubzilla-697a74f37e78bf5e1df7b779c8912be8b6eb877e.tar.gz volse-hubzilla-697a74f37e78bf5e1df7b779c8912be8b6eb877e.tar.bz2 volse-hubzilla-697a74f37e78bf5e1df7b779c8912be8b6eb877e.zip |
fix regression: new event not created
(cherry picked from commit d16b6c3838cd76eb7ce336444cbd37774857b64f)
Diffstat (limited to 'include/event.php')
-rw-r--r-- | include/event.php | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/include/event.php b/include/event.php index 7c81d6934..b27504296 100644 --- a/include/event.php +++ b/include/event.php @@ -502,7 +502,6 @@ function ev_compare($a, $b) { function event_store_event($arr) { - $arr['created'] = $arr['created'] ?? datetime_convert(); $arr['edited'] = $arr['edited'] ?? datetime_convert(); $arr['etype'] = $arr['etype'] ?? 'event'; @@ -533,7 +532,7 @@ function event_store_event($arr) { $existing_event = null; - if(isset($arr['event_hash'])) { + if(isset($arr['event_hash']) && $arr['event_hash']) { $r = q("SELECT * FROM event WHERE event_hash = '%s' AND uid = %d LIMIT 1", dbesc($arr['event_hash']), intval($arr['uid']) @@ -543,7 +542,7 @@ function event_store_event($arr) { } } - if(isset($arr['id'])) { + if(isset($arr['id']) && $arr['id']) { $r = q("SELECT * FROM event WHERE id = %d AND uid = %d LIMIT 1", intval($arr['id']), intval($arr['uid']) @@ -647,7 +646,6 @@ function event_store_event($arr) { $hash = random_string(48); } } - $r = q("INSERT INTO event ( uid,aid,event_xchan,event_hash,created,edited,dtstart,dtend,summary,description,location,etype, adjust,nofinish, event_status, event_status_date, event_percent, event_repeat, event_sequence, event_priority, event_vdata, allow_cid,allow_gid,deny_cid,deny_gid) VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, '%s', '%s', %d, '%s', %d, %d, '%s', '%s', '%s', '%s', '%s' ) ", |