Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Any plan to port this drupal 7 since drupal is release beta soon
Comment | File | Size | Author |
---|---|---|---|
#7 | css_injector.drupal7_814526_07.patch | 30.58 KB | rfay |
#7 | css_injector.tar_.gz | 74.9 KB | rfay |
#5 | css_injector.drupal7_814526_05.patch | 30.58 KB | rfay |
#5 | css_injector_d7.tar_.gz | 71.36 KB | rfay |
#1 | css_injector.drupal7.patch | 21.32 KB | rfay |
Comments
Comment #1
rfayHere's a drupal 7 port. I think it works well. It contains a couple of bug fixes as well.
It's attached both as a patch against the latest D6 and also as a complete module.
Thanks for the excellent module. I always find it useful when clients have limited access to the filesystem.
Comment #2
BenK CreditAttribution: BenK commentedSubscribing and will test out the patch in #1....
Comment #3
BenK CreditAttribution: BenK commentedI gave #1 a pretty thorough testing, trying out the various configuration options in lots of different scenarios. Everything is working great and functions just as expected. Thanks rfay!
I think this D7 port is ready to be committed. I'd love to see the CSS Injector maintainers open an official 7.x-1.x-dev branch.
Cheers,
Ben
Comment #4
rfayI'll have another round coming soon with some small fixups and with tests. I'd appreciate it if you'd have another look at that one, @benk. Thanks for your vote of confidence on this first round.
Comment #5
rfayOK, this one should be ready to commit.
It includes a number of small fixes in addition to:
1. Nontrivial test suite that does many of the things that css_injector does.
2. It uses the new D7 facility hook_css_alter() to actually make this module's CSS take priority over even the theme's CSS.
Of course I may have messed something up, so testing is in order.
Attached as both a patch (against D6) and a module.
Comment #6
BenK CreditAttribution: BenK commentedI've been doing some testing of the patch in #5 and noticed the following warning message at the top of the page after saving a new CSS injector rule:
Warning: in_array(): Wrong datatype for second argument in drupal_write_record() (line 5981 of /home/sandboxes/drupal/includes/common.inc).
This warning message seems to only occur when saving a new rule... it doesn't appear when editing and saving and existing one.
Also, the new hook_css_alter() is working great. The module is successfully taking precedence over the theme CSS. This is a nice feature... I used to have to set the "Media" to "Screen" to work around this. Now I can leave it set to "All" and it is possible to override. Very cool!
--Ben
Comment #7
rfay@BenK, Thanks very much for the excellent testing. Good catch!
Here's an update to fix the #fail.
Thanks,
-Randy
Comment #8
BenK CreditAttribution: BenK commented@rfay: I've tested the patch in #7 and it's working great. The warning message is gone and everything is working smoothly.
The only feature this module is lacking, I think, is an option to disable/enable a specific rule. When you're testing CSS (a primary use case for this module), you really need to be able to turn CSS rules on and off. Currently, I work around this by setting a rule to appear on only one page I don't care about (when I want to disable it), but this necessitates changing the rule itself. It would be better to have a checkbox on the main settings page (admin/config/development/css_injector) to enable or disable a rule. Any interest in this?
Otherwise, this is RTBC.
Cheers,
Ben
Comment #9
rfayMy intent was just to get this *ported*, not to add features. Once we have it ported and committed, it can have issues for additional features. Also, the tests should be backported to D6 at that point.
Comment #10
BenK CreditAttribution: BenK commentedOK, sounds good. In that case, I'm marking this RTBC. Nice work on the port!
--Ben
Comment #11
eaton CreditAttribution: eaton commentedCommitted -- sorry for the delay, the recent beta has prompted me to dive back in and get things rolling. It's in the D7 dev branch and I'll be rolling an initial release shortly!
Comment #12
eaton CreditAttribution: eaton commented