Joomla! 3.9.4 После перехода на последнюю PHP пошли ошибки в логах:
[28-Mar-2019 06:23:21 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; JCommentsObjectInfo has a deprecated constructor in .../components/com_jcomments/classes/objectinfo.php on line 17
[28-Mar-2019 06:25:12 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; plgContentJComments has a deprecated constructor in .../plugins/content/jcomments/jcomments.php on line 25
[28-Mar-2019 06:39:53 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; JCommentsSubscriptionManager has a deprecated constructor in .../components/com_jcomments/jcomments.subscription.php on line 14
[29-Mar-2019 13:30:40 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; JCommentsACL has a deprecated constructor in .../components/com_jcomments/classes/acl.php on line 17
Эти ошибки решены. Решение здесь:
https://php.ru/forum/threads/perexodim-na-php7-osobennosti-perexoda.55712/Ошибка которая ниже не решена. Помогите, пожалуйста, исправить!
[29-Mar-2019 13:30:40 UTC] PHP Warning: count(): Parameter must be an array or an object that implements Countable in .../components/com_jcomments/tpl/default/tpl_form.php on line 193
Кусок кода с ошибкой:
<?php
}
}
}
$customBBCodes = $this->getVar('comments-form-custombbcodes');
if (count($customBBCodes)) { - в этой строке!
foreach($customBBCodes as $code) {
if ($code->button_enabled) {
$k = 'custombbcode' . $code->id;
$title = trim(JCommentsText::jsEscape($code->button_title));
$text = empty($code->button_prompt)? JText::_('BBCODE_HINT_ENTER_TEXT') : JText::_($code->button_prompt);
$open_tag = $code->button_open_tag;
$close_tag = $code->button_close_tag;
$icon = $code->button_image;
$css = $code->button_css;
?>