Closed (won't fix)
Project:
Drupal.org security advisory coverage applications
Component:
module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
18 Jun 2015 at 13:37 UTC
Updated:
22 Nov 2023 at 10:45 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
PA robot commentedThere are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandbox2dareis2do2275019git
We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)
Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #2
ayesh commentedHi Daniel,
Thanks for submitting this application. I'm not aware of such CSS resets modules either, and the aim of this module is clear and unique!
I have found a few points, but none of them are blocking issues. However, it's always good to clean them up to prevent buggy behavior and for best practices.
- Instead of using
hook_init(), usehook_page_build()to add the CSS reset file.hook_initis removed in D8, and in D7, hook_init is invoked on Ajax pages as well, but not cached.hook_page_buildis perfect to add CSS files because the output can be cached, and Drupal does not invoke it unless the page is serving full HTML.- This modules does not define any PHP classes. It's not necessary to use the
files[]in the module .info file to explicitly define them. It only adds some overhead to the code registry scanner.Comment #3
kamescg commentedIt's not necessary, but it can improve readability (IMHO) - store the "drupal_add_css" options in a $options variable.
$options = array(
'group' => CSS_SYSTEM,
'every_page' => TRUE,
'media' => 'all',
'preprocess' => TRUE,
'weight' => '-1001'
)
drupal_add_css($path . '/' . 'meyer.min.css', $options);
Comment #4
krknth commentedAttached patch for code formats & a tag issue
File : css_reset.module
Function : clear_cache_action
Please add comments incase you are using any drupal core functions.
Please fix code format issues
Line 48: String concatenation should be formatted with a space separating the operators (dot .) and the surrounding terms drupal_add_css($path . '/' . 'meyer.min.css',
File : css_reset.admin.inc
Please do not use a tags, use l() function to generate links.
Please fix code format issues
Line 24: Use an indent of 2 spaces, with no tabs
'#type' => 'checkbox',
Line 25: Use an indent of 2 spaces, with no tabs
'#title' => t('Enable Reset library site wide'),
Line 26: Use an indent of 2 spaces, with no tabs
'#default_value' => variable_get('css_reset_sitewide', FALSE),
Please add git clone link :)
Comment #5
2dareis2do commentedComment #6
2dareis2do commentedMany thanks for all your comments which I have to say have been very helpful.
Ayesh
As suggested I have replaced the use of hook_init(), with hook_page_build(). As you explained it makes much more sense from a caching/performance perspective. I have removed instances where I make use of files[] in the .info file.
kamescg
Your suggestion of replacing drupal_add_css" options with an $options variable to make the code more readable is a good one.
krknth
many thanks for your patch which I have applied. I have also addressed one of the code formatting options that you mention. Not sure what you mean by clear cache action?
PA Robot
I have re-packaged as a 7.x-1.x branch and addressed some of the issues identified by your scraper.
Hopefully you should also have git access? If not I have uploaded with the changes as a gunzip on the drupal project home page.
Comment #7
krknth commented@2dareis2do I mean add comment for function clear_cache_action ( if u agree :) )
Comment #8
2dareis2do commentedComment #9
2dareis2do commentedComment #10
gaja_daran commentedHi,
Fix all pareview issues.
Comment #11
2dareis2do commentedHi gaja,
Thanks for the tip,
I have addressed all the pareview (not preview, god I hate autocomplete) issues, (of which there were many) apart from:
FILE: /var/www/drupal-7-pareview/pareview_temp/css_reset.module
---------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
---------------------------------------------------------------------------
55 | WARNING | Do not use drupal_add_css() in hook_page_build(), use
| | #attached on the $page render array instead
---------------------------------------------------------------------------
which I think may be a false positive?
I have also addressed a few other issues including:
I need to investigate a bit more but I am also looking into setting up a simple test. This is new ground for me here so I need to research a bit further. Regardless, I hope that this module is moving closer to a full release?
Thanks for your support.
Comment #12
azeiteiro commentedManual Review
It is recommended to get the basic understanding of the module to new users.
Comment #13
2dareis2do commentedHi Azeiteiro
Thanks for your manual review. I have implemented hook_help as suggested. Certainly this makes sense.
I am not sure what you mean when you say "> Fix git url in your git clone command;" I have updated the link to be the same as the link provided. I am not sure how this works because I presume no one else has my password which is required to checkout/clone the files?
Comment #14
2dareis2do commentedComment #15
PA robot commentedFixed the git clone URL in the issue summary for non-maintainer users.
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #16
2dareis2do commentedOk great. Clever things these robots.
Also addressed a few formatting issues with the enclosed resets and spelling issues as shown on recent pareview report. Removed minified css file as this could not be processed.
Comment #17
thatpatguy commentedThis module appears to work as intended. As you stated above, there is a warning being thrown by pareview. Whether it's a false positive or not, I think you might need to check with the developers on IRC as to what they think. From what I understand, you are better off doing it the way you're doing it. Also, it's a warning and not an error. I don't know how strict those with approval permission are, however. You should check on IRC or something.
Also, I think included the Meyer reset.css might also violate the 3rd party assets/code requirements. Again you might want to check on IRC.
Lastly, I think this module would be even nicer if it just supported any custom css file created and uploaded into the css_reset directory in the library. Meyer's reset CSS is great, but I could see other applications where you'd want to use something else/something custom.
Automated Review
There is one warning in the code:
http://pareview.sh/pareview/httpgitdrupalorgsandboxhenryw2496335git
Manual Review
Individual user account
Yes: Follows the guidelines for individual user accounts.
No duplication
Yes: Does not cause module duplication and/or fragmentation.
Master Branch
Yes: Does follow the guidelines for master branch.
Licensing
Yes: Follows the licensing requirements.
3rd party assets/code
No: I could be wrong here, but I think by adding the meyer reset to your module goes against this requirement, where you should just point people to where to get it in your documentation (which you have also done). I appreciate that you added the file into your module to make it easier for the suer, but I believe this puts it in violation.
README.txt/README.md
Yes: Follows the guidelines for in-project documentation and/or the README Template.
Code long/complex enough for review
Yes: Follows the guidelines for project length and complexity.
Secure code
Yes: Meets the security requirements.
Comment #18
2dareis2do commentedMany thanks thatopatguy
I think the link you reference should be
http://pareview.sh/pareview/httpgitdrupalorgsandbox2dareis2do2275019git
Certainly the idea is you can use any reset of your choice including your own. I have renamed the file to reset.css and by default I have referenced meyer which I have also included as the default as well as my own variation by way of example.
Just checking on MeyerWeb and it says the following:
"If you want to use my reset styles, then feel free! It's all explicitly in the public domain (I have to formally say that or else people ask me about licensing). You can grab a copy of the file to use and tweak as fits you best. If you're more of the copy-and-paste type, or just want an in-page preview of what you'll be getting, here it is."
http://meyerweb.com/eric/tools/css/reset/
I will check on IRC as suggested if this is acceptable with regards the use of 3rd Party assets / and code. I will also check with regards the use of drupal_add_css() in hook_page_build(), (use | | #attached on the $page render array instead)
Comment #19
2dareis2do commentedAs suggested by paraview, I am trying to to replace drupal_add_css(), which works well, within hook_page_build() with #attached but seem to be having issues getting the form working. So I currently have:
However the attached stylesheet is not rendering. What am I doing wrong?
Comment #20
2dareis2do commentedOk I think I figured it out. I need to add:
so
Comment #21
2dareis2do commentedComment #22
nbouhid commentedAutomated Review
No issues identified http://pareview.sh/pareview/httpgitdrupalorgsandbox2dareis2do2275019git
Manual Review
css_reset.test
css_reset.module
css_reset.install
CSS files included
The starred items (*) are fairly big issues and warrant going back to Needs Work. Items marked with a plus sign (+) are important and should be addressed before a stable project release. The rest of the comments in the code walkthrough are recommendations.
Seems that is almost ready for being published. Only one major issue found.
If added, please don't remove the security tag, we keep that for statistics and to show examples of security problems.
This review uses the Project Application Review Template.
Comment #23
PA robot commentedClosing due to lack of activity. If you are still working on this application, you should fix all known problems and then set the status to "Needs review". (See also the project application workflow).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #24
avpaderno