Hi again,
_twitter_bootstrap_local_tasks is a cool function to theme the primary nav. However, it doesn't seem to want to take dynamic paths (paths with a % character).
I thought we take that into account. Especially useful for access functions.
Old
/**
* Get all primary tasks including subsets
*/
function _twitter_bootstrap_local_tasks($tabs = FALSE) {
...
$router_item = menu_get_item($element['#link']['path']);
with
New
$path_components = explode('/', $element['#link']['path']);
foreach($path_components as $position => $component) {
// See if % is the first character.
if (strpos($component, '%') === 0) {
$path_components[$position] = arg($position);
}
}
$path = implode('/', $path_components);
$router_item = menu_get_item($path);
Don't know if you want patches or not, but I'm happy to start contributing them if you are.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | Rerolling-Allow-_twitter_bootstrap_local_tasks-to-pr-1441614-8.patch | 1.2 KB | wundo |
| #3 | _twitter_bootstrap_local_tasks_fix-1441614-3.patch | 1.04 KB | kalabro |
| #3 | 2012-05-31_19-42-27.png | 9.22 KB | kalabro |
Comments
Comment #1
nagiek commentedOh yeah, and this fix doesn't handle
menu_default_local_taskpaths. Working on that.Comment #2
nagiek commentedWell, you can just do the same thing later on I guess.
to
I'm feeling the bloat, however. Is there an existing function to do this? Or should we be comparing ['href'] instead of ['path']?
Comment #3
kalabroThis bug also produces
...for node/%node, user/%user pages.
May be related to #1003788: PostgreSQL: PDOException:Invalid text representation when attempting to load an entity with a string or non-scalar ID.
I suggest a patch, which works for:
Drupal 7.14
Twitter bootstrap 7.x-2.x-dev
PostrgeSQL and MySQL
Comment #4
frankbaele commentedi will test it
Comment #5
Renee S commentedThis patch worked for me - I was getting some crazy entityAPI errors and finally tracked it down to this. I'm using OG and Spaces, with Persistent URL.
Edited to add: it's not quite fixed everything, I'm still getting an error with my Features Config page for Spaces OG... basically the theme doesn't render and I get an unstyled page that chops off after the menu. It has a form item that queries pURL to allow you to set the homepage path.
Comment #6
Renee S commentedThis also fails with Panels in-place editor.
Comment #7
skriptble commentedThis patch worked for me too. I was getting an annoying Entity API error with Invalid Data Value Given.
Comment #8
wundo commentedOk, I'm rerolling kalabro's patch from 3.
It's working for me.
Comment #9
vulfox commentedSo does it work or not? Renee says it doesn't don't you others have similar problems then?
Comment #10
wundo commentedVulfox, it does fixes the issue for dynamic paths, I'm unable to test it with panels, if there is still a issue when using panels please open a new issue, marking this one as fixed (I've just committed the fix to the main branch)
Comment #12
andregriffin commented