Skip to main content
Topic: 1.1.1 php7.2 error (Read 5025 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

1.1.1 php7.2 error

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

Does it say also the file and the line of the error?
Bugs creator.
Features destroyer.
Template killer.

Re: 1.1.1 php7.2 error

Reply #2

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:
php-7.1.png   php-7.2.png

In elkarte log there is no error using php 7.1, with 7.2 I get:

Type of error: General
Warning: count(): Parameter must be an array or an object that implements Countable
http://...index.php?action=pm;pmid=2429;kstart;f=inbox;start=30;sort=date;asc
File: ...sources/controllers/PersonalMessage.controller.php
Line: 3094
sorry for my bad english

Re: 1.1.1 php7.2 error

Reply #3

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 #5

I lost the reply...
OMG again PMs... :'(
My eyes are already bleeding!! xD
Bugs creator.
Features destroyer.
Template killer.

Re: 1.1.1 php7.2 error

Reply #6

haha

@badmonkey @radu81 did it work?
LiveGallery - Simple gallery addon for ElkArte

Re: 1.1.1 php7.2 error

Reply #7

Thanks @live627‍ , nothing changed, I still see the error
sorry for my bad english


Re: 1.1.1 php7.2 error

Reply #9

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
Many are stubborn in relation to the path, a few in relation to the target.
Visit our new Forum Project on https://www.portamx.com

Re: 1.1.1 php7.2 error

Reply #10

I still see that error: count(): Parameter must be an array or an object that implements Countable
sorry for my bad english

Re: 1.1.1 php7.2 error

Reply #11

Confirmed the error persists. 

Re: 1.1.1 php7.2 error

Reply #12

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();
}
Bugs creator.
Features destroyer.
Template killer.

Re: 1.1.1 php7.2 error

Reply #13

Yes, that works fine, thanks  8)
sorry for my bad english

Re: 1.1.1 php7.2 error

Reply #14

Still getting the error here.  PHP 7.2.1, if that matters.   ;)