Hi,
I would overload the validate of the module "scheduler", but the validate was called by scheduler_node_validate() which is called by node_validate() in module "node".
Result, no possibilities to overload it.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | scheduler_overload_for_validate-1448114.patch | 4.38 KB | KroKroDile |
Comments
Comment #1
KroKroDile commentedSo, i made some changes in scheduler.module :
- in scheduler_form_alter => Add scheduler_form_validate in the validate tab
- replace scheduler_node_validate() by scheduler_form_validate() and modify some variables
Here the patch
Comment #2
jonathan1055 commentedHi,
This looks interesting, but I am not sure exactly what you want to do. Is it that scheduler should use a different function name so that other modules can modify the form values via a hook function?
I have had a quick look at your patch but it is not clear what you are attempting or why, so please could you explain a bit more. When you say overload do you mean override?
Jonathan
Comment #3
KroKroDile commentedI needed to allow users to pick dates prior to the current date.
The Scheduler module used node_validate() for form validation, a validation function whose behaviour was baked too deep inside the core to let me tweak the validation workflow the way i needed to.
To work around this, i issued a patch that calls scheduler_form_validation() function (instead of scheduler_node_validation()) for form validation. Once the patch is applied, we can alter the form and build custom validation code for it from an external module.
KroKroDile
Comment #4
pfrenssenThis implements hook_node_validate(), and if you want to prevent this from running you can change it by using hook_module_implements_alter().