I enabled No script and ad block just to run a quick test with this filter. Clicking preview resulted in the loss of alignment. Once these tools were disabled, the alignment was still lost until a new video was selected.
From examining the code of the of the HTML filter, it looks like the cache is not being cleared, or does not detect the changes.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | video_filter.module.2.x.patch | 1.31 KB | anon |
| #5 | video_filter.module.3.x.patch | 918 bytes | anon |
Comments
Comment #1
drupal_acc commentedAfter further testing, it appears that align:center only works for the initial preview. A second preview results in a left-alignment and further changes can only alternate between left and right.
Comment #2
drupal_acc commentedA further test showed that clearing the cache from the performance settings restored the alignment, but the issue reappears on the next preview.
I have also tried disabling optimizations, but this had no impact on the issue. Neither did adding 'text-align: center;' to the CSS file.
Comment #3
drupal_acc commentedRight, I finally isolated the issue with Firebug. The CSS file is downloaded on the first preview, but omitted from every subsequent preview.
It is simply not sent to the client machine.
Anyone got any ideas?
Comment #4
blackdog commentedThat's odd. It might be that the whole theme-function isn't called again on subsequent page loads, and thus the css file won't load. Maybe we have to move the drupal_add_css to a hook_init() function. I'll try to test this this week.
Comment #5
anonConfirmed, and I dont think this has anyting to do with ad block and no scripts.
Since filters always is cached by drupal, I dont think that it will run thru the theme function where we add the css file every time.
But like blackdog suggested, the
hook_initfunciton will take care of this.I provided two patches, one for 2.x-dev and one for 3.x-dev
(for this to completely work in 3.x-dev
#999542: Add left,center and right CSS classes
needs to be patched aswell)
Comment #6
scw commentedHi, had the same problem... And i did hook_init myself i usually did it that way with css-files but according to the drupal api you should include the css in the .info file. I tested it and works fine... cheers
Comment #7
drupal_acc commentedI just got round to following up on this today. Thanks for your help.
Unfortunately, the patches provided by anon had no effect. I even tried hard coding the align choice just to rule out any parsing errors.
So, I am returning this to active again.
Comment #8
blackdog commentedFixed in all branches. For Drupal 6, the hook_init way is the right way. For Drupal 7, the CSS file is added in video_filter.info.