Affects Version/s: 1.9.4, 2.0
Fix Version/s: None
Component/s: Forms Library
Affected Branches:MOODLE_19_STABLE, MOODLE_20_STABLE
the combination of:
- no submit button
Here's the problem. I'm registering a non-submit submit button to add stuff to a page. Then, in data_after_definition, I detect whether that button was pressed, and do some extra stuff.
However, the extra stuff relies on the form being valid.... and the validation routine a) gets called AFTER data_after_definion and b) not at all when a no submit button was pressed.
I think this is BROKEN, however I guess current code relies in it.
So attached is a patch that
a) abstracts the moodle validation logic OUT of the is_validated function (which currently messes with data_after_definition stuff) and b, gives the new function a parameter to override the not calling validate when a no submit button was pressed.
It's a safe patch and doesn't break BC at all.