1.1.1 php7.2 error December 17, 2017, 10:32:14 am Not sure if this really belongs in bugz or not. emanuele will undoubtedly choose wisely. Anyway, when attempting to read PMs in 1.1.1 on php7.2, the following error occurs:Code: [Select]count(): Parameter must be an array or an object that implements Countable
Re: 1.1.1 php7.2 error Reply #1 – December 17, 2017, 02:06:22 pm Does it say also the file and the line of the error?
Re: 1.1.1 php7.2 error Reply #2 – December 17, 2017, 05:34:06 pm I can confirm, I have the same error. I try to give more information: I set PM as conversations, with PHP 7.1 I see all messages of the conversation, with PHP 7.2 I only see the first message of the conversation, and after that the error mentioned by @badmonkey I attach a couple of screenshots: In elkarte log there is no error using php 7.1, with 7.2 I get:Type of error: GeneralWarning: count(): Parameter must be an array or an object that implements Countablehttp://...index.php?action=pm;pmid=2429;kstart;f=inbox;start=30;sort=date;ascFile: ...sources/controllers/PersonalMessage.controller.phpLine: 3094
Re: 1.1.1 php7.2 error Reply #3 – December 17, 2017, 06:14:01 pm I think the first count on that line isn’t required. Or at least that’s what’s throwing the error
Re: 1.1.1 php7.2 error Reply #4 – December 17, 2017, 11:34:50 pm I don't run PHP 7.2 yet, but I quickly looked through the relevant code and came up with the fix below.https://github.com/elkarte/Elkarte/pull/3081/files
Re: 1.1.1 php7.2 error Reply #5 – December 20, 2017, 09:00:22 am I lost the reply...OMG again PMs... My eyes are already bleeding!! xD
Re: 1.1.1 php7.2 error Reply #7 – December 21, 2017, 03:25:24 am Thanks @live627 , nothing changed, I still see the error
Re: 1.1.1 php7.2 error Reply #8 – December 21, 2017, 05:28:03 am can you also add https://github.com/elkarte/Elkarte/pull/3081/commits/fa78e4b2db21ec6cdd7fe866a62839dfd831037f ?
Re: 1.1.1 php7.2 error Reply #9 – December 21, 2017, 06:38:34 am If you use count on php7.* check is the $var a array with a simple is_array($var) ..like if(is_array($var) && count($var) = 2)Fel
Re: 1.1.1 php7.2 error Reply #10 – December 21, 2017, 09:08:20 am Quote from: live627 – December 21, 2017, 05:28:03 amcan you also add I still see that error: count(): Parameter must be an array or an object that implements Countable
Re: 1.1.1 php7.2 error Reply #12 – January 25, 2018, 04:55:07 pm Let's try this: in PersonalMessage.subs.php, find:Code: [Select] $message_labels = array();and add after it:Code: [Select] foreach ($all_pms as $pmid) { $message_labels[$pmid] = array(); }
Re: 1.1.1 php7.2 error Reply #14 – January 25, 2018, 07:59:22 pm Still getting the error here. PHP 7.2.1, if that matters.