Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The code for the stock menu item is:
$items['node/%node/edit/uc-stock'] = array(
'title' => 'Stock',
'page callback' => 'drupal_get_form',
'page arguments' => array('uc_stock_edit_form', 1),
'access arguments' => array('administer product stock'),
'weight' => 10,
'type' => MENU_LOCAL_TASK,
'file' => 'uc_stock.admin.inc',
);
So, this will show up on any node regardless of whether it's a product or not. This needs to be fixed with a solution like the attribute module, which uses a custom access callback to determine whether or not a tab should be displayed for the node:
$items['node/%node/edit/uc-attributes'] = array(
'title' => 'Attributes',
'page callback' => 'drupal_get_form',
'page arguments' => array('uc_object_attributes_form', 1, 'product', 'overview'),
'access callback' => 'uc_attribute_product_access',
'access arguments' => array(1),
'type' => MENU_LOCAL_TASK,
'weight' => 1,
'file' => 'uc_attribute.admin.inc',
);
Comment | File | Size | Author |
---|---|---|---|
#1 | 434852.stock_perms.2.x.patch | 941 bytes | cha0s |
Comments
Comment #1
cha0s CreditAttribution: cha0s commentedPatch action. (Assuming product kits should be disallowed.)
Comment #2
Island Usurper CreditAttribution: Island Usurper commentedCool, cool.
Committed.