Description

CSS Autoload loads css based on what is loaded on the page. Let's say you have styling for a sidebar, than this styling will only be loaded if that region is loaded. The module can be enabled/disabled per theme.

Link to sandbox page

https://www.drupal.org/sandbox/48/2567459

Git clone command:

git clone --branch 7.x-1.x http://git.drupal.org/sandbox/48/2567459.git css_autoload
cd css_autoload

Link to Pareview review:

http://pareview.sh/pareview/httpgitdrupalorgsandbox482567459git

CommentFileSizeAuthor
#9 testtheme_and_view.zip60.37 KBmartijn.cuppens
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

puyol created an issue. See original summary.

martijn.cuppens’s picture

Issue summary: View changes
PA robot’s picture

Status: Needs review » Needs work

There are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandbox482567459git

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.

martijn.cuppens’s picture

Assigned: Unassigned » martijn.cuppens
martijn.cuppens’s picture

Status: Needs work » Needs review
dilshad.khan’s picture

Please provide the git clone url in your issue summary.

ivanzhu’s picture

In a word, This is a very useful module in some cases. I like it.

1. Still have some errors at http://pareview.sh/pareview/httpgitdrupalorgsandbox482567459git .
2. It's better to implement hook_help in code ,

That's all.

martijn.cuppens’s picture

Issue summary: View changes
martijn.cuppens’s picture

FileSize
60.37 KB

Testtheme and testview added as attachment

PA robot’s picture

Issue summary: View changes

Fixed 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.

Danny_Joris’s picture

Automated Review

Looks good: http://pareview.sh/pareview/httpgitdrupalorgsandbox482567459git-7x-1x

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: Follows the guidelines for master branch.
Licensing
Yes: Follows the licensing requirements.
3rd party assets/code
Yes: Follows the guidelines for 3rd party assets/code.
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.
Coding style & Drupal API usage
  1. No major issues or blockers found.
  2. Thanks for including a theme to test the module with. That was very helpful.
  3. In css_autoload.module there's two function arguments that could be documented in the PHPDoc comment.
  4. I may be behind on what is proper coding style, but should an array variable first be defined as an array before you add values to it? Should it include a $files = array(); or $files = []; before $files[] = 'foobar';? Not sure if that depends on D7 coding standards or just PHP versions.
  5. Personally I think it's ok to skip the step of enabling the module per theme. If the module(s) is/are enabled I think it's ok just to look for autoload CSS files in the themes.
  6. One thing you could include is the ability to define the autoload CSS path in the theme's info file, like: css_autoload_path = css/autoload. That way the path defined in the admin page could be a default to try if it's not set in the theme's info file.
  7. Adding a hook_help() function would be helpful.
  8. Overall I really like it. It's simple and clever!

This review uses the Project Application Review Template.

martijn.cuppens’s picture

Danny_Joris, thanks for the feedback. It looks like it's not needed to define a variable as an array before adding values to it, other contrib modules also don't do that.

Changes made today:

  • hook_help() function added
  • Removed functionality to enable/disable per theme
  • Autoload folder can be overridden in theme.info-file with variable css_autoload_path
  • Arguments declared in autoload.module
yonko.tsvetkov’s picture

Automated Review

No errors and warnings: http://pareview.sh/pareview/httpgitdrupalorgsandbox482567459git

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: Follows the guidelines for master branch.
Licensing
Yes: Follows the licensing requirements.
3rd party assets/code
Yes: Follows the guidelines for 3rd party assets/code.
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.
Coding style & Drupal API usage
1. You might change the configure path in css_autoload.info to admin/config/development/css-autoload

This review uses the Project Application Review Template.

martijn.cuppens’s picture

Configure path corrected

hesnvabr’s picture

I found this issue in css_autoload.module

FILE: /var/www/drupal-7-pb/pb_temp/css_autoload.module
---------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------
163 | ERROR | [x] Inline comments must end in full-stops, exclamation
| | marks, colons, or question marks
---------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------

klausi’s picture

@pranavbabbar: I think you forgot to change the status. Is this now RTBC after your review or are there application blockers left?

hesnvabr’s picture

In css_autoload.info file add the regions after that this siderbar issue may be resolve

gisle’s picture

Assigned: martijn.cuppens » Unassigned

Please don't assign the application issue to yourself if you want other people to review it. Please see this page about assigning ownership to issues.

John Lawter’s picture

Automated Review

No issues identified by pareview.sh

http://pareview.sh/pareview/httpgitdrupalorgsandbox482567459git

I also ran the code though Coder / Coder Tough Love with the review set to look for minor issues. The only errors reported are false positives pertaining to end-user strings not using sentence case. I reviewed the strings in question and determined that titles case appears appropriate. So this check passes as well.

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: Follows the guidelines for master branch.
Licensing
Yes: Follows the licensing requirements.
3rd party assets/code
Yes: Follows the guidelines for 3rd party assets/code.
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.
Coding style & Drupal API usage
List of identified issues in no particular order. Use (*) and (+) to indicate an issue importance. Replace the text below by the issues themselves:
  1. Line 21 in README.txt shows two non-ASCII characters. This may be an issue on my end becuse I checked out the project to a Windows machine. If possible, these two characters should be replaced with ">" Just a recommendation.

    Configuration in Administration » Development » CSS Autoload settings:

  2. No major issues or blockers found.
  3. Minor typo in README.txt: Change spelling of "witch" to "which" on line 23.
  4. I would like to suggest that the way to use it could be made clearer on the help page and/or README.txt. After looking at the code, I saw that it was looking at the files array being loaded on each page, then attempting to load any files with that name followed by .autoload.css located in the Autoload path found in settings, or as indicted in the Theme's info file. For instance, I created a test block, block 1, and placed the CSS for it in {theme}/css/autoload/block--1.autoload.css. Once I did that, it worked like a charm. Tht CSS file loaded only on pages where the block was placed, but not on other pages. Nice functionality. I just think if the usage could be made clearer, it would be helpful.
  5. Change line 49 in css_autoload.module from to "Adds css to the page when a block is displayed on a page." to "Adds css to the page when a field is displayed on a page."
  6. Looking good, overall! Just a few minor suggestions before being RTBC.

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.

martijn.cuppens’s picture

@pranavbabbar & @john-lawter,
Thanks for your reviews, I've corrected the issues you mentioned.

djalxs’s picture

Status: Needs review » Reviewed & tested by the community

PAReview passes and a manual inspection of the code as well as XSS tests pass. I have also tested the module functionality wise and everything seems in order so I'm setting this to RTBC.

kattekrab’s picture

@puyol - You can now promote this to a full project yourself.

apaderno’s picture

Assigned: Unassigned » apaderno
Status: Reviewed & tested by the community » Fixed

Thank you for your contribution! I will update your account so you can opt into security advisory coverage now.

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 stay involved!

Thank you, 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 go the dedicated reviewer(s) as well.

klausi’s picture

Assigning credits.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.