I'm loading a datatable and its data into a panel, through ajax. Below is the link which can add the row(entry) to favorites. When I click the link, the jquery animation is executed properly but the hook_menu and it's callback function is not being executed. It looks like the hook_menu is not 'available'
This is the link
$link = array(
'#type' => 'link',
'#title' => t('Favorite'),
'#href' => 'favorite/' . $item->nid,
'#attributes' => array(
'class' => array('use-ajax', 'favorite_item_button'),
),
);
And this is the hook_menu
function favorite_item_menu() {
$items = array();
$items['favorite/%'] = array(
'title' => 'favorite item',
'page callback' => 'favorite_item',
'page arguments' => array(1),
'type' => MENU_CALLBACK,
);
return $items;
}
Do you see any mistakes? Am I doing something wrong, forgetting something?
Advice is much appreciated.
Edit: - no php error logs - no js error logs
tried: sitename.com/favorite/501 - got the error 'access denied'
http://domain.com/favorite/54