mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 20:42:22 +02:00
MDL-50177 completion: Also accepting cm integer strings
This commit is contained in:
parent
753d681076
commit
729a6c5617
@ -53,8 +53,8 @@ class condition extends \core_availability\condition {
|
||||
*/
|
||||
public function __construct($structure) {
|
||||
// Get cmid.
|
||||
if (isset($structure->cm) && is_int($structure->cm)) {
|
||||
$this->cmid = $structure->cm;
|
||||
if (isset($structure->cm) && is_number($structure->cm)) {
|
||||
$this->cmid = (int)$structure->cm;
|
||||
} else {
|
||||
throw new \coding_exception('Missing or invalid ->cm for completion condition');
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user