*

Mindaugas

  • **
  • 20 posts
Error when removing category or buard
« 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

Marked as best answer by frosticek on February 01, 2022, 03:35:48 PM
*

MB Themes

Re: Error when removing category or buard
« Reply #1 on: February 01, 2022, 03:35:42 PM »
Correction in model:
Code: [Select]
  if(count($boards > 0)) {

into:
Code: [Select]
  if(is_array($boards) && count($boards) > 0) {

then:
Code: [Select]
  if(count($topics > 0)) {

into:
Code: [Select]
  if(is_array($topcis) && count($topics) > 0) {

Thanks for feedback, will be fixed in latest version as well ;)
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots