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
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | missing_home_breadcrumb_1.patch | 659 bytes | edmund.kwok |
| #7 | missing_home_breadcrumb.patch | 632 bytes | edmund.kwok |
| #2 | poll_patch.patch | 581 bytes | Steve Dondley |
Comments
Comment #1
ankur commentedsorry, the title should really read "....q=poll link only present if block enabled".
Comment #2
Steve Dondley commentedHere's a patch that adds "Home" to the q=poll page.
Comment #3
Steve Dondley commentedComment #4
Steven commentedIf there is no easy way to get to the polls list, perhaps a suggested menu item should be added.
Comment #5
drummIt 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.
Comment #6
killes@www.drop.org commentedDoes this still apply?
Comment #7
edmund.kwok commentedIssue 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 :-)
Comment #8
edmund.kwok commentedOh 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.
Comment #9
edmund.kwok commentedIssue stll applies in HEAD, rerolling from root.
Comment #10
edmund.kwok commentedImproving title of issue; might affect other modules also.
Comment #11
ChrisKennedy commentedI tested this in cvs but it doesn't occur anymore.
Comment #12
(not verified) commented