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.
I'm unsure of the logic behind this, but it confused me so thought I'd raise a discussion to establish why (and document for future folk seeing the same).
uc_product.module has the following code near the head of the function uc_product_form()
$location = array();
$location[] = menu_get_item('admin');
$location[] = menu_get_item('admin/store');
$location[] = menu_get_item('admin/store/products');
$location[] = menu_get_item('admin/store/settings/products');
$breadcrumb = array(l('Home', ''));
foreach ($location as $item) {
$breadcrumb[] = l($item['title'], $item['path']);
}
drupal_set_breadcrumb($breadcrumb);
This changes the node create form breadcrumbs to take people "back" to the product settings screen.
Depending on store settings, these paths may not be accessible to the user viewing the breadcrumbs.
Does anyone understand this behaviour well enough to explain it?
Related: #719996: Store Admin Breadcrumb Is Displayed To Sellers
Comments
Comment #1
longwaveThis code has been present since 5.x-1.x-alpha7 but I can't see why it is useful, and as noted it displays links to users who may not have permission to visit them. Bumping for possible discussion, but if there are no complaints I think it should be removed from both 6.x and 7.x.
Comment #2
longwaveRemoved from both branches.