mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
MDL-44436 context: Context IDs are forced to be int
The method context::insert_context_record() sets the context::$id to an int, while when we create an instance, the $id is often read from a DB $record object, and is a string. The ID should always be an int.
This commit is contained in:
parent
76e4de31cc
commit
cea24f4852
@ -5242,7 +5242,7 @@ abstract class context extends stdClass implements IteratorAggregate {
|
||||
* @param stdClass $record
|
||||
*/
|
||||
protected function __construct(stdClass $record) {
|
||||
$this->_id = $record->id;
|
||||
$this->_id = (int)$record->id;
|
||||
$this->_contextlevel = (int)$record->contextlevel;
|
||||
$this->_instanceid = $record->instanceid;
|
||||
$this->_path = $record->path;
|
||||
|
Loading…
x
Reference in New Issue
Block a user