Permalink
Browse files

form-dateselector MDL-27145 Fixed up error resulting from incorrectly…

… required 'optional' argument on create event
  • Loading branch information...
1 parent eb9d692 commit 0f1fac1f1fd5657e6fdb99273f34c85d5138402d Sam Hemelryk committed Apr 12, 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 0f1fac1

Please sign in to comment.