Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
theme system
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
9 Nov 2010 at 22:05 UTC
Updated:
3 Jan 2014 at 02:41 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
sunAwesome issue summary, thanks! :)
The proper solution would be to re-open #901062: Regression: Themes can no longer remove stylesheets by overriding them in .info files against D7 and introduce the originally proposed stylesheets-remove[] .info file property.
Comment #2
jacineStill no word on that, and I don't think it's going to happen.
Unfortunately this has serious potential to break sites in a bad way.
Comment #3
effulgentsia commentedHere's a fix, but a test for it remains challenging until I (or someone else) makes good on the promise in #561858-201: [Tests added] Fix drupal_add_js() and drupal_add_css() to work for AJAX requests too by adding lazy-load to AJAX framework.
Comment #4
jacine@effulgentsia Thank you!
The patch solves the problem, the change appears simple enough and the docs are good! Yay :D
I'd mark it RTBC, but I'm not really clear on what needs to happen with regard to the other issue. It seems like a test for this is not even possible and that issue is closed.
Comment #5
jacine#3: 967166-ajax-css-3.patch queued for re-testing.
Comment #6
gmclelland commentedIs there any fix to prevent this from happening in Drupal 6?
I'm using TAO which strips out core's css using the .info file. When used with Skinr every time I click on Edit Skin it loads an ajax modal popup. When the modal is displayed it reinjects drupal's css causing my theme to break.
Thanks for any help you can provide. I also tried the stylestripper module, but that didn't work.
Comment #7
garrettrayj commentedPatch works great. Anything else I can help with to get this into a release version?
Comment #8
moshe weitzman commentedLooks like a straight up bug fix to me. Any test for this would depend on the other issue. Seems like we should fix the bug now.
Comment #9
rfayD8 first. Let's get these fixed on D8 and into D7.
Comment #10
effulgentsia commentedBy the way, #561858-211: [Tests added] Fix drupal_add_js() and drupal_add_css() to work for AJAX requests too by adding lazy-load to AJAX framework contains the tests to finish off that issue. Once that's in, a test can be added to this one.
Comment #11
sun.
Comment #12
sun#3: 967166-ajax-css-3.patch queued for re-testing.
Comment #14
mfer commentedI was just bit by this. The patch in #3 still applies to D7 w/ an offset.
Comment #15
yoroy commentedA simple reroll would help move things forward here.
Comment #16
aiwata55 commented#967166-3: Content rendered via AJAX does not respect stylesheets removed in .info files 967166-ajax-css-3.patch retest.
Comment #17
aiwata55 commented#3: 967166-ajax-css-3.patch queued for re-testing.
Comment #20
star-szrPatch attached which applies cleanly to D8 HEAD, and applies to D7 HEAD with an offset.
Comment #21
mac_weber commentedComment #22
jhoodI applied the patch in #20 and the stylesheets no longer come back.
Comment #23
xjmThe patch looks good to me, and manual testing in #22 confirms that it resolves the issue. Thanks for the reroll and the manual testing!
The next thing we will need is an automated test for the issue. #561858: [Tests added] Fix drupal_add_js() and drupal_add_css() to work for AJAX requests too by adding lazy-load to AJAX framework has been committed to 8.x, so the comments above seem to indicate it should be possible to write this test now. The test should fail when applied by itself, and pass when applied together with #20.
Comment #24
xjmOops, marking NW for addition of tests.
Comment #25
samerali commented#20: 967166-ajax-css-19.patch queued for re-testing.
Comment #27
xjmThe patch will need to be rerolled against the latested 8.x and for the D8 core/ directory change.
Comment #28
star-szrSome changes over in #1287368: Drupal.settings.ajaxPageState.css gets overwritten affected the patch. I've done a re-roll for D8 and D7 and tried not to step on any toes, but please let me know if I missed anything.
Comment #29
effulgentsia commentedThanks! I'll work on adding tests.
Comment #30
xjmSending to the bot.
Comment #32
effulgentsia commentedHere's the test only. It should fail. Note that most of the -/+ lines are just a change to indentation.
Comment #33
effulgentsia commentedHere's #32 plus the fix in #28, but with a slight reworking of the if statement and code comments. This should pass.
Comment #34
KrisBulman commentedTested original problem on the 8.x branch of git and was able to reproduce it following Jacine's steps (tested with system.base.css on bartik for a more drastic effect)
ran the patch
$ git apply -v 967166-ajax-css-32.patch
Followed same reproduction steps and can confirm the css file was not loading.
The faster this gets committed to 8, the sooner it'll get backported and we'll be able to remove the unintuitive hook_css_alter() from our themes in 7 :)
RTBC
Comment #35
no_commit_credit commentedComment #36
xjmThe above fixes two small things:
Leaving at RTBC because these are trivial changes. Thanks!
Comment #37
catchThis looks fine, most of the change is indentation and test additions, committed/pushed to 8.x.
Comment #38
KrisBulman commentedd7 reroll
Comment #39
xjmComment #40
effulgentsia commented#38 looks good. It's a straight reroll. This patch only fixes this:
These two lines need a leading space, which they already have in what was committed to D8.
Trivial change, so RTBC.
Comment #41
jacineHooray!!! Thanks all :D
Comment #42
webchickCommitted and pushed to 7.x. Thanks!