Results 1 to 8 of 8
  1. #1
    Join Date
    Apr 2011
    Posts
    383
    Plugin Contributions
    0

    Default Upgrade to PHP 7.2 error

    Hello,

    I am trying to fix a few errors so i can switch my hosting to PHP 7.2. I am currently stuck on a PHP 5.6 until i solved the following errors:

    [14-Dec-2021 14:20:15 America/Los_Angeles] Request URI: /all-flowers/christmas-spirit-in-a-wood-box, IP address: 66.249.79.112
    #1 zen_categories_ul_generator->buildBranch() called at [/home/zch1akhw6q3m/public_html/includes/classes/categories_ul_generator.php:85]
    #2 zen_categories_ul_generator->buildTree() called at [/home/zch1akhw6q3m/public_html/includes/templates/Royal_Fleur/common/tpl_mega_menu.php:56]
    #3 require(/home/zch1akhw6q3m/public_html/includes/templates/Royal_Fleur/common/tpl_mega_menu.php) called at [/home/zch1akhw6q3m/public_html/includes/templates/Royal_Fleur/common/tpl_header.php:200]
    #4 require(/home/zch1akhw6q3m/public_html/includes/templates/Royal_Fleur/common/tpl_header.php) called at [/home/zch1akhw6q3m/public_html/includes/templates/Royal_Fleur/common/tpl_main_page.php:119]
    #5 require(/home/zch1akhw6q3m/public_html/includes/templates/Royal_Fleur/common/tpl_main_page.php) called at [/home/zch1akhw6q3m/public_html/index.php:97]
    --> PHP Warning: A non-numeric value encountered in /home/zch1akhw6q3m/public_html/includes/classes/categories_ul_generator.php on line 58.

    [14-Dec-2021 14:20:15 America/Los_Angeles] Request URI: /all-flowers/christmas-spirit-in-a-wood-box, IP address: 66.249.79.112
    #1 zen_categories_ul_generator->buildBranch() called at [/home/zch1akhw6q3m/public_html/includes/classes/categories_ul_generator.php:85]
    #2 zen_categories_ul_generator->buildTree() called at [/home/zch1akhw6q3m/public_html/includes/templates/Royal_Fleur/common/tpl_mega_menu.php:56]
    #3 require(/home/zch1akhw6q3m/public_html/includes/templates/Royal_Fleur/common/tpl_mega_menu.php) called at [/home/zch1akhw6q3m/public_html/includes/templates/Royal_Fleur/common/tpl_header.php:200]
    #4 require(/home/zch1akhw6q3m/public_html/includes/templates/Royal_Fleur/common/tpl_header.php) called at [/home/zch1akhw6q3m/public_html/includes/templates/Royal_Fleur/common/tpl_main_page.php:119]
    #5 require(/home/zch1akhw6q3m/public_html/includes/templates/Royal_Fleur/common/tpl_main_page.php) called at [/home/zch1akhw6q3m/public_html/index.php:97]
    --> PHP Warning: A non-numeric value encountered in /home/zch1akhw6q3m/public_html/includes/classes/categories_ul_generator.php on line 73.

    [14-Dec-2021 14:20:15 America/Los_Angeles] Request URI: /all-flowers/christmas-spirit-in-a-wood-box, IP address: 66.249.79.112
    #1 sizeof() called at [/home/zch1akhw6q3m/public_html/includes/templates/Royal_Fleur/common/tpl_mega_menu.php:199]
    #2 require(/home/zch1akhw6q3m/public_html/includes/templates/Royal_Fleur/common/tpl_mega_menu.php) called at [/home/zch1akhw6q3m/public_html/includes/templates/Royal_Fleur/common/tpl_header.php:200]
    #3 require(/home/zch1akhw6q3m/public_html/includes/templates/Royal_Fleur/common/tpl_header.php) called at [/home/zch1akhw6q3m/public_html/includes/templates/Royal_Fleur/common/tpl_main_page.php:119]
    #4 require(/home/zch1akhw6q3m/public_html/includes/templates/Royal_Fleur/common/tpl_main_page.php) called at [/home/zch1akhw6q3m/public_html/index.php:97]
    --> PHP Warning: sizeof(): Parameter must be an array or an object that implements Countable in /home/zch1akhw6q3m/public_html/includes/templates/Royal_Fleur/common/tpl_mega_menu.php on line 199.
    Here is the mentioned line in the different file at the corredsponding line:

    /categories_ul_generator.php on line 58.

    PHP Code:
          $result sprintf($this->parent_group_start_string, ($submenu==true) ? ' class="level'. ($level+1) . '"' '' ); 
    /categories_ul_generator.php on line 73.

    PHP Code:
                        $result .= $this->buildBranch($category_id$level+1$submenu$category_link '_'); 
    /tpl_mega_menu.php line 199

    PHP Code:
                    for ($i=0;$i<sizeof($manufacturer_sidebox_array);$i++) { 
    Anyone can help me fix these please

    Thank you in advance

  2. #2
    Join Date
    Jul 2012
    Posts
    16,733
    Plugin Contributions
    17

    Default Re: Upgrade to PHP 7.2 error

    To address the categories_ul_generator.php file issue, take a look at what is done at this specific line of the distributed version of that file for ZC 1.5.6. The line number in the below file/link is 58 which in your file is going to be a lower numbered line:https://github.com/zencart/zencart/b...erator.php#L58

    As far as the mega_menu file, basically it seems there is a condition before that line that is preventing $manufacturer_sidebox_array from actually being an array.

    There are things that could be done just before that line to "cheat" ones way through, but a real fix would be to go back up in the code to ensure that the variable is either first declared an empty array or otherwise assigned to an array type variable.

    I would not be surprised if the issue is flushed out more in one of the associated forum threads for that template or one similar to it.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Apr 2011
    Posts
    383
    Plugin Contributions
    0

    Default Re: Upgrade to PHP 7.2 error

    Quote Originally Posted by mc12345678 View Post
    To address the categories_ul_generator.php file issue, take a look at what is done at this specific line of the distributed version of that file for ZC 1.5.6. The line number in the below file/link is 58 which in your file is going to be a lower numbered line:https://github.com/zencart/zencart/b...erator.php#L58

    As far as the mega_menu file, basically it seems there is a condition before that line that is preventing $manufacturer_sidebox_array from actually being an array.

    There are things that could be done just before that line to "cheat" ones way through, but a real fix would be to go back up in the code to ensure that the variable is either first declared an empty array or otherwise assigned to an array type variable.

    I would not be surprised if the issue is flushed out more in one of the associated forum threads for that template or one similar to it.
    Thank you so much for the fast reply.

    I replaced my version of category_ul_generator.php with the original from ZC 1.5.6 and the related errors are gone for now.

    I am still facing tpl_mega_menu error:

    [14-Dec-2021 16:56:46 America/Los_Angeles] Request URI: /christmas-flowers-and-centerpieces, IP address: 76.103.115.109
    #1 sizeof() called at [/home/zch1akhw6q3m/public_html/includes/templates/Royal_Fleur/common/tpl_mega_menu.php:199]
    #2 require(/home/zch1akhw6q3m/public_html/includes/templates/Royal_Fleur/common/tpl_mega_menu.php) called at [/home/zch1akhw6q3m/public_html/includes/templates/Royal_Fleur/common/tpl_header.php:200]
    #3 require(/home/zch1akhw6q3m/public_html/includes/templates/Royal_Fleur/common/tpl_header.php) called at [/home/zch1akhw6q3m/public_html/includes/templates/Royal_Fleur/common/tpl_main_page.php:119]
    #4 require(/home/zch1akhw6q3m/public_html/includes/templates/Royal_Fleur/common/tpl_main_page.php) called at [/home/zch1akhw6q3m/public_html/index.php:97]
    --> PHP Warning: sizeof(): Parameter must be an array or an object that implements Countable in /home/zch1akhw6q3m/public_html/includes/templates/Royal_Fleur/common/tpl_mega_menu.php on line 199.
    I am not a coder or expert in any way. I checked the related thread for pure css mega menu but no luck regarding this error.

    Any ideas how to go about it?

    Thank you again for your help

    Here is the most of the related code i believe:

    PHP Code:
         </li><!-- eof quick links -->
            

         <li class="manufacturers-li"><a href="<?php echo zen_href_link(FILENAME_DEFAULT); ?>" class="drop"><?php echo HEADER_TITLE_MANUFACTURERS?></a><!--bof shop by brand   -->
                <div class="dropdown_1column">
                    <div class="col_1 firstcolumn">

                  <ul >
                   <?php
            
      $show_manufacturers
    true;

    // for large lists of manufacturers uncomment this section
    /*
      if (($_GET['main_page']==FILENAME_DEFAULT and ($_GET['cPath'] == '' or $_GET['cPath'] == 0)) or  ($request_type == 'SSL')) {
        $show_manufacturers= false;
      } else {
        $show_manufacturers= true;
      }
    */

    // Set to true to display manufacturers images in place of names
    define('DISPLAY_MANUFACTURERS_IMAGES',false);

    if (
    $show_manufacturers) {

    // only check products if requested - this may slow down the processing of the manufacturers sidebox
      
    if (PRODUCTS_MANUFACTURERS_STATUS == '1') {
        
    $manufacturer_sidebox_query "select distinct m.manufacturers_id, m.manufacturers_name, m.manufacturers_image
                                from " 
    TABLE_MANUFACTURERS " m
                                left join " 
    TABLE_PRODUCTS " p on m.manufacturers_id = p.manufacturers_id
                                where m.manufacturers_id = p.manufacturers_id and p.products_status= 1
                                order by manufacturers_name"
    ;
      } else {
        
    $manufacturer_sidebox_query "select m.manufacturers_id, m.manufacturers_name, m.manufacturers_image
                                from " 
    TABLE_MANUFACTURERS " m
                                order by manufacturers_name"
    ;
      }

      
    $manufacturer_sidebox $db->Execute($manufacturer_sidebox_query);

      if (
    $manufacturer_sidebox->RecordCount()>0) {
        
    $number_of_rows $manufacturer_sidebox->RecordCount()+1;

    // Display a list
        
    $manufacturer_sidebox_array = array();
    //        kuroi: commented out to avoid starting list with text scrolling list entries such as "reset" and "please select"
    //    if (!isset($_GET['manufacturers_id']) || $_GET['manufacturers_id'] == '' ) {
    //      $manufacturer_sidebox_array[] = array('id' => '', 'text' => PULL_DOWN_ALL);
    //    } else {
    //      $manufacturer_sidebox_array[] = array('id' => '', 'text' => PULL_DOWN_MANUFACTURERS);
    //    }

        
    while (!$manufacturer_sidebox->EOF) {
          
    $manufacturer_sidebox_name = ((strlen($manufacturer_sidebox->fields['manufacturers_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN) ? substr($manufacturer_sidebox->fields['manufacturers_name'], 0MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' $manufacturer_sidebox->fields['manufacturers_name']);
          
    $manufacturer_sidebox_image $manufacturer_sidebox->fields['manufacturers_image'];
          
    $manufacturer_sidebox_array[] =
            array(
    'id' => $manufacturer_sidebox->fields['manufacturers_id'],
                  
    'text' => DISPLAY_MANUFACTURERS_IMAGES ?
                    
    zen_image(DIR_WS_IMAGES $manufacturer_sidebox_image$manufacturer_sidebox_name) :
                    
    $manufacturer_sidebox_name);
          
    $manufacturer_sidebox->MoveNext();
        }
          
      }
    // $show_manufacturers
                    
    for ($i=0;$i<sizeof($manufacturer_sidebox_array);$i++) {
          
    $content '';
          
    $content .= '<li ><a class="hide" href="' zen_href_link(FILENAME_DEFAULT'manufacturers_id=' $manufacturer_sidebox_array[$i]['id']) . '">';
          
    $content .= $manufacturer_sidebox_array[$i]['text'];
          
    $content .= '</a></li>' "\n";
          echo 
    $content;
        }
    ?>
                </ul>
            </div>
                </div>
            </li><!-- eof shop by brand    -->

  4. #4
    Join Date
    Apr 2011
    Posts
    383
    Plugin Contributions
    0

    Default Re: Upgrade to PHP 7.2 error

    I went ahead and deleted that whole section of code since i was not displaying the manufacturers anyway.

    I understand it is a bit of " butcher way "of doing but the site seems to be working fine so far.

    It is at royal-fleur.com runing under PHP 7.3. No error logged so far.

    Thank you for helping me

  5. #5
    Join Date
    Jul 2012
    Posts
    16,733
    Plugin Contributions
    17

    Default Re: Upgrade to PHP 7.2 error

    Quote Originally Posted by nicksab View Post
    Thank you so much for the fast reply.

    I replaced my version of category_ul_generator.php with the original from ZC 1.5.6 and the related errors are gone for now.

    I am still facing tpl_mega_menu error:



    I am not a coder or expert in any way. I checked the related thread for pure css mega menu but no luck regarding this error.

    Any ideas how to go about it?

    Thank you again for your help

    Here is the most of the related code i believe:

    PHP Code:
         </li><!-- eof quick links -->
            

         <li class="manufacturers-li"><a href="<?php echo zen_href_link(FILENAME_DEFAULT); ?>" class="drop"><?php echo HEADER_TITLE_MANUFACTURERS?></a><!--bof shop by brand   -->
                <div class="dropdown_1column">
                    <div class="col_1 firstcolumn">

                  <ul >
                   <?php
            
      $show_manufacturers
    true;

    // for large lists of manufacturers uncomment this section
    /*
      if (($_GET['main_page']==FILENAME_DEFAULT and ($_GET['cPath'] == '' or $_GET['cPath'] == 0)) or  ($request_type == 'SSL')) {
        $show_manufacturers= false;
      } else {
        $show_manufacturers= true;
      }
    */

    // Set to true to display manufacturers images in place of names
    define('DISPLAY_MANUFACTURERS_IMAGES',false);

    if (
    $show_manufacturers) {

    // only check products if requested - this may slow down the processing of the manufacturers sidebox
      
    if (PRODUCTS_MANUFACTURERS_STATUS == '1') {
        
    $manufacturer_sidebox_query "select distinct m.manufacturers_id, m.manufacturers_name, m.manufacturers_image
                                from " 
    TABLE_MANUFACTURERS " m
                                left join " 
    TABLE_PRODUCTS " p on m.manufacturers_id = p.manufacturers_id
                                where m.manufacturers_id = p.manufacturers_id and p.products_status= 1
                                order by manufacturers_name"
    ;
      } else {
        
    $manufacturer_sidebox_query "select m.manufacturers_id, m.manufacturers_name, m.manufacturers_image
                                from " 
    TABLE_MANUFACTURERS " m
                                order by manufacturers_name"
    ;
      }

      
    $manufacturer_sidebox $db->Execute($manufacturer_sidebox_query);

      if (
    $manufacturer_sidebox->RecordCount()>0) {
        
    $number_of_rows $manufacturer_sidebox->RecordCount()+1;

    // Display a list
        
    $manufacturer_sidebox_array = array();
    //        kuroi: commented out to avoid starting list with text scrolling list entries such as "reset" and "please select"
    //    if (!isset($_GET['manufacturers_id']) || $_GET['manufacturers_id'] == '' ) {
    //      $manufacturer_sidebox_array[] = array('id' => '', 'text' => PULL_DOWN_ALL);
    //    } else {
    //      $manufacturer_sidebox_array[] = array('id' => '', 'text' => PULL_DOWN_MANUFACTURERS);
    //    }

        
    while (!$manufacturer_sidebox->EOF) {
          
    $manufacturer_sidebox_name = ((strlen($manufacturer_sidebox->fields['manufacturers_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN) ? substr($manufacturer_sidebox->fields['manufacturers_name'], 0MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' $manufacturer_sidebox->fields['manufacturers_name']);
          
    $manufacturer_sidebox_image $manufacturer_sidebox->fields['manufacturers_image'];
          
    $manufacturer_sidebox_array[] =
            array(
    'id' => $manufacturer_sidebox->fields['manufacturers_id'],
                  
    'text' => DISPLAY_MANUFACTURERS_IMAGES ?
                    
    zen_image(DIR_WS_IMAGES $manufacturer_sidebox_image$manufacturer_sidebox_name) :
                    
    $manufacturer_sidebox_name);
          
    $manufacturer_sidebox->MoveNext();
        }
          
      }
    // $show_manufacturers
                    
    for ($i=0;$i<sizeof($manufacturer_sidebox_array);$i++) {
          
    $content '';
          
    $content .= '<li ><a class="hide" href="' zen_href_link(FILENAME_DEFAULT'manufacturers_id=' $manufacturer_sidebox_array[$i]['id']) . '">';
          
    $content .= $manufacturer_sidebox_array[$i]['text'];
          
    $content .= '</a></li>' "\n";
          echo 
    $content;
        }
    ?>
                </ul>
            </div>
                </div>
            </li><!-- eof shop by brand    -->
    Showing this using [CODE][/CODE] tags instead of [PHP][/PHP] so that I can use my own color coding changing:
    Code:
         </li><!-- eof quick links -->
            
    
         <li class="manufacturers-li"><a href="<?php echo zen_href_link(FILENAME_DEFAULT); ?>" class="drop"><?php echo HEADER_TITLE_MANUFACTURERS; ?></a><!--bof shop by brand   -->
                <div class="dropdown_1column">
                    <div class="col_1 firstcolumn">
    
                  <ul >
                   <?php
            
      $show_manufacturers= true;
    
    // for large lists of manufacturers uncomment this section
    /*
      if (($_GET['main_page']==FILENAME_DEFAULT and ($_GET['cPath'] == '' or $_GET['cPath'] == 0)) or  ($request_type == 'SSL')) {
        $show_manufacturers= false;
      } else {
        $show_manufacturers= true;
      }
    */
    
    // Set to true to display manufacturers images in place of names
    define('DISPLAY_MANUFACTURERS_IMAGES',false);
    
    if ($show_manufacturers) {
    
    // only check products if requested - this may slow down the processing of the manufacturers sidebox
      if (PRODUCTS_MANUFACTURERS_STATUS == '1') {
        $manufacturer_sidebox_query = "select distinct m.manufacturers_id, m.manufacturers_name, m.manufacturers_image
                                from " . TABLE_MANUFACTURERS . " m
                                left join " . TABLE_PRODUCTS . " p on m.manufacturers_id = p.manufacturers_id
                                where m.manufacturers_id = p.manufacturers_id and p.products_status= 1
                                order by manufacturers_name";
      } else {
        $manufacturer_sidebox_query = "select m.manufacturers_id, m.manufacturers_name, m.manufacturers_image
                                from " . TABLE_MANUFACTURERS . " m
                                order by manufacturers_name";
      }
    
      $manufacturer_sidebox = $db->Execute($manufacturer_sidebox_query);
    
      if ($manufacturer_sidebox->RecordCount()>0) {
        $number_of_rows = $manufacturer_sidebox->RecordCount()+1;
    
    // Display a list
        $manufacturer_sidebox_array = array(); // This is being copied "up" to outside this nexted "if" (if show... if >0).
    //        kuroi: commented out to avoid starting list with text scrolling list entries such as "reset" and "please select"
    //    if (!isset($_GET['manufacturers_id']) || $_GET['manufacturers_id'] == '' ) {
    //      $manufacturer_sidebox_array[] = array('id' => '', 'text' => PULL_DOWN_ALL);
    //    } else {
    //      $manufacturer_sidebox_array[] = array('id' => '', 'text' => PULL_DOWN_MANUFACTURERS);
    //    }
    
        while (!$manufacturer_sidebox->EOF) {
          $manufacturer_sidebox_name = ((strlen($manufacturer_sidebox->fields['manufacturers_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN) ? substr($manufacturer_sidebox->fields['manufacturers_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' : $manufacturer_sidebox->fields['manufacturers_name']);
          $manufacturer_sidebox_image = $manufacturer_sidebox->fields['manufacturers_image'];
          $manufacturer_sidebox_array[] =
            array('id' => $manufacturer_sidebox->fields['manufacturers_id'],
                  'text' => DISPLAY_MANUFACTURERS_IMAGES ?
                    zen_image(DIR_WS_IMAGES . $manufacturer_sidebox_image, $manufacturer_sidebox_name) :
                    $manufacturer_sidebox_name);
          $manufacturer_sidebox->MoveNext();
        }
          
      }
    } // $show_manufacturers
                    for ($i=0;$i<sizeof($manufacturer_sidebox_array);$i++) {
          $content = '';
          $content .= '<li ><a class="hide" href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturer_sidebox_array[$i]['id']) . '">';
          $content .= $manufacturer_sidebox_array[$i]['text'];
          $content .= '</a></li>' . "\n";
          echo $content;
        }
    ?>
                </ul>
            </div>
                </div>
            </li><!-- eof shop by brand    -->
    TO:
    Code:
         </li><!-- eof quick links -->
            
    
         <li class="manufacturers-li"><a href="<?php echo zen_href_link(FILENAME_DEFAULT); ?>" class="drop"><?php echo HEADER_TITLE_MANUFACTURERS; ?></a><!--bof shop by brand   -->
                <div class="dropdown_1column">
                    <div class="col_1 firstcolumn">
    
                  <ul >
                   <?php
            
      $show_manufacturers= true;
    
    // for large lists of manufacturers uncomment this section
    /*
      if (($_GET['main_page']==FILENAME_DEFAULT and ($_GET['cPath'] == '' or $_GET['cPath'] == 0)) or  ($request_type == 'SSL')) {
        $show_manufacturers= false;
      } else {
        $show_manufacturers= true;
      }
    */
    
    // Set to true to display manufacturers images in place of names
    define('DISPLAY_MANUFACTURERS_IMAGES',false);
    
    if (empty($manufacturer_sidebox_array)) { // Allows value to be set ahead of executing this code.
      $manufacturer_sidebox_array = array(); // This ensures that the variable is always declared as an array even if not showing manufacturers.
    }
    
    if ($show_manufacturers) {
    
    // only check products if requested - this may slow down the processing of the manufacturers sidebox
      if (PRODUCTS_MANUFACTURERS_STATUS == '1') {
        $manufacturer_sidebox_query = "select distinct m.manufacturers_id, m.manufacturers_name, m.manufacturers_image
                                from " . TABLE_MANUFACTURERS . " m
                                left join " . TABLE_PRODUCTS . " p on m.manufacturers_id = p.manufacturers_id
                                where m.manufacturers_id = p.manufacturers_id and p.products_status= 1
                                order by manufacturers_name";
      } else {
        $manufacturer_sidebox_query = "select m.manufacturers_id, m.manufacturers_name, m.manufacturers_image
                                from " . TABLE_MANUFACTURERS . " m
                                order by manufacturers_name";
      }
    
      $manufacturer_sidebox = $db->Execute($manufacturer_sidebox_query);
    
      if ($manufacturer_sidebox->RecordCount()>0) {
        $number_of_rows = $manufacturer_sidebox->RecordCount()+1;
    
    // Display a list
        $manufacturer_sidebox_array = array();
    //        kuroi: commented out to avoid starting list with text scrolling list entries such as "reset" and "please select"
    //    if (!isset($_GET['manufacturers_id']) || $_GET['manufacturers_id'] == '' ) {
    //      $manufacturer_sidebox_array[] = array('id' => '', 'text' => PULL_DOWN_ALL);
    //    } else {
    //      $manufacturer_sidebox_array[] = array('id' => '', 'text' => PULL_DOWN_MANUFACTURERS);
    //    }
    
        while (!$manufacturer_sidebox->EOF) {
          $manufacturer_sidebox_name = ((strlen($manufacturer_sidebox->fields['manufacturers_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN) ? substr($manufacturer_sidebox->fields['manufacturers_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' : $manufacturer_sidebox->fields['manufacturers_name']);
          $manufacturer_sidebox_image = $manufacturer_sidebox->fields['manufacturers_image'];
          $manufacturer_sidebox_array[] =
            array('id' => $manufacturer_sidebox->fields['manufacturers_id'],
                  'text' => DISPLAY_MANUFACTURERS_IMAGES ?
                    zen_image(DIR_WS_IMAGES . $manufacturer_sidebox_image, $manufacturer_sidebox_name) :
                    $manufacturer_sidebox_name);
          $manufacturer_sidebox->MoveNext();
        }
          
      }
    } // $show_manufacturers
                    for ($i=0;$i<sizeof($manufacturer_sidebox_array);$i++) {
          $content = '';
          $content .= '<li ><a class="hide" href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturer_sidebox_array[$i]['id']) . '">';
          $content .= $manufacturer_sidebox_array[$i]['text'];
          $content .= '</a></li>' . "\n";
          echo $content;
        }
    ?>
                </ul>
            </div>
                </div>
            </li><!-- eof shop by brand    -->
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  6. #6
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,589
    Plugin Contributions
    30

    Default Re: Upgrade to PHP 7.2 error

    As a general rule for any php version complaining like this, they have already been fixed at some point: my site is on php 8.13.
    You need to look at the development versions of the same file on GitHub, most files are mostly the same.
    Steve
    github.com/torvista: Spanish Language Pack, Google reCaptcha, Structured Data, Multiple Copy-Move-Delete, Image Checker, BackupMySQL Admin/Auto...

  7. #7
    Join Date
    Apr 2011
    Posts
    383
    Plugin Contributions
    0

    Default Re: Upgrade to PHP 7.2 error

    Quote Originally Posted by mc12345678 View Post
    Showing this using [CODE][/CODE] tags instead of [PHP][/PHP] so that I can use my own color coding changing:
    Code:
         </li><!-- eof quick links -->
            
    
         <li class="manufacturers-li"><a href="<?php echo zen_href_link(FILENAME_DEFAULT); ?>" class="drop"><?php echo HEADER_TITLE_MANUFACTURERS; ?></a><!--bof shop by brand   -->
                <div class="dropdown_1column">
                    <div class="col_1 firstcolumn">
    
                  <ul >
                   <?php
            
      $show_manufacturers= true;
    
    // for large lists of manufacturers uncomment this section
    /*
      if (($_GET['main_page']==FILENAME_DEFAULT and ($_GET['cPath'] == '' or $_GET['cPath'] == 0)) or  ($request_type == 'SSL')) {
        $show_manufacturers= false;
      } else {
        $show_manufacturers= true;
      }
    */
    
    // Set to true to display manufacturers images in place of names
    define('DISPLAY_MANUFACTURERS_IMAGES',false);
    
    if ($show_manufacturers) {
    
    // only check products if requested - this may slow down the processing of the manufacturers sidebox
      if (PRODUCTS_MANUFACTURERS_STATUS == '1') {
        $manufacturer_sidebox_query = "select distinct m.manufacturers_id, m.manufacturers_name, m.manufacturers_image
                                from " . TABLE_MANUFACTURERS . " m
                                left join " . TABLE_PRODUCTS . " p on m.manufacturers_id = p.manufacturers_id
                                where m.manufacturers_id = p.manufacturers_id and p.products_status= 1
                                order by manufacturers_name";
      } else {
        $manufacturer_sidebox_query = "select m.manufacturers_id, m.manufacturers_name, m.manufacturers_image
                                from " . TABLE_MANUFACTURERS . " m
                                order by manufacturers_name";
      }
    
      $manufacturer_sidebox = $db->Execute($manufacturer_sidebox_query);
    
      if ($manufacturer_sidebox->RecordCount()>0) {
        $number_of_rows = $manufacturer_sidebox->RecordCount()+1;
    
    // Display a list
        $manufacturer_sidebox_array = array(); // This is being copied "up" to outside this nexted "if" (if show... if >0).
    //        kuroi: commented out to avoid starting list with text scrolling list entries such as "reset" and "please select"
    //    if (!isset($_GET['manufacturers_id']) || $_GET['manufacturers_id'] == '' ) {
    //      $manufacturer_sidebox_array[] = array('id' => '', 'text' => PULL_DOWN_ALL);
    //    } else {
    //      $manufacturer_sidebox_array[] = array('id' => '', 'text' => PULL_DOWN_MANUFACTURERS);
    //    }
    
        while (!$manufacturer_sidebox->EOF) {
          $manufacturer_sidebox_name = ((strlen($manufacturer_sidebox->fields['manufacturers_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN) ? substr($manufacturer_sidebox->fields['manufacturers_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' : $manufacturer_sidebox->fields['manufacturers_name']);
          $manufacturer_sidebox_image = $manufacturer_sidebox->fields['manufacturers_image'];
          $manufacturer_sidebox_array[] =
            array('id' => $manufacturer_sidebox->fields['manufacturers_id'],
                  'text' => DISPLAY_MANUFACTURERS_IMAGES ?
                    zen_image(DIR_WS_IMAGES . $manufacturer_sidebox_image, $manufacturer_sidebox_name) :
                    $manufacturer_sidebox_name);
          $manufacturer_sidebox->MoveNext();
        }
          
      }
    } // $show_manufacturers
                    for ($i=0;$i<sizeof($manufacturer_sidebox_array);$i++) {
          $content = '';
          $content .= '<li ><a class="hide" href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturer_sidebox_array[$i]['id']) . '">';
          $content .= $manufacturer_sidebox_array[$i]['text'];
          $content .= '</a></li>' . "\n";
          echo $content;
        }
    ?>
                </ul>
            </div>
                </div>
            </li><!-- eof shop by brand    -->
    TO:
    Code:
         </li><!-- eof quick links -->
            
    
         <li class="manufacturers-li"><a href="<?php echo zen_href_link(FILENAME_DEFAULT); ?>" class="drop"><?php echo HEADER_TITLE_MANUFACTURERS; ?></a><!--bof shop by brand   -->
                <div class="dropdown_1column">
                    <div class="col_1 firstcolumn">
    
                  <ul >
                   <?php
            
      $show_manufacturers= true;
    
    // for large lists of manufacturers uncomment this section
    /*
      if (($_GET['main_page']==FILENAME_DEFAULT and ($_GET['cPath'] == '' or $_GET['cPath'] == 0)) or  ($request_type == 'SSL')) {
        $show_manufacturers= false;
      } else {
        $show_manufacturers= true;
      }
    */
    
    // Set to true to display manufacturers images in place of names
    define('DISPLAY_MANUFACTURERS_IMAGES',false);
    
    if (empty($manufacturer_sidebox_array)) { // Allows value to be set ahead of executing this code.
      $manufacturer_sidebox_array = array(); // This ensures that the variable is always declared as an array even if not showing manufacturers.
    }
    
    if ($show_manufacturers) {
    
    // only check products if requested - this may slow down the processing of the manufacturers sidebox
      if (PRODUCTS_MANUFACTURERS_STATUS == '1') {
        $manufacturer_sidebox_query = "select distinct m.manufacturers_id, m.manufacturers_name, m.manufacturers_image
                                from " . TABLE_MANUFACTURERS . " m
                                left join " . TABLE_PRODUCTS . " p on m.manufacturers_id = p.manufacturers_id
                                where m.manufacturers_id = p.manufacturers_id and p.products_status= 1
                                order by manufacturers_name";
      } else {
        $manufacturer_sidebox_query = "select m.manufacturers_id, m.manufacturers_name, m.manufacturers_image
                                from " . TABLE_MANUFACTURERS . " m
                                order by manufacturers_name";
      }
    
      $manufacturer_sidebox = $db->Execute($manufacturer_sidebox_query);
    
      if ($manufacturer_sidebox->RecordCount()>0) {
        $number_of_rows = $manufacturer_sidebox->RecordCount()+1;
    
    // Display a list
        $manufacturer_sidebox_array = array();
    //        kuroi: commented out to avoid starting list with text scrolling list entries such as "reset" and "please select"
    //    if (!isset($_GET['manufacturers_id']) || $_GET['manufacturers_id'] == '' ) {
    //      $manufacturer_sidebox_array[] = array('id' => '', 'text' => PULL_DOWN_ALL);
    //    } else {
    //      $manufacturer_sidebox_array[] = array('id' => '', 'text' => PULL_DOWN_MANUFACTURERS);
    //    }
    
        while (!$manufacturer_sidebox->EOF) {
          $manufacturer_sidebox_name = ((strlen($manufacturer_sidebox->fields['manufacturers_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN) ? substr($manufacturer_sidebox->fields['manufacturers_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' : $manufacturer_sidebox->fields['manufacturers_name']);
          $manufacturer_sidebox_image = $manufacturer_sidebox->fields['manufacturers_image'];
          $manufacturer_sidebox_array[] =
            array('id' => $manufacturer_sidebox->fields['manufacturers_id'],
                  'text' => DISPLAY_MANUFACTURERS_IMAGES ?
                    zen_image(DIR_WS_IMAGES . $manufacturer_sidebox_image, $manufacturer_sidebox_name) :
                    $manufacturer_sidebox_name);
          $manufacturer_sidebox->MoveNext();
        }
          
      }
    } // $show_manufacturers
                    for ($i=0;$i<sizeof($manufacturer_sidebox_array);$i++) {
          $content = '';
          $content .= '<li ><a class="hide" href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturer_sidebox_array[$i]['id']) . '">';
          $content .= $manufacturer_sidebox_array[$i]['text'];
          $content .= '</a></li>' . "\n";
          echo $content;
        }
    ?>
                </ul>
            </div>
                </div>
            </li><!-- eof shop by brand    -->

    Thank you. It worked perfect.

  8. #8
    Join Date
    Apr 2011
    Posts
    383
    Plugin Contributions
    0

    Default Re: Upgrade to PHP 7.2 error

    Quote Originally Posted by torvista View Post
    As a general rule for any php version complaining like this, they have already been fixed at some point: my site is on php 8.13.
    You need to look at the development versions of the same file on GitHub, most files are mostly the same.
    Thanks for the tip. My site is using some old plugin which haven't been updated for awhile in the plugin section.

    I am slowly getting the habit of going on github instead but not all the plugin are easy to find.

 

 

Similar Threads

  1. Replies: 7
    Last Post: 22 Dec 2019, 07:07 PM
  2. v156 Upgrade to 1.5.6b PHP Fatal error PayPal IPN
    By gwynwyffar in forum Upgrading to 1.5.x
    Replies: 1
    Last Post: 7 Jun 2019, 03:42 PM
  3. v155 php 7.0 upgrade to 7.1 display error
    By targetmarts in forum General Questions
    Replies: 3
    Last Post: 5 Mar 2018, 01:39 PM
  4. PHP 5.3 forced a 1.39h upgrade Admin error
    By kneenan in forum Upgrading from 1.3.x to 1.3.9
    Replies: 2
    Last Post: 30 Aug 2011, 05:51 AM
  5. ver. 1.3.6 coupon_admin.php error (didn't upgrade all files properly)
    By covone in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 3
    Last Post: 28 Oct 2006, 06:56 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR