PHP 8 issue
esurov opened this issue · comments
Gene Surov commented
On our attempt to migrate to PHP8 we found out an issue with DB\SQL\Mapper
:
It throws an error Undefined array key 0
on fatfree/lib/db/sql/mapper.php:230
:
list($filter)=$filter;
Here's the complete code snippet:
class mobile_device extends OW_Object {
static protected $tableName = 'mobile_device';
static protected $primaryKey = 'mobile_device_id';
public function loadToSession() {
$modelKey = 'model';
$myLookupTable = static::getMapper();
$records = $myLookupTable->select($modelKey, [], array('order' => $modelKey, 'group' => $modelKey));
foreach($records as $record) {
$_SESSION['mobile_device_unique'][$record->$modelKey] = $record->$modelKey;
}
}
}
Christian Knuth commented
The 2nd parameter of select is the $filter.. it should be set to NULL instead of an empty array.
Duplicate of #1257