Osclass Support Forums
Osclass plugin support => Forums Osclass Plugin => Topic started by: Mindaugas on February 01, 2022, 02:57:35 PM
-
Hello,
I start use Forum plugin, but isn't work well. When i try remove created forum category it show error:
Fatal error: Uncaught TypeError: count(): Argument #1 ($var) must be of type Countable|array, bool given in /public_html/oc-content/plugins/forums/model/ModelFRM.php:963 Stack trace: #0 /public_html/oc-content/plugins/forums/admin/category.php(35): ModelFRM->removeCategory() #1 /public_html/oc-admin/themes/omega/plugins/view.php(38): require_once('...') #2 /public_html/oc-includes/osclass/helpers/hDefines.php(232): require('...') #3 /public_html/oc-admin/plugins.php(704): osc_current_admin_theme_path() #4 /public_html/oc-admin/plugins.php(434): CAdminPlugins->doView() #5 /public_html/oc-admin/index.php(140): CAdminPlugins->doModel() #6 {main} thrown in /public_html/oc-content/plugins/forums/model/ModelFRM.php on line 963
Same problem when i try delete a buard:
Fatal error: Uncaught TypeError: count(): Argument #1 ($var) must be of type Countable|array, bool given in /public_html/oc-content/plugins/forums/model/ModelFRM.php:980 Stack trace: #0 /public_html/oc-content/plugins/forums/admin/board.php(57): ModelFRM->removeBoard() #1 /public_html/oc-admin/themes/omega/plugins/view.php(38): require_once('...') #2 /public_html/oc-includes/osclass/helpers/hDefines.php(232): require('...') #3 /public_html/oc-admin/plugins.php(704): osc_current_admin_theme_path() #4 /public_html/oc-admin/plugins.php(434): CAdminPlugins->doView() #5 /public_html/oc-admin/index.php(140): CAdminPlugins->doModel() #6 {main} thrown in /public_html/oc-content/plugins/forums/model/ModelFRM.php on line 980
-
Correction in model:
if(count($boards > 0)) {
into:
if(is_array($boards) && count($boards) > 0) {
then:
if(count($topics > 0)) {
into:
if(is_array($topcis) && count($topics) > 0) {
Thanks for feedback, will be fixed in latest version as well ;)