Permalink
Browse files

Merge branch 'wip-MDL-27145-MOODLE_20_STABLE' of git://github.com/sam…

…hemelryk/moodle into MOODLE_20_STABLE
  • Loading branch information...
2 parents 50467e5 + 0f1fac1 commit 4de09258205a027b7af1bae23c6d743f9c10e214 @skodak skodak committed Apr 17, 2011
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/form/dateselector.php
@@ -166,7 +166,9 @@ function onQuickFormEvent($event, $arg, &$caller)
}
break;
case 'createElement':
- if($arg[2]['optional']) {
+ // Optional is an optional param, if its set we need to add a disabledIf rule.
+ // If its empty or not specified then its not an optional dateselector.
+ if (!empty($arg[2]['optional']) && !empty($arg[0])) {
$caller->disabledIf($arg[0], $arg[0].'[enabled]');
}
return parent::onQuickFormEvent($event, $arg, $caller);

0 comments on commit 4de0925

Please sign in to comment.