Closed (fixed)
Project:
Drupal.org security advisory coverage applications
Component:
module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
20 Aug 2012 at 11:30 UTC
Updated:
9 Dec 2013 at 22:50 UTC
Jump to comment: Most recent
Comments
Comment #1
katrin commentedHi,
Remove LICENSE.txt, it will be added automatically.
An automated review of your project has found some issues with your code. See http://ventral.org/pareview/httpgitdrupalorgsandboxpeteboere1740930git.
Comment #2
pete-b commentedUpdated and ready for review
Comment #3
opdavieshttp://ventral.org/pareview/httpgitdrupalorgsandboxpeteboere1740930git is still showing issues. I'd suggest running it through the Coder module (http://drupal.org/project/coder) to ensure that it complies with Drupal's coding standards.
Comment #4
pete-b commentedOk, no issues showing up now:
http://ventral.org/pareview/httpgitdrupalorgsandboxpeteboere1740930.git
Comment #5
jrsinclair commentedOne small issue, when I try to enable this module I get a fatal error with the following message. Call to undefined function csscrush_bootstrap().
Perhaps a more experienced Drupaller could correct me, but I figure a call to something like the following inside
csscrush.installwould correct the issue?Or perhaps the
csscrush_bootstrap()function could be factored out into a separate .inc file?Otherwise, I've read over the module code, and it looks pretty solid in general.
Comment #6
jrsinclair commentedComment #7
pete-b commented@jrsinclair
Yep, your fix suggestion is on the ball.
I've commited the addition, no uninstall/install errors now.
Comment #8
dharam1987 commentedYou may consider to add :-
git clone --recursive --branch 7.x-1.x http://git.drupal.org/sandbox/peteboere/1740930.git css_crush
command in your issue summery, so that reviewers can directly copy paste :)
--
While trying to install I got this error - http://www.diigo.com/item/t/4392082_138848861_8187317
This is probably that I have not added the csscrush inside (library) folder.
You must mention in your README.txt and also in the summery of your project that.
"Please download csscrush library from -givenlocation- and putit inside the libraries folder. with the name "csscrush"
Another thing, I saw that you are using
libraries_get_path('CssCrush'), $search_paths[] = "sites/all/libraries/CssCrush/$target";
in your code, people tend to use lowercase letter to name the folders, hence if I am in a linux server and if I named my library folder as 'csscrush' it may give error.
So be specific about the library foldername as well, I would suggest you use "csscrush" everywhere and instruct users to download it and have it ready before using your module.
Thanks
Comment #9
pete-b commented@dharam1987
Thanks, have fixed the top issue and implemented your suggestions.
Also, some other improvements:
http://drupalcode.org/sandbox/peteboere/1740930.git/commit/d8c3387f83d37...
Comment #10
dharam1987 commentedNice, your README.txt file has much more clear instructions now, I will suggest once this project goes live, put the same info in project description, as many beginners and you know most developers are lazy and forget to bother about README.txt and will keep blaming about the documentation, so if you have it in your project description, it is all set.
Above is my personal suggestion though.
PS : I am always eager to help, collaborate, contribute, feel free to contact me if I can help you anywhere, lets share our knowledge and keep helping the community :)
Thanks
Comment #11
dSero commentedHi,
It looks like a very nice project that probably will help many drupal users.
Please notice that there are minor issues in your automatic report: http://ventral.org/pareview/httpgitdrupalorgsandboxpeteboere1740930git
Please notice several issues that you may consider to take care of:
1. csscrush_requirements: from security point of view it's better to perform if () return rather than canonical if. In this case it can help you avoid redundant code, since you check $library_available once, and take care of this case.
2. csscrush_add_css: same. You may also consider refactor this function
3. _csscrush_include_path: many canonical if statements. can be easily reduced to simple if () return;
4. _csscrush_include_path: line #201 seems redundant and should be removed. lines 204+205 can me merged.
Best Regards,
Moshe
Comment #12
dSero commentedChanged to needs work.
Consider doing http://drupal.org/node/1410826 to accelerate your acceptance process
Comment #13
pete-b commented@dSero
Thanks for taking some of your time to review.
Have you looked up what the reported issues are referring to? Automated code sniffers have their limitations :)
I've refactored a little here and there for a bit more clarity:
http://drupalcode.org/sandbox/peteboere/1740930.git/commitdiff/29b995438...
Though I don't fully understand you on all points, if you are referring to the 'single return' principle it's not something I would want to follow for good reason:
http://stackoverflow.com/questions/36707/should-a-function-have-only-one...
Comment #14
pete-b commentedbump.
Comment #15
eule commentedManual Review
Hi pete-b
i try your Module. after downloading csscrush from git and put it to my libraries directory i get this error
Fatal error: require_once() [function.require]: Failed opening required './sites/all/libraries/csscrush/lib/CssCrush/Io.php' (include_path='.:/usr/local/lib/php') in./sites/all/libraries/csscrush/CssCrush.php on line 18
i try also like you in the readme.txt file says to put it in the module folder
this brings me the site again but with this errors
when i refresh the page only this error comes up
the module i can´t enable!!!
Please use and make it working only with the libraries module...i think this is better for the folks and with path setup for you.
Inside of ccscrush.module you use this
i mean thats wrong and need to call /lib/CssCrush/
hope this helps...using this on a live site
Good Luck
Comment #16
eule commentedComment #17
pete-b commentedSorry for this. These errors are because the most recent version of CSS Crush uses an autoloader as part of moving towards PSR-0 compliance.
Basically this means the class names in the code have to match the case of the class files on case-sensitive file systems (e.g Linux). So will be quite easy to fix if you need it working ASAP.
I'll check in the module changes myself when I get half an hour to make the changes and test on a Linux box.
Initially I did this to imitate other modules that use third-party libraries, and avoid having a hard dependency on another module. But I think you're right; putting a third-party library inside a contrib module is probably just confusing.
Comment #18
pete-b commentedThanks @eule
Fixed the casing issue. Tested on Ubuntu, all working as expected now.
http://drupalcode.org/sandbox/peteboere/1740930.git/commit/5757c74
Comment #19
klausiWe are currently quite busy with all the project applications and I can only review projects with a review bonus. Please help me reviewing and I'll take a look at your project right away :-)
Comment #20
eule commentedHi pete boere
i try it again. installation works fine now!i use omega theme. i setup like you say in my template.php file these lines.
/*
Adding a CSS Crush processed file to your theme (ideally in template.php).
*/
csscrush_add_css('theme://your-theme/styles.css');
i add also this line csscrush_add_css('theme://spar/css/global.css');
and i try these lines
function spar_preprocess_html(&$variables) {
// Add conditional stylesheets for IE
$theme_path = drupal_get_path('theme', 'spar');
csscrush_add_css($theme_path . '/css/global.css');
after all i become a green msg under my admin...i mean must be red?
Statusmeldung Debug: CssCrush::loadAssets: Plugin file could not be parsed. in CssCrush::loadAssets() (Zeile 212 von ./sites/all/libraries/csscrush/lib/CssCrush/Core.php).
maybe i make something wrong?
Comment #21
pete-b commentedHi @eule
No, you haven't done anything wrong. The error notice is a new issue in the latest version of CssCrush (1.9.1) though it's minor and shouldn't stop it preprocessing your css files.
There are a few ways to deal with the error notice:
newer CssCrush test branchpatched master branch on Github that fixed this issue: https://github.com/peteboere/css-crush/zipball/masterComment #22
pete-b commentedComment #23
heddnLooks like a solid module.
csscrush-adapter.inc
md5usage fordrupal_hash_base64(). See: http://drupal.org/node/845876Comment #24
pete-b commentedThanks @heddn,
I've added a cache bin argument for cache_clear_all() as suggested.
The md5 is used as a fast way for creating a unique (and valid) filename based on path so I don't think this should be a security concern, I've added a inline comment to clarify its choice.
Comment #25
tenken commentedProject review
automated review
No errors found.
Manual review
csscrush_bootstrapin the module file lead me to think this is a hook function. Similarly thecsscrush_add_cssfunction made me think you were injecting your own special css files into drupal without developers needing to do much. I assume as a developer I have to callcsscrush_add_csswith my special CSS file directly to make use of your module. Ahh, thats covered in the README.I still recommend the refactoring of drupal hooks from your "csscrush" module funtions into seperate files.
CssCrushDrupalIoclass file should be included in thefiles[]array of your module info file to be registered by Drupal.filessub directory. You're not guarenteed to have write access to a module folder or theme folder.hook_helppackage = Developmentto your info file to classify your module as a developer related module in the module list of a drupal site.Thanks for the useful module for debugging.
Comment #26
tenken commentedoops forgot to change status in #24.
Comment #27
PA robot commentedClosing due to lack of activity. Feel free to reopen if you are still working on this application.
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #28
pete-b commentedThanks for review @tenken
Have reorganised the files a little as per your suggestions.
Also updated to work with v2 of the CSS-Crush library, which uses php 5.3 namespaces.
Comment #29
kscheirerMajor is only for issues that haven't been reviewed in 2 weeks, see https://drupal.org/node/539608#application-priorities.
Comment #30
kscheirerfile. Why not use that in the function arguments like$options = array('type' => 'file');Looks like a nice module! None of those are blocking issues.
----
Top Shelf Modules - Crafted, Curated, Contributed.
Comment #31
pete-b commentedThanks @kscheirer,
Only files written are compiled CSS files, so these need to be public.
The contents of that file were previously inline in the module file but an earlier reviewer commented that it was a little confusing to have the module functions mixed up with the hook implementations. Having the separation is a little tidier I think so the minor overhead of an extra file include is arguably worth it from a maintainer/developer's point-of-view.
This function is basically a wrapper around
drupal_add_css()so the signature is the same except for an additional trailing argument for setting Crush options.Done.
These are not used in the module itself, but they are called internally by the Crush library.
Comment #31.0
pete-b commentedUpdating repo link as per suggestion.
Comment #32
pete-b commentedComment #33
kscheirerIt's been a month without any problems reported, so I'm promoting this myself as per https://drupal.org/node/1125818.
Thanks for your contribution, pete-b!
I updated your account to let you promote this to a full project and also create new projects as either a sandbox or a "full" project.
Here are some recommended readings to help with excellent maintainership:
You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and get involved!
Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
Thanks to the dedicated reviewer(s) as well.
----
Top Shelf Modules - Crafted, Curated, Contributed.
Comment #34
pete-b commentedThanks everyone :)