Merge branch 'ent-3696-7723-No-inserta-comentario-create_event-API' into 'develop'

disable cache for events_comment

See merge request artica/pandorafms!2257

Former-commit-id: 1293d55a9bc009b79e37dd54cd848544ae6c3286
This commit is contained in:
Daniel Rodriguez 2019-03-13 10:32:56 +01:00
commit 046a126889

View File

@ -701,19 +701,20 @@ function events_comment(
$first_event = reset($id_event); $first_event = reset($id_event);
} }
$event_comments = db_get_value( $event_comments = mysql_db_process_sql(
'user_comment', 'SELECT user_comment FROM '.$event_table.' WHERE id_evento = '.$first_event,
$event_table, 'affected_rows',
'id_evento', '',
$first_event false
); );
$event_comments_array = []; $event_comments_array = [];
if ($event_comments == '') { if ($event_comments[0]['user_comment'] == '') {
$comments_format = 'new'; $comments_format = 'new';
} else { } else {
// If comments are not stored in json, the format is old. // If comments are not stored in json, the format is old.
$event_comments_array = json_decode($event_comments); $event_comments_array = json_decode($event_comments[0]['user_comment']);
if (empty($event_comments_array)) { if (empty($event_comments_array)) {
$comments_format = 'old'; $comments_format = 'old';