I am struggling with the issue that is described here in the CTools queue: http://drupal.org/node/830382
However, it's marked as wontfix there, so I suppose the problem is really with Vote Up/Down.

I use Drupal's built in CSS optimization, which neatly merges the ~40 CSS files used on my site into a single one. However, after updating from Vote Up/Down 1.x, it seems that I'll have to leave it disabled from now on.

When clicking a vote up down widget on a node, several CSS files belonging to installed modules are reloaded separately. These include:
modules/node/node.css?Q
modules/forum/forum.css?Q
sites/all/modules/cck/modules/fieldgroup/fieldgroup.css?Q
sites/all/modules/cck/theme/content-module.css?Q
sites/all/modules/ctools/css/ctools.css?Q
sites/all/modules/date/date.css?Q
...

I obtained this list through Firebug. It's not the complete list of course, but that's probably not relevant anyway.

The issue is in the fact that these default CSS files that come with the modules now override my custom styles from my theme, defined in the 'optimized' CSS file.

In other words, clicking the Vote Up/Down widget destroys the entire page layout.

I tried this with all 4 widget types that come with the module, as well as with my own custom widget. The result is the same in each case.

I'm not sure why it's reloading any CSS files at all - I'm sure there's a good reason for it, but it seems to be incompatible with Drupal's built-in CSS optimization.

With CSS optimization disabled, no strange behaviour occurs and everything works as expected. I suppose it's still reloading those files, but because they were already loaded before, the cascading order doesn't change.

I was hoping that there is a workaround for this problem. If there isn't, I will have to leave CSS optimization disabled from now on.

Files: 
CommentFileSizeAuthor
#29 0001-Issue-972386-by-merlinofchaos-marvil07-Fixed-Clickin.patch842 bytesmarvil07
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 0001-Issue-972386-by-merlinofchaos-marvil07-Fixed-Clickin.patch.
[ View ]
#12 vud_ctools.png47.93 KBjcisio
#11 voteupdown.png200.67 KBcarlop
#5 no-extra-css-loaded.png89.98 KBmarvil07

Comments

benanne’s picture

I have downgraded to version 1 in the meantime, as disabling CSS optimization made page loads several orders of magnitude slower.

birchy82’s picture

Same, breaks page layout. Also overrides theme_hues for the node.

tchilly’s picture

Same problem here, system.css is being reloaded messing things up.

carlop’s picture

I have the same problem here. Disabling CSS optimization the problem disappear.

marvil07’s picture

Status:Active» Postponed (maintainer needs more info)
StatusFileSize
new89.98 KB

Sorry, I can not reproduce this behaviour with zen theme.

Firebug only reports me one POST request per click on the widget(see image).

benanne’s picture

I am using a custom-made subtheme of Zen 1.1. I'll try to reproduce it with the bare Zen theme and report back.

carlop’s picture

I use a custom-made theme but it's not based in any other theme. I have recorded a tiny video showing this issue http://www.youtube.com/watch?v=r9_M_8l7qjM i hope it can help

moosh101’s picture

