aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2022-12-02 15:18:01 +0000
committerMario <mario@mariovavti.com>2022-12-02 15:18:01 +0000
commitd16b6c3838cd76eb7ce336444cbd37774857b64f (patch)
tree03de27f5df04bf705487ce9bb698a7c23f19d062 /include
parente4461f2e61198fdc6002d7b2b36185c0f275e58d (diff)
downloadvolse-hubzilla-d16b6c3838cd76eb7ce336444cbd37774857b64f.tar.gz
volse-hubzilla-d16b6c3838cd76eb7ce336444cbd37774857b64f.tar.bz2
volse-hubzilla-d16b6c3838cd76eb7ce336444cbd37774857b64f.zip
fix regression: new event not created
Diffstat (limited to 'include')
-rw-r--r--include/event.php6
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' ) ",