Hey awesome work on the 3.x branch love it!
I am just having a small problem with using Panels in place editor with Adaptive Theme. It seems for some reason certain li classes are not rendering when I use adaptivetheme. I have attached screenshots showing where exactly the missing classes are for my specific use case.
Normally I was thinking this would be a problem to bring to panels attention but since the in place editor works in bartik and a few other themes I think it is an issue with AdaptiveTheme. I am just using a default drush enabled sub theme right now.
---
UPDATE
I took a wild guess and removed adaptivetheme_links in theme.inc and the icons all appeared with the correct li classes. This is because panels_ipe.module calls theme_links in line 125-129
$attributes = array(
'class' => 'panels-ipe-linkbar',
);
$links = theme('links', array('links' => $links, 'attributes' => $attributes));
I did some further debugging with xdebug and found the problem had to do with the the following code: at_get_setting('extra_menu_classes') line 391 in theme.inc
Changing the assignment === operator
if (at_get_setting('extra_menu_classes', $theme_name) === 1) {
$class = array($key);
if ($i == 1) {
$class[] = 'first';
}
To this
if (at_get_setting('extra_menu_classes', $theme_name) == 1) {
$class = array($key);
if ($i == 1) {
$class[] = 'first';
}
Fixed the problem and all the proper li classes got populated. I do realize the === is perfectly valid but confused bout what is going on.
| Comment | File | Size | Author |
|---|---|---|---|
| adaptivetheme_code.png | 20.09 KB | sylus | |
| adaptivetheme_widget.png | 120.27 KB | sylus | |
| bartik_code.png | 22.44 KB | sylus | |
| bartik_widget.png | 97.13 KB | sylus |
Comments
Comment #0.0
sylus commentedEdit
Comment #0.1
sylus commentedEdit
Comment #0.2
sylus commentededit
Comment #0.3
sylus commentedEdit
Comment #0.4
sylus commentedEdit
Comment #0.5
sylus commentedEdit
Comment #0.6
sylus commentedEdit
Comment #1
sylus commentedChanging title
Comment #1.0
sylus commentedEdit
Comment #1.1
sylus commentedEdit
Comment #2
sylus commentedHopefully not missing anything but looks like a bug so changing from support request. Can move back if inappropriate.
Comment #2.0
sylus commentedEdit
Comment #3
Jeff Burnz commentedHow odd, I use this operator extensively because its faster to check equality and type, I assume this must be a string. No problems, easy fix.
Comment #4
Jeff Burnz commentedI'm looking at this and wondering why my In Pace Editor looks nothing like yours - the screenshots show a nice styled editor with gradient and icons, mine looks like crap - its purple with budget styles all round. I have never used this, can you advise?
Comment #5
sylus commentedHey Jeff I am working off of the panopoly distribution trying to extend it with adaptive theme because would be a killer combination. I didn't think though that panopoly included work on making the in place editor more clean looking though. Sorry should have pointed that out. Do you still have the class loading problems? did u try panels dev release?
Comment #6
sylus commentedIt seems I am having problems wherever there is the === operator. For instance none of my breadcrumbs are also showing up.
Traced to line 90 in theme.inc in
Except in the subtheme info breadcrumb_display is set to "yes"
Setting breadcrumb_display to 1 (in subtheme info) and changing === to == in theme.inc for breadcrumb function made the breadcrumb appear and work properly.
Comment #7
Jeff Burnz commentedThe breadcrumb being "yes" is an odd reversion, I know I updated that at some stage so its been reverted somewhere along the way.
Let me know if you have any other issues, I do not want to change all the comparison operators at this stage, I use equality + type all over the place and no one else has mentioned such issues. For example even if the default value is "yes" and you check the setting it will save as value 1 (an integer). Type checking seems problematic on your system, because I cannot reproduce either of the issues you have described - not with breadcrumb or the In Place Editor classes.
Maybe if there is a way for you to share your database and theme with me, either send it to my email using the contact form or skype me etc, jmburnz. Tell me what operating system you are using and version of PHP etc.
Comment #8
sylus commentedI will give it a shot on another stack right now I am using Acquia's Dev Desktop on Mac OS X. Definitely type checking is failing for me though, will take a further look. If nothing works I can share with you the make file ^_^ Will get back shortly.
Comment #9
sylus commentedI switched to PHP 5.3.9 and the issue still persists. I compared with the Zen theme and noticed that it only uses theme_get_setting('value') == 1.
Looking further into the === operator I did read this comment in php.net though not sure if correct.
The difference between == and === is that === never does any type conversion. So, while, according to documentation, ("+0.1" === ".1") should return true (because both are strings and == returns true), === actually returns false (which is good).
Comment #10
sylus commentedSTEPS TO REPRODUCE
1) Install Acquia Dev Desktop (Use any Version of PHP 5.2 or 5.3 from interface)
2) In Default Drupal Install add AdaptiveTheme to /sites/all/themes/ (can even create subtheme)
3) Set breakpoint in any function in sites/all/theme/adaptivetheme/inc/theme.inc using === operator (for instance breadcrumb)
4) Run XDebug and notice never enters the conditional
Comment #11
Jeff Burnz commentedI asked to see your files and database, at this stage that is what I really need.
Comment #12
sylus commentedHey Jeff sure i'll message you on skype with the files. Ill just give you a default drupal 7 + adaptivetheme install with the database as would probably be the simplest to debug.
Thanks in advance for taking the time to look into this!
Comment #13
fenstratI have seen this issue with missing IPE editor icons in AT, however I can't seem to reproduce it now.
The IPE (vastly improved in panels-7.x-3.1) looks like this out of the box, as far as I know there's no custom Panopoly additions to it.
Comment #14
fenstratBaah, reverting changes, silly Dreditor.
Comment #15
Petemoss commentedI don't see this problem in my Panels in-place editor or breadcrumb (no Panopoly distribution, just normal Panels in a standard typical D7 installation). My guess is this looks like a conflict due to Panopoly distro customization or something else.
Comment #16
fenstrat@Petemoss Yeah this certainly could be a conflict with Panopoly. However as I said I've seen this same issue without Panopoly. However as I can't replicate it now then it's an academic point really.
Comment #17
Jeff Burnz commentedWell, prior to yesterday nuking the icons would have been entirely reproducible, simply by turning OFF the Extra Menu Classes in theme settings - that would have removed all classes/attributes from link items and killed the icons. However, I actually removed the entire theme_links override because, in short, it wasn't really doing much.
I think the main issue being asked about is the ubiquitous failure of the === operator, which I cannot reproduce, and certainly would have noticed over the last 4 months of development. I made the decision really early on to use equality + type checking because its faster (up to 25% faster than ==), and in places where this was not an option its not used. Yes this is micro-optimization but this theme strives for performance in every nook and cranny.
I have been very mindful of this operator and potential issues. The main problem for me in dealing with this particular issue is not being able to reproduce it.
Comment #18
Jeff Burnz commentedUpdating title, theme_links is not overridden in latest dev.
Comment #19
sylus commentedHey Jeff indeed the latest version of adaptive theme has fixed the issue with Panopoly Icons. Your correct that the issue only concerns itself with the === operator.
I have sent you a message on skype so can send relevant files when your online next.
I am going to delve further into this myself as you state been using this for 4 months with no issue so definitely has to be a problem on my end. I am going to give it a shot on MAMP today and see if that makes a difference ^_^
We can probably close this issue for now as seems to only be related to my setup (Acquia Dev) ?
Comment #20
sylus commentedHey! I don't know if anything changed in some of the recent commits of AT or even in my own code but everything looks to be working now and I no longer experience any problems! Woot!
Regardless I really appreciate your help! :)
Hopefully I can return the favor!
Comment #21
Jeff Burnz commentedAwesome, thanks for the heads up sylus.
Comment #22
Jeff Burnz commentedI wonder if for pure safety we might type juggle the checkbox settings, one way I think we could away with this is doing in at_get_settings(), which is AT's replacement for Drupal cores theme_get_setting().
I've dug right into this after more poking by sylus and to be honest, it is a bit baffling with regards to how and where the checkbox values are cast. The array_merge() in at_get_setting() is strait from theme_get_setting(), it works mostly the same, so I do not think this is a theme specific issue, other than using stricter comparison operators than most other themes.
Comment #23
Jeff Burnz commentedI had to release RC4 due to an issue with panels settings so I pushed this into the release. I tested this heavily and it shouldn't make any difference, at least theoretically speaking, since AT always tests checkbox settings as if they are type integer, and this implicitly casts any setting that is numeric and 1 char string to integer (I cant really think of safer way of testing for such settings than this, if you can, I am all ears).
Its possible we could get away with either of those function calls (I mean just one, either is_numeric() or strlen(), since I do not believe I have use any numeric settings other than these checkbox settings, and certainly I do not think I used a single char string anywhere.
Comment #24
sylus commentedEverything works on my end now not sure which code fixed the problem but everything works great now :)
Comment #25
Jeff Burnz commentedCleaning up.
Comment #25.0
Jeff Burnz commentedEdit