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:
Frederic Massart
2014-03-04 14:25:20 +08:00
parent 4c56e8210c
commit 890e85767e
+1 -1
View File
@@ -5085,7 +5085,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;