Solved: 1 Year, 2 Weeks ago Why is this happening?
#1
Solved: 1 Year, 2 Weeks ago
Your copy of MyBB running on AEG Clan  has experienced an error. Details of the error include:
---
Type: 2
File: admin/modules/forum/management.php (Line no. 145)
Message
count(): Parameter must be an array or an object that implements Countable
Back Trace: #0  errorHandler->email_error(2, count(): Parameter must be an array or an object that implements Countable, admin/modules/forum/management.php, 145) called at [/var/www/forum/inc/class_error.php:195]



=========================================
Every time I get this kinds of error, I had to modify PHP code inside that will check if the variable actually exists. How can I fix this kinds of things without modifying PHP code?
Reply
#2
Solved: 1 Year, 2 Weeks ago
What's the version of MyBB you're running? And what about the PHP version?
Could be wrong but worth a try.
Reply
#3
Solved: 1 Year, 2 Weeks ago
(2020-03-31, 02:36 PM)noyle Wrote: What's the version of MyBB you're running? And what about the PHP version?

MyBB Version 1.8.22
PHP Version 7.2.24-0ubuntu0.18.04.3
Reply
#4
Solved: 1 Year, 2 Weeks ago
Seems there is an error in management.php, line 145.
Original line
if(is_array($mybb->input['copygroups']) && count($mybb->input['copygroups'] > 0))

Seems better
if(is_array($mybb->input['copygroups']) && count($mybb->input['copygroups']) > 0)
[MyBB 1.8 mods] - Offer me a coffee
Do not ask me help through PM
Reply
#5
Solved: 1 Year, 2 Weeks ago
Oh, the closing bracket..

By the way, @Crazycat has just created a pull request correcting this https://github.com/mybb/mybb/pull/3919

Anyway, if encountering any error that requires code modification, OP is encouraged to submit a bug report or create an issue addressing that in forum https://community.mybb.com/forum-157.html or GitHub https://github.com/mybb/mybb/issues/new/choose .
Could be wrong but worth a try.
Reply
#6
Solved: 1 Year, 2 Weeks ago
(2020-03-31, 02:16 PM)online0227 Wrote: Your copy of MyBB running on AEG Clan  has experienced an error. Details of the error include:
---
Type: 2
File: admin/modules/forum/management.php (Line no. 145)
Message
count(): Parameter must be an array or an object that implements Countable
Back Trace: #0  errorHandler->email_error(2, count(): Parameter must be an array or an object that implements Countable, admin/modules/forum/management.php, 145) called at [/var/www/forum/inc/class_error.php:195]



=========================================
Every time I get this kinds of error, I had to modify PHP code inside that will check if the variable actually exists. How can I fix this kinds of things without modifying PHP code?

Looks like there is no system-wise solving problem but only need to change the php code?
Reply
#7
Solved: 1 Year, 2 Weeks ago
^ yes, change it as suggested and that should stop referred error.
Reply
#8
Solved: 1 Year, 2 Weeks ago
OK, thank you very much all!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)