I was looking at a bug report submitted on civicspacelabs.org (http://civicspacelabs.org/home/node/7185).

The issue was about there being no breadcrumbs (there should be one: "Home") when you go to q=poll.

I was looking through the code and noticed that there is no obvious way to get to q=poll unless the poll block is enabled. I was thinking both problems could be solved by changing poll_menu() so that it changes the path for q=poll to q=admin/poll....? Of course, I know that perms for q=admin/poll would then have to fall under the 'create polls' permission, which would then make it useless for the 'older polls' link in the polls block, but I'm thinking there's no harm done in making this a seperate menu item in poll_menu.

If this is something that you think deserves a patch, I'm willing to submit one...

-Ankur

Comments

ankur’s picture

sorry, the title should really read "....q=poll link only present if block enabled".

Steve Dondley’s picture

StatusFileSize
new581 bytes

Here's a patch that adds "Home" to the q=poll page.

Steve Dondley’s picture

Steven’s picture

If there is no easy way to get to the polls list, perhaps a suggested menu item should be added.

drumm’s picture

Component: poll.module » menu system
Priority: Minor » Normal

If there is no easy way to get to the polls list, perhaps a suggested menu item should be added.

It is a suggested item. Tested on Drupal CVS from today.

I did a little bit of testing and determined that the breadcrumb acts normally if the menu item is enabled. However, if the menu item for the poll listing page is disabled the breadcrumb disappears.

I see this as probably a symptom of a deeper problem with the menu system. I currently don't have time to do this fun filled debugging today and probably not in the next two weeks.

killes@www.drop.org’s picture

Does this still apply?

edmund.kwok’s picture

Status: Active » Needs review
StatusFileSize
new632 bytes

Issue still applies in HEAD.

It seems that in menu.inc, menu_get_active_breadcrumb generates an array of breadcrumb, $links, with the first item being the 'Home' link. Before submitting $links, the last item will be removed as it is the title of the page requesting breadcrumb.

Like drumm discovered, it works well when the poll menu item is enabled. However, when the poll menu item is disabled, it is not in the list of breadcrumbs link. Only one item will be in the list; 'Home'. What happens? 'Home' is removed and thus, we have a blank list!

So this patch checks if count($links) is more than 1 before popping the last item off the list. Please review.

Are there other instances where the missing breadcrumb issue is present? Maybe this patch could help; if not, will do more digging :-)

edmund.kwok’s picture

Oh yeah, to reproduce, on a fresh install, the breadcrumb in q=poll should work fine. Enable and disable the menu item, and the breadcrumb will be missing.

edmund.kwok’s picture

StatusFileSize
new659 bytes

Issue stll applies in HEAD, rerolling from root.

edmund.kwok’s picture

Title: No q=poll breadcrumb; link to q=poll breadcrumb only present if block enabled » Missing 'Home' breadcrumb when menu item is disabled

Improving title of issue; might affect other modules also.

ChrisKennedy’s picture

Version: x.y.z » 5.x-dev
Status: Needs review » Fixed

I tested this in cvs but it doesn't occur anymore.

Anonymous’s picture

Status: Fixed » Closed (fixed)