Skip to content

Commit

Permalink
MDL-44436 context: Context IDs are forced to be int
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Frederic Massart committed Mar 4, 2014
1 parent 27ebbdd commit 7ffe38c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/accesslib.php
Expand Up @@ -5242,7 +5242,7 @@ public function getIterator() {
* @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;
Expand Down

0 comments on commit 7ffe38c

Please sign in to comment.