PHP 7.2.0 compatibility

501 views
Skip to first unread message

Roedel, Mark

unread,
Dec 14, 2017, 2:40:49 PM12/14/17
to resour...@googlegroups.com
After upgrading to PHP 7.2.0, we have a number of places in ResourceSpace that now throw an error "count(): Parameter must be an array or an object that implements Countable." This looks to be related to the changelog entry on https://secure.php.net/manual/en/function.count.php (beginning with version 7.2.0, "count() will not yield a warning on invalid countable types passed to the array_or_countable parameter")

One example of this is pages/search.php line 513 - in this case it seems to be fixable by swapping the order of lines 513 and 514, but there are other places where I suspect it's a bit more involved than that...

dan....@montala.com

unread,
Dec 14, 2017, 3:30:32 PM12/14/17
to ResourceSpace
Hi Mark,

I'll make sure we test the up-coming 8.4 release on PHP 7.2.0. I know there have already been several fixes to the trunk. That should be released the second week in January.

Thanks,

Dan

Tim Orwig

unread,
Dec 14, 2017, 7:53:47 PM12/14/17
to ResourceSpace
I recently purchased support for an on prem server. I was told that 7.2 is supported but I had the same errors. When I changed my PHP to 5.6, all problems went away. It also seems to have a few issues with the latest version of MySQL (5.7)

Yair Krauze

unread,
Dec 14, 2017, 9:43:06 PM12/14/17
to ResourceSpace
FYI, I am running (a self supported) RS 8.3 on Ubuntu 16.04 with MySQL 5.7.20 and PHP 7.1.12 without any issues.

Roedel, Mark

unread,
Jan 18, 2018, 3:42:49 PM1/18/18
to resour...@googlegroups.com

Here’s a few remaining instances that I’m still seeing since updating to 8.4 –

 

include/message_functions.php, line 283

include/general.php, line 669

dan....@montala.com

unread,
Jan 25, 2018, 5:51:18 AM1/25/18
to ResourceSpace
Hi Mark,

What are the actual error messages?

8.4 was tested against PHP 7.0.2 with no issues found.

Thanks,

Dan

Roedel, Mark

unread,
Jan 25, 2018, 12:21:07 PM1/25/18
to resour...@googlegroups.com

Same as before:

/srv/http/include/general.php line 669: count(): Parameter must be an array or an object that implements Countable”

 

The general.php error came up in the “search for similar resources” section of item details from a search result - you can see an example screenshot at https://cl.ly/p6Gu.  The message_functions.php one came when I tried to approve a resource download request.

 

In both cases, I temporarily patched around the error message by changing

 

                count($remote_refs)==0

 

on the indicated line to

 

((is_array($remote_refs)) && (count($remote_refs)==0 ))

 

but I haven’t done any sort of in-depth analysis to see whether there might be some weird edge cases where that might result in something unexpected.

 

 

 

From: resour...@googlegroups.com [mailto:resour...@googlegroups.com] On Behalf Of dan....@montala.com
Sent: Thursday, January 25, 2018 4:51 AM
To: ResourceSpace <resour...@googlegroups.com>
Subject: Re: PHP 7.2.0 compatibility

 

Hi Mark,

 

What are the actual error messages?

 

8.4 was tested against PHP 7.0.2 with no issues found.

 

Thanks,

 

Dan



On Thursday, January 18, 2018 at 8:42:49 PM UTC, MarkR wrote:

Here’s a few remaining instances that I’m still seeing since updating to 8.4 –

 

include/message_functions.php, line 283

include/general.php, line 669

 

 

 

From: resour...@googlegroups.com [mailto:resour...@googlegroups.com] On Behalf Of dan....@montala.com
Sent: Thursday, December 14, 2017 2:31 PM
To: ResourceSpace <resour...@googlegroups.com>
Subject: Re: PHP 7.2.0 compatibility

 

Hi Mark,

 

I'll make sure we test the up-coming 8.4 release on PHP 7.2.0. I know there have already been several fixes to the trunk. That should be released the second week in January.

 

Thanks,

 

Dan

 


On Thursday, 14 December 2017 19:40:49 UTC, MarkR wrote:

After upgrading to PHP 7.2.0, we have a number of places in ResourceSpace that now throw an error "count(): Parameter must be an array or an object that implements Countable."  This looks to be related to the changelog entry on https://secure.php.net/manual/en/function.count.php (beginning with version 7.2.0, "count() will not yield a warning on invalid countable types passed to the array_or_countable parameter")

One example of this is pages/search.php line 513 - in this case it seems to be fixable by swapping the order of lines 513 and 514, but there are other places where I suspect it's a bit more involved than that...

--
ResourceSpace: Open Source Digital Asset Management
http://www.resourcespace.com
---
You received this message because you are subscribed to the Google Groups "ResourceSpace" group.
To unsubscribe from this group and stop receiving emails from it, send an email to resourcespac...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

alistair henderson

unread,
Apr 10, 2018, 2:30:29 PM4/10/18
to ResourceSpace
Hi Dan

This is still an issue in 8.4.

When registering a user /var/www/html/resourcespace/include/message_functions.php line 283: count(): Parameter must be an array or an object that implements Countable

php --verison

PHP 7.2.0 (cli) (built: Dec 13 2017 00:38:30) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2017 Zend Technologies


This is a brand new install so we can download code if needed.

Cheers

Al



T+44(0)1782 577566 ¦ F+44(0)1782 524355  ¦ www.churchill1795.com   ¦  Twitter: @churchill1795

 

Head Office & Showroom: Marlborough Pottery, High Street, Tunstall, Stoke-on-TrentEngland, ST6 5NZ

London Showroom: Churchill Showroom, Business Design Centre, Suite 10252 Upper Street, Islington, LondonN1 0QH



This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. Any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. Employees of Churchill China plc are expressly required not to make defamatory statements and not to infringe or authorize any infringement  of copyright or any other legal right by email communications. Any such communication is contrary to company policy and outside the scope of the employment of the individual concerned. The company will not accept any liability in respect of such communication, and the employee responsible will be personally liable for any damages or other liability arising.

Churchill China (UK) Limited, Registered in England No 270153, Churchill China plc,Registered in England No 2709505 No.1 Marlborough Way, Stoke-on- Trent, ST6 5NZ. www.churchill1795.com

Tim Orwig

unread,
Apr 18, 2018, 11:32:43 AM4/18/18
to ResourceSpace
I'm having the same error. I'll contact their support and see what they say. 

David Smith

unread,
May 11, 2018, 2:54:10 PM5/11/18
to ResourceSpace
I am getting this error on rs 8.4 installed on Ubuntu 18.04 server, PHP 7.2, MySQL 5.7, after I uploaded a few jpegs to a new collection as a test.

The "installation check" page says all ok, except I didn't set up the cron job yet.

Dan Huby

unread,
May 15, 2018, 8:54:52 AM5/15/18
to ResourceSpace
Hi all,

We've worked on PHP 7.2 compatibility for the new 8.5 release, which is now available to download.

Dan

Reply all
Reply to author
Forward
0 new messages