Error with PHP8 and newest CPG 1.6.12 entering the Configuration Admin menu Error with PHP8 and newest CPG 1.6.12 entering the Configuration Admin menu
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Error with PHP8 and newest CPG 1.6.12 entering the Configuration Admin menu

Started by viajero, July 06, 2021, 10:30:50 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

viajero

good morning,

steps i have done:
1. upgraded via normal update from 1.5.xx to cpg 1.6.12
went through successfully
2. checked all versions via update database & version check
everything was OK

gallery is showing correctly
login into admin panel works
try to enter into "config" / Einstellungen --> the following shows up under PHP8

Fatal error: Uncaught TypeError: count(): Argument #1 ($var) must be of type Countable|array, null given in PfadzurGallerie/galerie/include/functions.inc.php:5871 Stack trace: #0 PfadzurGallerie/galerie/include/admin.inc.php(174): cpg_get_available_languages() #1 PfadzurGallerie/galerie/admin.php(61): require_once('/PfadzurGallerie/...') #2 {main} thrown in PfadzurGallerie/galerie/include/functions.inc.php on line 5871

i can set the PHP settings from my provider forward and backwards - it works fine with PHP 7.3 / 7.4
when i set it to use PHP8 ( 8.01 ) according to phpinfo then entering there is giving me this mistake

every other admin menu entry works fine
it seems to be a change / or validation issue with php and its used variable types

thx in advance
more details / logs can be provided if necessary

André

ron4mac

Thanks for the feedback.

That error should not be occurring at all if your language settings are configured okay ... so check that (some) languages are available and enabled.

That said ... if you can update your PHP 8 version to greater than 8.0.1 (8.0.7), that should also rid you of the error.
As a last-ditch solution, changing the offending line (include/functions.inc.php:5871) should correct the problem.

        if (empty($language_array)) {

viajero

Hi,

Thx for the hint,
so how do I know, that my language settings are OK ?
which settings in which database table i have to look for / files in the directory ?
it is strange, that it comes up only with certain php versions
and - i cannot install any newer php version as this is a shared webspace - but i can hassle my provider to do it

thx in advance

André