Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
overlay.module
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
10 Jul 2010 at 06:35 UTC
Updated:
5 Feb 2012 at 06:01 UTC
Jump to comment: Most recent file
Comments
Comment #1
dodorama commentedI'm still experiencing this after a clean install. I raise the priority to critical
Comment #2
marcvangendFiling this under 7.x-dev so it will be seen by the right people.
Comment #3
dodorama commentedI'm trying to debug this.
What I saw is that Seven provides is own variables for primary and secondary tabs trough a preprocess function, while Bartik prints the $tabs variable provided by core. I tweaked bartik template.php adding this code from Seven
and then I printed both variables in page.tpl.php. Now I can see the secondary tabs (see screenshot) but primary tabs are duplicated. I don't have a clue of how the overlay works so I don't know exactly what's going on and what are overlay special requirements for themes. Is there any documentation?
Comment #4
aaronbaumanThis patch copies the way Garland does it, by settings $vars['tabs2'] for secondary local tasks.
Apparently Overlay module copies $vars['tabs'], then unsets it, but only renders the first element -- primary local tasks.
I think this is probably an issue with Overlay, but the patch to Bartik was easier.
If I can put together a patch for Overlay, I'll post it here and change the component on this issue.
Comment #5
aaronbaumanOK, I don't have enough info to roll a patch for Overlay.
The gist is this:
Overlay and Bartik make conflicting assumptions.
Overlay assumes that $vars['tabs'] will only ever contain primary local tasks.
Bartik assumes that it's save to use $vars['tabs'] for both primary and secondary local tasks.
I'm not sure which is the correct assumption - maybe there is a convention that I am unaware of.
Someone with more theme development experience should weigh in.
Comment #6
aaronbaumanThis is not critical -- tabs work fine without overlay.
Comment #7
dodorama commentedSecondary tabs don't work with Stark either. It seems to me that the way the overlay deals with themes is flawed. I believe the overlay itself should take care of making any theme suitable without special treatments. I realized just now that you have to hide the page title, menus and extra region manually otherwise all elements of the page are printed inside the overlay. I can't say this is a clean implementation. From Bartik:
I'm rising this issue to critical cause the overlay is active by default and as soon as you change admin theme some elements of the UI (secondary tabs) don't work.
Comment #8
marcingy commentedAs #6 tabs still work without the overlay.
Comment #9
iannozzi commentedAt root this is (another) issue with Overlay. Bartik and Stark display the same symptoms wrt secondary tabs.
This is definitely a half-baked implementation in Overlay, but part of the problem is also that there's no standard way to deal with tabs -- only conventions.
As noted above, in Bartik (and maybe stark), primary and secondary tabs are built in a multi-dimensional array, which Overlay blows away. In Garland, primary tabs and secondary tabs have their own variables, so when Overlay overwrites "primary tabs" and "tabs", secondary tabs stay untouched.
Here are the possible solutions (imo - maybe there are more):
Regardless of which solution is used, this needs to be documented somewhere.
Lastly, while this was not a critical issue for Bartik, this is a critical issue for Overlay.
Nuking secondary tabs effectively prevents site administrators and users from accessing critical parts of Drupal, like User Roles ( admin/people/permissions/roles ).
Comment #10
dodorama commentedStark doesn't override page.tpl.php and thus the system template is used. This means that, at the moment, is impossible to create a CSS only theme that works with the overlay. In this sense this issue is critical in my opinion. For sure we need to document how to build themes that work with the overlay but, I repeat, I don't like the fact that there's the need to do special tweaks to have the overlay working properly. It's a regression and something that makes building themes even more complicated.
Comment #11
ksenzeeOverlay is core, so "it works fine without overlay" isn't grounds for bumping priority down. Agreed that ideally overlay should handle the issue, and IMO it's critical if we're nuking content people need to see to administer their site.
Comment #12
riccardoR commentedThe dimensional array $variables['tabs'] is populated in the core function theme_preprocess_page()
Primary tabs are stored in $variables['tabs'][0] and secondary tabs in $variables['tabs'][1] — see theme_menu_local_tasks() in menu.inc
I think we can assume that this is the standard processing for tabs.
In the attached patch, overlay_preprocess_page() destroys $variables['tabs'][0] which contains the primary tabs — see theme_menu_local_tasks() in menu.inc. Any secondary tabs remains safely stored in $variables['tabs'][1] for themes expecting to find theme there — e.g. Bartik. As for themes using their own variables for tabs — e.g. Garland and Stark — they are not affected at all by that deletion and should include CSS rules — as Seven already does — to hide primary tabs inside overlay.
Applying the patch, all primary and secondary tabs are displayed correctly in Bartik, Seven and Garland, both with Overlay enabled and disabled.
I was able to navigate to admin/people/permissions/roles and, for example, admin/appearance/settings/bartik
HTH
Riccardo
Comment #13
dodorama commentedI tested the patch and it seems to work properly. Still I have doubts on how the overlay deals with this.
Maybe we can at least clean it up by avoiding to destroy primary tabs and directly instruct theme developers to hide the primary tabs (and other superfluous regions) when printed inside the overlay. At least we would have the same approach in all core themes.
Comment #14
bleen commentedsubscribing
Comment #15
casey commented$variables['primary_local_tasks'] is being set in seven_preprocess_page() and maybe other themes, but overlay shouldn't intervene with them.
Patch is at least better than current code. We could also add some extra css to overlay-child.css that hides .tabs.primary; if a certain theme wants it to be visible anyway it should override that CSS statement. But I think if possible overlay should remove the tabs from output (like patch does). We could do both though.
Anyways lets commit this patch first.
P.S. It is pretty weird that theme_menu_local_tasks() is returning an array instead of a string; you'd expect a theme function to return a string.
Comment #16
Jeff Burnz commentedsub
Comment #17
dries commentedAlright, let's start with this patch and follow-up if we need to do more. Committed to CVS HEAD.
Comment #19
TelFiRE commentedHmm, a year and a half later... this never got committed or solved?
I mean, this makes Drupal completely unusable unless you change your theme.
Comment #20
ksenzeeSee #17; this patch got committed and seems to have solved the problem. If you're having problems please open a new issue with screenshots and specifics of your setup.