Issue Details (XML | Word | Printable)

Key: MDL-17111
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Jamie Pratt
Reporter: Oleg Sychev
Votes: 0
Watchers: 0
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

Using compare rule results in fatal error in getValidationScript function

Created: 03/Nov/08 08:48 PM   Updated: 05/Nov/08 09:48 PM
Return to search
Component/s: Forms Library
Affects Version/s: 1.9.2
Fix Version/s: None

Issue Links:
Dependency
 

Participants: Jamie Pratt and Oleg Sychev
Security Level: None
Difficulty: Easy
Affected Branches: MOODLE_19_STABLE


 Description  « Hide
Improving usability of question editing I found that code below result in error:

        $mform->addElement('text',$repeatname,$repeatstring,array('size'=>3));
       $mform->addElement('hidden', $repeathiddenname, $repeats);
        $mform->addRule($repeatname,null,'required',null,'client',true);
        $mform->addRule($repeatname,null,'nonzero',null,'client',true);
        //$mform->addRule(array($repeatname, $repeathiddenname),'You can\'t delete blanks','compare','>=','client',true);//uncommenting this line results in error in getValidationScript

If you uncomment the last line you receive
"Fatal error: Call to a member function on a non-object in z:\home\moodle\www\lib\formslib.php"
The line with error is "$onBlur = $element->getAttribute('onBlur');" in function getValidationScript

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Oleg Sychev made changes - 03/Nov/08 08:49 PM
Field Original Value New Value
Link This issue will help resolve MDL-17064 [ MDL-17064 ]
Oleg Sychev made changes - 05/Nov/08 02:38 AM
Difficulty Moderate Easy
Summary Using compare rule on hidden and no hidden elements results in fatal error in getValidationScript function Using compare rule results in fatal error in getValidationScript function