News:

CRITICAL UPGRADE CPG RELEASE 1.6.30
Version 1.6.30 removes a serious security issue that could allow unauthorized access to modify your site. Upgrade as soon as possible.

Main Menu

Upgrading from 1.6.03 to 1.6.19 for PHP 8.1

Started by Bobbywires, May 09, 2022, 11:06:26 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Bobbywires

Upgrade runs in 7.3 versioncheck passes but switching to 8.1   I get the following errors:

Fatal error: Uncaught TypeError: ksort(): Argument #1 ($array) must be of type array, null given in /home/bobby0/public_html/stockdale7/include/functions.inc.php:4270 Stack trace: #0 /home/bobby0/public_html/stockdale7/include/functions.inc.php(4270): ksort() #1 /home/bobby0/public_html/stockdale7/include/functions.inc.php(896): languageSelect() #2 /home/bobby0/public_html/stockdale7/include/init.inc.php(442): load_template() #3 /home/bobby0/public_html/stockdale7/index.php(22): require('/home/bobby0/pu...') #4 {main} thrown in /home/bobby0/public_html/stockdale7/include/functions.inc.php on line 4270

Bobbywires

Here is the code
   // get list of available languages
    $results = cpg_db_query("SELECT * FROM {$CONFIG['TABLE_LANGUAGE']}");
    while ( ($row = $results->fetchArray()) ) {
        if ($row['available'] == 'YES' && $row['enabled'] == 'YES' && file_exists('lang/'.$row['lang_id'].'.php')) {
            $lang_language_data[$row['lang_id']] = $row;
        }
    } // while
    $results->free();

    // sort the array by English name
    ksort($lang_language_data);

ron4mac

Add the line:

    $lang_language_data = [];        // <--- add this
    // get list of available languages
    $results = cpg_db_query("SELECT * FROM {$CONFIG['TABLE_LANGUAGE']}");