Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Upgrading from 1.6.03 to 1.6.19 for PHP 8.1  (Read 4476 times)

0 Members and 1 Guest are viewing this topic.

Bobbywires

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Upgrading from 1.6.03 to 1.6.19 for PHP 8.1
« on: May 09, 2022, 11:06:26 pm »

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
Logged

Bobbywires

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: Upgrading from 1.6.03 to 1.6.19 for PHP 8.1
« Reply #1 on: May 09, 2022, 11:28:19 pm »

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);
Logged

ron4mac

  • Administrator
  • Coppermine addict
  • *****
  • Country: us
  • Offline Offline
  • Posts: 2026
Re: Upgrading from 1.6.03 to 1.6.19 for PHP 8.1
« Reply #2 on: May 10, 2022, 12:18:34 am »

Add the line:

Code: [Select]
    $lang_language_data = [];        // <--- add this
    // get list of available languages
    $results = cpg_db_query("SELECT * FROM {$CONFIG['TABLE_LANGUAGE']}");
Logged
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 19 queries.