Same here. When a vote is cast, my tab menu is replaced with the Drupal default tab menu. When I navigate away from the page, my own tab menu re-appears. This only seems to occur when a vote is cast, but not when viewing the node normally. As a result, I cannot use this module - shame :-(

marvil07’s picture

Status:Postponed (maintainer needs more info)» Closed (cannot reproduce)

Well, it seems that this is not really related with vote up/down, since only happens on custom themes(see #5).

If someone can reproduce this on an isolated environment(only vote up/down and using garland or zen) please re-open it.

carlop’s picture

I have a local copy of my website with the same issue. I have switched to garland and have installed only vote up/down (ctools too), and the issue still breaks the layout and load the extra css.

carlop’s picture

Version:6.x-2.1» 6.x-2.2
Status:Closed (cannot reproduce)» Active
StatusFileSize
new200.67 KB

I attach the firebug report

jcisio’s picture

StatusFileSize
new47.93 KB

I have this, too. Ctools AJAX response returns other things than the only "replace" command.

moosh101’s picture

Seems like its effecting quite a few people. Hope the developer takes a serious look into the issue despite being unable to reproduce it. It would be good to use this module, but with these current CSS bugs, I cannot.

I experienced the issue without CSS optimization turned on. Seems to be effecting both systems, those that use CSS optimization and those that do not. Lets hope we can get it fixed.

RobertOak’s picture

I have the same issue here. This is with the Newsflash theme. It's easy to reproduce frankly and I've done a quick first pass of the code and am not seeing the bug, but this is MAJOR for it does slow the site down and change the layout. Instead of ajax speeding up the overall site experience, it causes a delay, while all css is loaded.

It's not just vud_node, it's also in the comments. Seems to occur on ajax_render, after vote is cast, changes the entire site layout and also slows the site due to the additional css load.

jthomasbailey’s picture

subscribing, I'm having the same problem with the Adaptive Theme Panels Everywhere

jcisio’s picture

Similar issue in CTools #830382: Unwanted / duplicated temporary css files if CSS Optimization is enabled.. It turns out not to be CTools problem, but module problem. May get some ideas there.

naden’s picture

In my case it only happens with google chrome, firefox, safari and ie are ok. I'm using the http://drupal.org/project/acquia_marina theme.

jcisio’s picture

I'm using Mac OS X 10.5, zen based theme, I have problem with Firefox, Opera, Chrome, Safari, with uid 1, normal user and anonymous user! I sometimes had this problem before, but now it always happens.

jthomasbailey’s picture

Priority:Normal» Critical

Explorer won't work without CSS optimization (too many stylesheets, 33) so I think this is critical. Major at the minimum.

physiotek’s picture

subscribing

marvil07’s picture

Title:Clicking widget causes module CSS files to be reloaded when CSS optimization is enabled, breaks page layout» Clicking widget causes module CSS files to be reloaded when CSS optimization is enabled
Component:vud_node» Code

Finally I can reproduce the problem, but only if css core optimization is enabled, it is also generic(not-vud_node specific). I was also using an old ctools version on my sandbox at the time I tested this before, so maybe that could influence my test.

Well, not really sure where is the problem at my initial review, so patches are welcome.

marvil07’s picture

Status:Active» Postponed (maintainer needs more info)

I opened a new issue at ctools with a patch: #989956: ctools_ajax_render() is loading css/js when core css/js optimization is active

Not really sure if that is the right solution, but it seems to be solving this problem.

Postponing this until a conclusion there.

carlop’s picture

marvil07 thank you very much for your hard work.

benanne’s picture

marvil07, you're a legend! Hopefully I'll be able to upgrade again soon :)

Ainur’s picture

marvil07, doesn't helped me. Still got js and css file processing which slows down the voting significantly.

gibbet’s picture

Anyone have a fix/workaround for this yet? Other than disabling ajax or css aggregation?

marvil07’s picture

@gibbet: see #989956: ctools_ajax_render() is loading css/js when core css/js optimization is active as commented in #22:

I opened a new issue at ctools with a patch: #989956: ctools_ajax_render() is loading css/js when core css/js optimization is active

Not really sure if that is the right solution, but it seems to be solving this problem.

Postponing this until a conclusion there.

RobertOak’s picture

Just applied your patch (#7, link: http://drupal.org/files/issues/0001-Only-process-css-js-files-when-prepr...)

to ctools-6.x-1.8 and it seems to be working great.

The patch lines might be off but I just went into vi and modified the code instead of applying the patch.

Good job, looks to work!

marvil07’s picture

Assigned:Unassigned» marvil07
Status:Postponed (maintainer needs more info)» Reviewed & tested by the community
StatusFileSize
new842 bytes
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 0001-Issue-972386-by-merlinofchaos-marvil07-Fixed-Clickin.patch.
[ View ]

And finally the mystery has been solved by merlinofchaos, the problem has been on the implementation :-p

Here the patch I will be committing.

marvil07’s picture

Status:Reviewed & tested by the community» Fixed

Ok, committed to master, 6.x-3.x and 6.x-2.x.

Status:Fixed» Closed (fixed)
Issue tags:-CSS, -Ajax

Automatically closed -- issue fixed for 2 weeks with no activity.