Running CS-Cart 4.15.1 with PHP 7.4 with OPCache and ACPu. LAMP server.
Just upgraded from 4.11.3 and looking at the PHP log.
I get this Warning a lot:
PHP Warning: Invalid argument supplied for foreach() in /public_html/app/functions/fn.common.php on line 8669
I get this Notice a lot:
PHP Notice: Trying to access array offset on value of type bool in /public_html/app/functions/fn.common.php on line 1956
Line 8669 is in this function:
function fn_sort_by_ids($items, $ids, $field = 'product_id') { $tmp = array();foreach ($items as $k => $item) { foreach ($ids as $key => $item_id) { if ($item_id == $item[$field]) { $tmp[$key] = $item; break; } } } ksort($tmp); return $tmp;
}
Line 1956 is in this function:
function fn_get_session_data($var = '') { /** @var \Tygh\Web\Session $session */ $session = Tygh::$app['session'];if (!$var) { $return = []; foreach ($session['settings'] as $name => $setting) { if (empty($setting['expiry']) || $setting['expiry'] > TIME) { $return[$name] = $setting['value']; } else { unset($session['settings'][$name]); $session->markSettingsAsRequiredToSave(); } }
For the life of me, I can't figure out what's wrong with either the data, or maybe it's a misconfigured block. It's driving me nuts. I optimized the database.
Any ideas? How do I debug this?