diff --git a/forms/class/forms.php b/forms/class/forms.php index cd851a1..737aded 100644 --- a/forms/class/forms.php +++ b/forms/class/forms.php @@ -1660,18 +1660,18 @@ function _cleanvar($var) if (!empty($request_author)) $history['dialog']['request'] = array_merge($history['dialog']['request'], $request_author); - // ответы - foreach ($history['dialog']['response'] as &$response) - { - $response_author = $AVE_DB->Query(" - SELECT user_name, firstname, lastname - FROM " . PREFIX . "_users - WHERE Id = '" . $response['user_id'] . "' - ")->FetchAssocArray(); +// ответы +foreach ($history['dialog']['response'] ?? [] as &$response) +{ + $response_author = $AVE_DB->Query(" + SELECT user_name, firstname, lastname + FROM " . PREFIX . "_users + WHERE Id = '" . $response['user_id'] . "' + ")->FetchAssocArray(); - if (!empty($response_author)) - $response = array_merge($response, $response_author); - } + if (!empty($response_author)) + $response = array_merge($response, $response_author); +} // форма ответа if (empty($history['dialog']['response_draft'])) diff --git a/forms/templates/dialog.tpl b/forms/templates/dialog.tpl index ad8751f..a025853 100644 --- a/forms/templates/dialog.tpl +++ b/forms/templates/dialog.tpl @@ -37,8 +37,8 @@ $fid = parseInt('{$fid}'); $sess = '{$sess}'; $smarty = new Array; -$smarty['start_alert'] = '{$alert.text}'; -$smarty['start_alert_theme'] = '{$alert.theme}'; +$smarty['start_alert'] = '{$alert.text|default:''}'; +$smarty['start_alert_theme'] = '{$alert.theme|default:''}';