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.

Comments

KroKroDile’s picture

So, 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

jonathan1055’s picture

Status: Patch (to be ported) » Needs work

Hi,
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

KroKroDile’s picture

I 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

pfrenssen’s picture

Status: Needs work » Closed (works as designed)

This implements hook_node_validate(), and if you want to prevent this from running you can change it by using hook_module_implements_alter().