Closed esurov closed 2 years ago
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:
DB\SQL\Mapper
Undefined array key 0
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; } } }
The 2nd parameter of select is the $filter.. it should be set to NULL instead of an empty array. Duplicate of https://github.com/bcosca/fatfree/issues/1257
On our attempt to migrate to PHP8 we found out an issue with
DB\SQL\Mapper
: It throws an errorUndefined array key 0
onfatfree/lib/db/sql/mapper.php:230
:Here's the complete code snippet: