List of operating systems is outdated
In classes/guest.php there is a list of operating systems
protected function getOs($userAgent)
{
$osArray = [
'Windows 8' => 'Windows NT 6.2',
'Windows 7' => 'Windows NT 6.1',
'Windows Vista' => 'Windows NT 6.0',
'Windows XP' => 'Windows NT 5',
'MacOsX' => 'Mac OS X',
'Android' => 'Android',
'Linux' => 'X11',
];
foreach ($osArray as $k => $value) {
if (strstr($userAgent, $value)) {
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(
(new DbQuery())
->select('`id_operating_system`')
->from('operating_system', 'os')
->where('os.`name` = \''.pSQL($k).'\'')
);
return $result['id_operating_system']; /* this is line 216 */
}
}
The absence of modern operating systems has as a result that this function produces lots of errors of the type
PHP Notice: Trying to access array offset on value of type bool in /home/public/sites/www.website.com/classes/Guest.php on line 216
Your PHP notice issue will be probably caused by data inconsistency. Table operating_system should contain rows for all the $osArray: https://github.com/thirtybees/thirtybees/blob/9e8002f786ae10e0b36187871ea70245bb748f82/install-dev/data/xml/operating_system.xml.
If database table contained these rows, then the row would be found, and $result would be array. I believe that in your case the database table is empty.
Anyway, your complaint is totally valid -- the $osArray should be updated to reflect current operating systems.
In my rather old shop this table indeed contained only four rows.
In Prestashop 1.7.8 it looks so:
protected function getOs($userAgent) { $osArray = [ 'Windows 10' => 'Windows NT 10', 'Windows 8.1' => 'Windows NT 6.3', 'Windows 8' => 'Windows NT 6.2', 'Windows 7' => 'Windows NT 6.1', 'Windows Vista' => 'Windows NT 6.0', 'Windows XP' => 'Windows NT 5', 'MacOsX' => 'Mac OS X', 'Android' => 'Android', 'Linux' => 'X11', ];