I waste all day fighting with drupal 7 hook_menu, days ago all was working when i create new modules, new menu entries, etc.
Im developing a cron, depends of 1 parameter, its generate a file to output, or read other file (input).
I trying to define a simple url to test the cron, and when i put ...lec_profile_cron in the brosers, it works, but if try ....companies_cron/1 or just companies_cron o other name y put at $items['route'], its doesnt works.
I tried to clean cache, memcached, use drush rr, all and dont understand what is happen.
I tried a lot of combinations and examples like the helloword_hello menu option in a new module i create called helloworld, and its returns 404 not found.
// CRON TEST
$items['companies_cron/%out'] = array(
'title' => t('Test cron'),
'page callback' => 'lec_profile_cron',
'page arguments' => array(1),
'access arguments' => array('administer lec profile configuration')
);
function lec_profile_cron($out)
{
// CRON OUT
if ($out == 1) {
//do stuff
} else {
//CRON IN
}
}
Maybe was a stupid thing, but i cant find...
Ty in advice.
According to the documentation I think this will work better. You dont need th %out for args in your $items and I also think you missing the trailing comma on 'access arguments' which I've added and also returning something.