I have developed several node types for an application, and in one of them "delete" menu doesn't appear when viewing it; first I thought it could be a permission problem, so I wrote: function hook_access($op, $node) { return true; //debug ... } but nothing happend; then I tried with user 1 and it is the same (I cleared all cache tables using phpmyadmin). besides hook_delete and hook_access is there anything else necessary for the menu to appear? From the administrative interface I can delete the node without problems. thanks -- *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.
If you are using Drupal 6, then there are now separate permissions for creating, editing and deleting... check your permissions if this is the case On Thu, Aug 21, 2008 at 7:16 AM, Lluís <enboig@gmail.com> wrote:
I have developed several node types for an application, and in one of them "delete" menu doesn't appear when viewing it; first I thought it could be a permission problem, so I wrote: function hook_access($op, $node) { return true; //debug ... }
but nothing happend; then I tried with user 1 and it is the same (I cleared all cache tables using phpmyadmin). besides hook_delete and hook_access is there anything else necessary for the menu to appear? From the administrative interface I can delete the node without problems.
thanks
-- *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.
I am using drupal 5; I just updated the core to be sure I didn't change anything there, but the problem continues. It afect other node-types also. As I can delete nodes using the administrative interface, may it be a menu problem? On Thu, Aug 21, 2008 at 1:00 PM, Victor Kane <victorkane@gmail.com> wrote:
If you are using Drupal 6, then there are now separate permissions for creating, editing and deleting... check your permissions if this is the case
On Thu, Aug 21, 2008 at 7:16 AM, Lluís <enboig@gmail.com> wrote:
I have developed several node types for an application, and in one of them "delete" menu doesn't appear when viewing it; first I thought it could be a permission problem, so I wrote: function hook_access($op, $node) { return true; //debug ... }
but nothing happend; then I tried with user 1 and it is the same (I cleared all cache tables using phpmyadmin). besides hook_delete and hook_access is there anything else necessary for the menu to appear? From the administrative interface I can delete the node without problems.
thanks
-- *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.
-- *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.
Sometimes the permissions get very complicated in terms of filters, ownership, edit own, edit, etc. One thing I sometimes do is make a backup of the database, then give the non-admin user all node, filter, etc. permissions, and then start taking off these permissions one by one to see what's going on. Another source of problems is if you have been using any kind of access module which you have then disabled, then you will want to go to Administer > Content management > Post settings and hit the rebuild permissions button. Victor Kane http://awebfactory.com.ar On Thu, Aug 21, 2008 at 8:05 AM, Lluís <enboig@gmail.com> wrote:
I am using drupal 5; I just updated the core to be sure I didn't change anything there, but the problem continues. It afect other node-types also. As I can delete nodes using the administrative interface, may it be a menu problem?
On Thu, Aug 21, 2008 at 1:00 PM, Victor Kane <victorkane@gmail.com> wrote:
If you are using Drupal 6, then there are now separate permissions for creating, editing and deleting... check your permissions if this is the case
On Thu, Aug 21, 2008 at 7:16 AM, Lluís <enboig@gmail.com> wrote:
I have developed several node types for an application, and in one of them "delete" menu doesn't appear when viewing it; first I thought it could be a permission problem, so I wrote: function hook_access($op, $node) { return true; //debug ... }
but nothing happend; then I tried with user 1 and it is the same (I cleared all cache tables using phpmyadmin). besides hook_delete and hook_access is there anything else necessary for the menu to appear? From the administrative interface I can delete the node without problems.
thanks
-- *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.
-- *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.
I have programed my own premission system; but it shouldn't be the issue here, when de user goes to 'node/2175' appear 'view' and 'edit' not 'delete', but user can go manually to 'node/2175/delete' and delete the node with no problems. On Thu, Aug 21, 2008 at 1:10 PM, Victor Kane <victorkane@gmail.com> wrote:
Sometimes the permissions get very complicated in terms of filters, ownership, edit own, edit, etc.
One thing I sometimes do is make a backup of the database, then give the non-admin user all node, filter, etc. permissions, and then start taking off these permissions one by one to see what's going on.
Another source of problems is if you have been using any kind of access module which you have then disabled, then you will want to go to Administer > Content management > Post settings and hit the rebuild permissions button.
Victor Kane http://awebfactory.com.ar
On Thu, Aug 21, 2008 at 8:05 AM, Lluís <enboig@gmail.com> wrote:
I am using drupal 5; I just updated the core to be sure I didn't change anything there, but the problem continues. It afect other node-types also. As I can delete nodes using the administrative interface, may it be a menu problem?
On Thu, Aug 21, 2008 at 1:00 PM, Victor Kane <victorkane@gmail.com> wrote:
If you are using Drupal 6, then there are now separate permissions for creating, editing and deleting... check your permissions if this is the case
On Thu, Aug 21, 2008 at 7:16 AM, Lluís <enboig@gmail.com> wrote:
I have developed several node types for an application, and in one of them "delete" menu doesn't appear when viewing it; first I thought it could be a permission problem, so I wrote: function hook_access($op, $node) { return true; //debug ... }
but nothing happend; then I tried with user 1 and it is the same (I cleared all cache tables using phpmyadmin). besides hook_delete and hook_access is there anything else necessary for the menu to appear? From the administrative interface I can delete the node without problems.
thanks
-- *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.
-- *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.
-- *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.
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); ........ I checked for a concrete "projecte" node type, and going though 'comptacau/projectes/_nid_' (my menu) shows "delete" option, but not through 'node/_nid_' Can this affect menu system in any way? Some node types have this custom menus, and some not; but all of the have delete option hidden. On Thu, Aug 21, 2008 at 1:23 PM, Lluís <enboig@gmail.com> wrote:
I have programed my own premission system; but it shouldn't be the issue here, when de user goes to 'node/2175' appear 'view' and 'edit' not 'delete', but user can go manually to 'node/2175/delete' and delete the node with no problems.
On Thu, Aug 21, 2008 at 1:10 PM, Victor Kane <victorkane@gmail.com> wrote:
Sometimes the permissions get very complicated in terms of filters, ownership, edit own, edit, etc.
One thing I sometimes do is make a backup of the database, then give the non-admin user all node, filter, etc. permissions, and then start taking off these permissions one by one to see what's going on.
Another source of problems is if you have been using any kind of access module which you have then disabled, then you will want to go to Administer > Content management > Post settings and hit the rebuild permissions button.
Victor Kane http://awebfactory.com.ar
On Thu, Aug 21, 2008 at 8:05 AM, Lluís <enboig@gmail.com> wrote:
I am using drupal 5; I just updated the core to be sure I didn't change anything there, but the problem continues. It afect other node-types also. As I can delete nodes using the administrative interface, may it be a menu problem?
On Thu, Aug 21, 2008 at 1:00 PM, Victor Kane <victorkane@gmail.com> wrote:
If you are using Drupal 6, then there are now separate permissions for creating, editing and deleting... check your permissions if this is the case
On Thu, Aug 21, 2008 at 7:16 AM, Lluís <enboig@gmail.com> wrote:
I have developed several node types for an application, and in one of them "delete" menu doesn't appear when viewing it; first I thought it could be a permission problem, so I wrote: function hook_access($op, $node) { return true; //debug ... }
but nothing happend; then I tried with user 1 and it is the same (I cleared all cache tables using phpmyadmin). besides hook_delete and hook_access is there anything else necessary for the menu to appear? From the administrative interface I can delete the node without problems.
thanks
-- *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.
-- *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.
-- *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.
-- *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.
Quoting Lluís <enboig@gmail.com>:
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); ........
I checked for a concrete "projecte" node type, and going though 'comptacau/projectes/_nid_' (my menu) shows "delete" option, but not through 'node/_nid_'
Can this affect menu system in any way? Some node types have this custom menus, and some not; but all of the have delete option hidden.
In your module add a MENU_LOCAL_TASK item for 'node/' . arg(2) . '/delete'. The delete function currently is part of the edit page but there is no reason you can't added a MENU_LOCAL_TASK for it.
On Thu, Aug 21, 2008 at 1:23 PM, Lluís <enboig@gmail.com> wrote:
I have programed my own premission system; but it shouldn't be the issue here, when de user goes to 'node/2175' appear 'view' and 'edit' not 'delete', but user can go manually to 'node/2175/delete' and delete the node with no problems.
The manual path works because there is a MENU_CALLBACK item for it to make the Delete button on the edit page work. Earnie -- http://for-my-kids.com/ -- http://give-me-an-offer.com/
My fault, I was confused after working so long with my own modules; I didn't remember by default drupal just allow to delete nodes from the "edit" page; I thought there used to be a "delete" option when viewing the node. I added this option because while developing it is easier to delete test nodes. Thanks to everybody. On Thu, Aug 21, 2008 at 4:00 PM, Earnie Boyd <earnie@users.sourceforge.net> wrote:
Quoting Lluís <enboig@gmail.com>:
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); ........
I checked for a concrete "projecte" node type, and going though 'comptacau/projectes/_nid_' (my menu) shows "delete" option, but not through 'node/_nid_'
Can this affect menu system in any way? Some node types have this custom menus, and some not; but all of the have delete option hidden.
In your module add a MENU_LOCAL_TASK item for 'node/' . arg(2) . '/delete'. The delete function currently is part of the edit page but there is no reason you can't added a MENU_LOCAL_TASK for it.
On Thu, Aug 21, 2008 at 1:23 PM, Lluís <enboig@gmail.com> wrote:
I have programed my own premission system; but it shouldn't be the issue here, when de user goes to 'node/2175' appear 'view' and 'edit' not 'delete', but user can go manually to 'node/2175/delete' and delete the node with no problems.
The manual path works because there is a MENU_CALLBACK item for it to make the Delete button on the edit page work.
Earnie -- http://for-my-kids.com/ -- http://give-me-an-offer.com/
-- *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.
On Thu, Aug 21, 2008 at 7:28 AM, Lluís <enboig@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.
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@2bits.com> wrote:
On Thu, Aug 21, 2008 at 7:28 AM, Lluís <enboig@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.
participants (4)
-
Earnie Boyd -
Khalid Baheyeldin -
Lluís -
Victor Kane