[development] delete menu not appearing
Lluís
enboig at gmail.com
Thu Aug 21 14:33:48 UTC 2008
I already do node_load() earlier in the hook_menu(), thanks.
Now everythink works ok
On Thu, Aug 21, 2008 at 4:30 PM, Khalid Baheyeldin <kb at 2bits.com> wrote:
> 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.
>
--
*La vida és com una moneda, la pots gastar en el que vulguis però
només una vegada.
*La felicitat ha de ser compatible, compartible i cooperativa.
*Envellim quan els records superen les il·lusions.
*Als llocs desconeguts només s'hi arriba per camins desconeguts.
*Abans d'imprimir aquest missatge, pensa en el medi ambient.
More information about the development
mailing list