diff --git a/phpmyfaq/src/phpMyFAQ/Instance/Elasticsearch.php b/phpmyfaq/src/phpMyFAQ/Instance/Elasticsearch.php index b3895d35f9..3cfee8a4db 100644 --- a/phpmyfaq/src/phpMyFAQ/Instance/Elasticsearch.php +++ b/phpmyfaq/src/phpMyFAQ/Instance/Elasticsearch.php @@ -25,6 +25,7 @@ use phpMyFAQ\Configuration; use phpMyFAQ\Configuration\ElasticsearchConfiguration; use phpMyFAQ\Core\Exception; +use stdClass; /** * Class Elasticsearch @@ -200,7 +201,7 @@ public function dropIndex(): object * * @param string[] $faq */ - public function index(array $faq): object + public function index(array $faq): ?object { $params = [ 'index' => $this->esConfig->getIndex(), @@ -217,8 +218,8 @@ public function index(array $faq): object try { return $this->client->index($params)->asObject(); - } catch (ClientResponseException | MissingParameterException | ServerResponseException) { - //return ['error' => $e->getMessage()]; + } catch (ClientResponseException | MissingParameterException | ServerResponseException $e) { + $this->config->getLogger()->error('Index error.', [$e->getMessage()]); } } diff --git a/phpmyfaq/src/phpMyFAQ/Notification.php b/phpmyfaq/src/phpMyFAQ/Notification.php index 7ee564e479..87e8c40c2f 100644 --- a/phpmyfaq/src/phpMyFAQ/Notification.php +++ b/phpmyfaq/src/phpMyFAQ/Notification.php @@ -90,13 +90,14 @@ public function sendNewFaqAdded(array $emails, int $faqId, string $faqLanguage): $link = new Link($url, $this->config); $link->itemTitle = $this->faq->getRecordTitle($faqId); - $this->mail->message = html_entity_decode( - Translation::get('msgMailCheck') - ) . "

" . Translation::get('msgAskYourQuestion') . " " - . $this->faq->getRecordTitle($faqId) . "

" - . $this->faq->faqRecord['content'] - . "
" . $this->config->getTitle() - . ': ' . $link->toString() . ''; + $this->mail->message = html_entity_decode(Translation::get('msgMailCheck')) . + "

" . Translation::get('msgAskYourQuestion') . ": " . + $this->faq->getRecordTitle($faqId) . "

" . + "

" . Translation::get('msgNewContentArticle') . ": " . + $this->faq->faqRecord['content'] . "

" . + "
" . + $this->config->getTitle() . + ': ' . $link->toString() . ''; $this->mail->contentType = 'text/html';