coppermine-gallery.com/forum

Support => cpg1.6.x Support => cpg1.6 upgrading => Topic started by: altenae on October 04, 2021, 12:19:19 PM

Title: Errors running "Overal stats" under PHP 8.0
Post by: altenae on October 04, 2021, 12:19:19 PM
When running overall stats under PHP 8.0 I see the following error which I can't fix:

Fatal error: Uncaught TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag in stats.inc.php (243
Also on line 326.

Code on 243 stats.inc.php

array_multisort($osResultArray,SORT_DESC);
$osTotal = array_sum($osResultArray);

and

stat_details.php(326): individualStatsByOS(0, 'hits', '100%') #2 {main} thrown in stat_details.php

Code on 326 in the stat_details.php

individualStatsByOS($pid,$type,$statsTableWidth);
individualStatsByBrowser($pid,$type,$statsTableWidth);


Anyone an idea ?
Title: Re: Errors running "Overal stats" under PHP 8.0
Post by: ron4mac on October 04, 2021, 01:26:46 PM
Thank you for providing feedback and discovering the error situation(s).

Corrections will be made in a day or two and be included in an updated version (1.6.14).
Title: Re: Errors running "Overal stats" under PHP 8.0
Post by: altenae on October 05, 2021, 02:26:57 PM
I have replaced the files from the CPG 1.6.14 package.
No errors but the stats page is totally empty.
Tried this before upgrading to PHP 8.0 and before it worked correctly (lot of stats information)

Any thing else I am missing ?
Title: Re: Errors running "Overal stats" under PHP 8.0
Post by: ron4mac on October 05, 2021, 06:46:28 PM
For now, make the change below. Work will be scheduled in this area at a later time for the next release.

In file stat_details.php, change line 39 from
        $pid = 0;
to
        $pid = '';
Title: Re: Errors running "Overal stats" under PHP 8.0
Post by: altenae on October 05, 2021, 07:10:52 PM
Quote from: ron4mac on October 05, 2021, 06:46:28 PM
For now, make the change below. Work will be scheduled in this area at a later time for the next release.

In file stat_details.php, change line 39 from
        $pid = 0;
to
        $pid = '';

Yes it fixed the issue.
Thanks