|
[
Permalink
| « Hide
]
Petr Skoda added a comment - 13/Nov/07 01:56 AM
Adding Tim...
The problem is this: Start with this code:
class a { class b extends a { Then change it to be: class a { but don't chage class b. Then you get errors/notices (missing second parameter) when you call b::go and it tries to call a::go. That is basically what you did when you changed the signature of the validate method in the base class moodleform, but not in any of the other methods that override it. By the way, following good object oriented design, every subclass of moodleform should start with $errors = parent::validate($data); instead of $errors = array(); That way, if we ever want a global validation hook we have got one. However, only the question type classes (and one or two others if I remember the results of my search) actually do this. The call to parent is a bit problematic because we expected mixed result true/array of errors. I think we did not call parent::validate() in main moodle codebase, so there should be no warnings.
I agree this was not a nice hack, unfortunately I did not find better solution yet. I will go through all of them and fix it. Working on this today... fix in cvs, thanks for cooperation
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||