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.
Default User Picture Styles allows you to apply image styles on the default user picture by providing you with a file id (a fid). It also enhances the default user picture field that comes bundled with Views by enabling you to apply any desired image style.
I could not find a module that could do this.
Drupal version: 7
Required modules: Views
Sandbox project: Link to project page
Git repository:
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/ibustos/1910268.git default_user_picture_styles
cd default_user_picture_styles
The project is intended for Drupal 7.
Comments
Comment #1
ycshen CreditAttribution: ycshen commentedReview of the 7.x-1.x branch:
This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.
Source: http://ventral.org/pareview - PAReview.sh online service
Comment #2
ibustosThank you ycshen! I'll have a look at them tomorrow night.
Comment #3
soap2013 CreditAttribution: soap2013 commentedThank you
Comment #4
ibustosNow compliant with Drupal coding standards. Thank you for your super fast feedback!!. CodeSniffer will still return problems for the Views handler class, but I had to comply with the Views nomenclature.
Comment #5
samail CreditAttribution: samail commentedHi ibustos,
Thx for the great module.
1) Effectively automated test is still throwing few errors related to views handler.
FILE: ...handlers/default_user_picture_styles_field_handler_image_or_default.inc
--------------------------------------------------------------------------------
FOUND 10 ERROR(S) AFFECTING 7 LINE(S)
--------------------------------------------------------------------------------
10 | ERROR | Class name must begin with a capital letter
10 | ERROR | Class name must use UpperCamel naming without underscores
13 | ERROR | Function comment short description must end with a full stop
15 | ERROR | No scope modifier specified for function "init"
22 | ERROR | Method name
| | "default_user_picture_styles_field_handler_image_or_default::options_form"
| | is not in lowerCamel format, it must not contain underscores
22 | ERROR | No scope modifier specified for function "options_form"
29 | ERROR | Method name
| | "default_user_picture_styles_field_handler_image_or_default::option_definition"
| | is not in lowerCamel format, it must not contain underscores
29 | ERROR | No scope modifier specified for function "option_definition"
37 | ERROR | No scope modifier specified for function "query"
49 | ERROR | No scope modifier specified for function "render"
--------------------------------------------------------------------------------
2) Manual review
* No error message after installing the module and nothing special in watchdog list ;-)
* There is no error message whatever i add in the "Default save location for default user images" field.
i think It would be great to add a validator.
* Otherwise code seems pretty nice ;-)
Thanks
Comment #6
ibustossamail,
Thank you so much for taking the time to review this module and helping me make it so much better. I just added a validation handler in order to verify the uri entered by the user.
Thank you so much!
Comment #7
tmctighe CreditAttribution: tmctighe commentedibustos,
1. As samail stated this module is still throwing pareview errors. The "Method name" errors you cannot fix (since they are extending Views which does not meet drupal standards) however the other 8 errors can be fixed.
2. Your Project Page could use some work. You've got some of the good basics (introduction, configuration) however some additional sections like Features, Similar Projects, and Documentation links would go a long way. A great read on this is at: http://drupal.org/node/997024
3. A Documentation Page would help a lot. This helps new users know how to use the module and can include any other useful information you might have for someone trying default user picture styles. Your README.txt already has most of this information. See #5 on this link: http://drupal.org/node/7765
Module installed and configured easily. I saw no errors.
4. Coding standards - across the board looks really solid. To get a little bit picky:
default_user_picture_styles.views.inc line 14 - For consistency sake it is best to use single quotes instead of double quotes in the t() text. Yeah, that's all I have because the rest of it looks solid.
5. Module functionality:
I don't understand the point of the "Default save location for default user images." field on the config page. Is this not the same value provided in the "Picture directory" field? I guess that this could allow you to save the default image in a separate directory from the images that are uploaded - if this is the goal then perhaps some kind of clarification that this is what it is for.
Other than that it seems to be solid.
Comment #8
ibustostmctighe,
Thank you so much for your valuable and great feedback. I fixed all the coding standards errors in the handler as you suggested.
I also improved the project page and added a documentation page.
Regarding the double quotes in line 14, since that string contains an apostrophe, I figured it was best to just use double quotes instead of escaping it. This is actually a good practice. See documentation for t().
You are so right about the save location. At first I thought it would be nice if I provided users with a way to specify the save location, but now I think I was just adding unneeded complexity to the module. That feature is now gone and now it just saves in the picture directory. Thank you for spotting that out!
Comment #9
veeraprasadd CreditAttribution: veeraprasadd commentedHi ibustos,
I have reviewed your module. There are some issues found when I do automated project review in ventral.org
-----
And noticed one minor thing while doing manual review.
File: default_user_picture_styles.module
Line 78: You can use hook_form_FORM_ID_alter() instead hook_form_alter(). Use default_user_picture_styles_form_user_admin_settings_alter() instead default_user_picture_styles_form_alter and then no need the form ID check condition in Line 79.
Thanks and Regards,
D. Veera Prasad.
www.drup-all.com
Comment #10
ibustosVeeraprasadd,
Thank you so much for your feedback!. I updated the form alter as you suggested.
In addition, Ventral shows two errors related to the Views handler. Really nothing I can do to fix that for it extends a Views class.
Comment #11
seworthi CreditAttribution: seworthi commentedIn "DUPStylesFieldHandler.inc" the init(), options_form(), and option_definition() are not needed, as they do nothing in your handler. Rest of module looks good.
Comment #12
kscheirerAgree with seworthi in #24 - you don't need those methods if you're just calling the parent method. You can safely remove those functions and it will operate the same. That's a minor issue though, looks like a handy little module.
Thanks for your contribution, ibustos!
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 #13.0
(not verified) CreditAttribution: commentedAdded the git repository. I forgot.