By ecstasy2 on
Hi there.
It is now more that 4 hours, i'm trying to make my module run hook_boot() without any success.
Here is the code:
function top50_boot() {
if($something){
menu_set_active_item('anti_cheat/');
}elseif ($valid){
$node = node_load($website['nid']);
}
}
What i actualy want to do is to execute a particular path once a condition is met, for this i am using : menu_set_active_item().
I tried using hook_init() and it ran well but i had few issues:
1. The form that i displayed on the page do not get validated at all.
2. The path on the prowser remain the same.
hoping someone help me quickly because i'm stuck.
Comments
I don't really understand
I don't really understand what you're trying to do, so I can't speak to your approach, but I think the function is probably running but that the if..else clauses never evaluate to TRUE. Unless you have other code in the function which defines $something and $valid which you haven't shown in the code you posted, the function will run but not do anything.
To see if that's the case, try the code below and then check your logs.
Thanks you. i've solved the
Thanks you.
i've solved the issues. Actually the problem was that when the module was activated the hook wasn't implemented.
When the module is activated there is a field 'bootstrap' that is populated if the module implement a hook like hook_boot.
So one solution is to disable and reenable the module.