Closed (fixed)
Project:
Advanced CSS/JS Aggregation
Version:
6.x-1.6
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
30 May 2011 at 02:54 UTC
Updated:
24 Jan 2012 at 23:40 UTC
Jump to comment: Most recent file
Comments
Comment #1
Peter Bowey commentedLess will need a advagg hook event added. See http://drupal.org/node/1078060#comment-4527560 for how this was done by Mike for css_emimage
Comment #2
mikeytown2 commentedQuick look at the code and it should work... with advagg enabled, go to
admin/settings/advagg/infoand under the "Hook Theme Info" fieldset can you paste the contents of it here? Can I also get a?advagg-debug=1debug output from you? add?advagg-debug=1to a URL and then go to watchdog and under advagg there should be a large debug string. Copy that into a text file and upload it.Comment #3
mikeytown2 commentedCan't move forward till I get more info. Also, would you mind testing with the latest dev?
Comment #4
nbchip commentedHook Theme Info:
It seems that with new dev smth is broken, at first everything seemed fine, but after adding ?advagg-debug=1 I started getting all kinds of errors when in "my Theme", which actually uses .less
Comment #5
nbchip commentedComment #6
mikeytown2 commentedrun update.php; the above errors should disappear. I've added a new cache table in the latest dev. I still need the output from ?advagg-debug=1
Comment #7
nbchip commentedI needed to reiinstall module, running update was giving me errors.
Also strangely but everything seems to work in Chrome (13 dev version) . Its like it knows how to parse .LESS files... Could this be?
Attached debug
Comment #8
mikeytown2 commentedTop of the debug shows me whats wrong
What I grab from $variables['css'] is correct; what drupal_add_css() gives me is wrong. Thanks for the debug output; I should be able to fix this today, if everything works out.
Comment #9
mikeytown2 commentedThis should be fixed with this patch; let me know if it's not as this code hasn't been thoroughly tested. Patch has been committed.
Comment #11
corey.aufang commentedSorry for opening this again, just the end of string check was bothering me.
Wouldn't it be simpler to check for the end of the string like this?
To me it seems to be a cleaner solution rather than conditionally defining a function.
Comment #12
mikeytown2 commentedFunction gets defined only if your using php 4; nonetheless being able to do this with one native php function instead of 4 is probably quicker.
Patch here has been committed.
Comment #13
corey.aufang commentedThe start value for substr has to be a negative value if you want to check from the end ;)
Also I would suggest only checking for -5 and '.less' as a file doesnt have to end with .css.less, only .less.
Comment #14
mikeytown2 commentedThanks corey, fix has been committed.
http://drupalcode.org/project/advagg.git/commitdiff/76c83718683d0b210eb7...
Comment #16
corey.aufang commentedSorry to resurrect this issue but I found a critical problem with the CSS aggregation.
This causes a reordering of CSS files by moving any processed less file to the end of the type, being either module or theme. This breaks style overriding, which is sort of a big thing in CSS.
Example:
This
becomes this
This is caused by grabbing the CSS from drupal_add_css and filtering out .less files then merging with the CSS from the $variables array, where the CSS from drupal_add_css is the primary.
Is there any reason why we should be grabbing the info from drupal_add_css at all? The only thing I can see us gaining from that is if anyone used drupal_add_css in a previous preprocess funciton, since template_preprocess_page already sets $variables['css'] from drupal_add_css.
If we still need to pull the files from drupal_add_css and merge, we should have the CSS from $variables be the primary on the merge.
Comment #17
corey.aufang commentedThis change fixes the issue:
I still recommend using just $variables['css'], as that will ensure that other modules/themes changes will carry through in the correct order, like so:
Comment #18
mikeytown2 commentedHere's a patch that fixes the order and allows one to only use
$variables['css']if desired by doing this in your settings.php fileComment #19
corey.aufang commentedLooks perfect to me.
Comment #20
mikeytown2 commented#18 has been committed. Thanks for the feedback!
http://drupalcode.org/project/advagg.git/commitdiff/ef80d91402688cfb95b8...