Thank you very much for that. I didn't think of that. Looking at the logs the problem is in includes/modules/<template>/category_row.php
Line 40 is throwing "Cannot use string offset as an array" and I think this is down to using PHP7.2 (which I forgot to mention at the start, sorry). The unmodified category_row.php runs fine so it is provoked indirectly by the MultiSite mod:
PHP Code:
<?php
/**
* index category_row.php
*
* Prepares the content for displaying a category's sub-category listing in grid format.
* Once the data is prepared, it calls the standard tpl_list_box_content template for display.
*
* @package page
* @copyright Copyright 2003-2006 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: category_row.php 4084 2006-08-06 23:59:36Z drbyte $
*/
if (!defined('IS_ADMIN_FLAG')) {
die('Illegal Access');
}
$title = '';
$num_categories = $categories->RecordCount();
$row = 0;
$col = 0;
$list_box_contents = '';
if ($num_categories > 0) {
if ($num_categories < MAX_DISPLAY_CATEGORIES_PER_ROW || MAX_DISPLAY_CATEGORIES_PER_ROW == 0) {
$col_width = floor(100/$num_categories);
} else {
$col_width = floor(100/MAX_DISPLAY_CATEGORIES_PER_ROW);
}
while (!$categories->EOF) {
if (!$categories->fields['categories_image']) !$categories->fields['categories_image'] = 'pixel_trans.gif';
$cPath_new = zen_get_path($categories->fields['categories_id']);
// strip out 0_ from top level cats
// bof multi site module
$cPath_new = str_replace('='.CATEGORIES_ROOT.'_', '=', $cPath_new);
// eof multi site module
// $categories->fields['products_name'] = zen_get_products_name($categories->fields['products_id']);
$list_box_contents[$row][$col] = array('params' => 'class="categoryListBoxContents"' . ' ' . 'style="width:' . $col_width . '%;"',
'text' => '<a href="' . zen_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . zen_image(DIR_WS_IMAGES . $categories->fields['categories_image'], $categories->fields['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br />' . $categories->fields['categories_name'] . '</a>');
$col ++;
if ($col > (MAX_DISPLAY_CATEGORIES_PER_ROW -1)) {
$col = 0;
$row ++;
}
$categories->MoveNext();
}
}
?>
I got round that problem by replacing:
PHP Code:
$list_box_contents = '';
with:
PHP Code:
$list_box_contents = array();
Now the categories are showing up and no error is logged, although the formatting of the category rows is not quite as it appears in the nmodified responsive_classic template. However, when I click on a category containing products, the message is displayed "There are no products to list in this category." Also, one category contains only one product and clicking on that category usually goes directly to the product info. In this case, however, no info is shown and no error is logged.
There are still no error logs so I think I need to look through the code and see if I can find other PHP 7.2 "gotchas". Starting with product_listing.php.
I'll report back what I find. Thank you for your help.
Bookmarks