[development] delete menu not appearing

Khalid Baheyeldin kb at 2bits.com
Thu Aug 21 14:30:15 UTC 2008


On Thu, Aug 21, 2008 at 7:28 AM, Lluís <enboig at gmail.com> wrote:

> I forgot to say I added some "extra menu" to make me easy to customize
> the menus like:
>
> ........
>    $items[] = array('path' => 'comptacau/projectes/'. arg(2) .'/delete',
>                     'title' => t('Delete'),
>                     'callback' => 'drupal_get_form',
>                     'callback arguments' =>
> array('node_delete_confirm', $node),
>                     'access' => node_access('delete', $node),
>                     'weight' => 1,
>                     'type' => MENU_LOCAL_TASK);
> ........
>

node_access() expects a $node object to be passed in. You have not pasted
the entire hook_menu function from your module, but I if you do want to
check node_access(), you have to make sure you do node_load() beforehand, on
that path so node_access has something to check.


-- 
Khalid M. Baheyeldin
2bits.com, Inc.
http://2bits.com
Drupal optimization, development, customization and consulting.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20080821/7e06db46/attachment.htm 


More information about the development mailing list