Skip to content

Commit

Permalink
MDL-50177 completion: Also accepting cm integer strings
Browse files Browse the repository at this point in the history
  • Loading branch information
David Monllao committed May 12, 2015
1 parent 753d681 commit 729a6c5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions availability/condition/completion/classes/condition.php
Expand Up @@ -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');
}
Expand Down

0 comments on commit 729a6c5

Please sign in to comment.