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

ycshen’s picture

Status: Needs review » Needs work

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


FILE: /var/www/drupal-7-pareview/pareview_temp/README.txt
--------------------------------------------------------------------------------
FOUND 1 ERROR(S) AND 6 WARNING(S) AFFECTING 7 LINE(S)
--------------------------------------------------------------------------------
  9 | WARNING | Line exceeds 80 characters; contains 82 characters
 10 | WARNING | Line exceeds 80 characters; contains 85 characters
 11 | WARNING | Line exceeds 80 characters; contains 84 characters
 26 | WARNING | Line exceeds 80 characters; contains 87 characters
 27 | WARNING | Line exceeds 80 characters; contains 85 characters
 32 | WARNING | Line exceeds 80 characters; contains 90 characters
 33 | ERROR   | Files must end in a single new line character
--------------------------------------------------------------------------------


FILE: ...ar/www/drupal-7-pareview/pareview_temp/default_user_picture_styles.info
--------------------------------------------------------------------------------
FOUND 5 ERROR(S) AFFECTING 5 LINE(S)
--------------------------------------------------------------------------------
  7 | ERROR | It's only necessary to declare files[] if they declare a class or
    |       | interface.
  8 | ERROR | Declared file was not found
  9 | ERROR | It's only necessary to declare files[] if they declare a class or
    |       | interface.
 10 | ERROR | It's only necessary to declare files[] if they declare a class or
    |       | interface.
 11 | ERROR | Files must end in a single new line character
--------------------------------------------------------------------------------


FILE: ...www/drupal-7-pareview/pareview_temp/default_user_picture_styles.install
--------------------------------------------------------------------------------
FOUND 0 ERROR(S) AND 3 WARNING(S) AFFECTING 3 LINE(S)
--------------------------------------------------------------------------------
 4 | WARNING | Line exceeds 80 characters; contains 82 characters
 5 | WARNING | Line exceeds 80 characters; contains 85 characters
 6 | WARNING | Line exceeds 80 characters; contains 82 characters
--------------------------------------------------------------------------------


FILE: .../www/drupal-7-pareview/pareview_temp/default_user_picture_styles.module
--------------------------------------------------------------------------------
FOUND 8 ERROR(S) AND 1 WARNING(S) AFFECTING 6 LINE(S)
--------------------------------------------------------------------------------
 34 | ERROR   | Function comment short description must be on a single line
 36 | ERROR   | There must be an empty line before the parameter block
 36 | ERROR   | Missing parameter type at position 1
 51 | ERROR   | Function comment short description must be on a single line
 53 | ERROR   | There must be an empty line before the parameter block
 53 | ERROR   | Missing parameter type at position 1
 76 | WARNING | Format should be "* Implements hook_foo().", "* Implements
    |         | hook_foo_BAR_ID_bar() for xyz_bar().", or "* Implements
    |         | hook_foo_BAR_ID_bar() for xyz_bar.tpl.php.".
 76 | ERROR   | Function comment short description must end with a full stop
 94 | ERROR   | Function comment short description must end with a full stop
--------------------------------------------------------------------------------


FILE: ...al-7-pareview/pareview_temp/views/default_user_picture_styles.views.inc
--------------------------------------------------------------------------------
FOUND 1 ERROR(S) AND 3 WARNING(S) AFFECTING 3 LINE(S)
--------------------------------------------------------------------------------
  8 | WARNING | Format should be "* Implements hook_foo().", "* Implements
    |         | hook_foo_BAR_ID_bar() for xyz_bar().", or "* Implements
    |         | hook_foo_BAR_ID_bar() for xyz_bar.tpl.php.".
  8 | ERROR   | Function comment short description must end with a full stop
 14 | WARNING | Avoid backslash escaping in translatable strings when possible,
    |         | use "" quotes instead
 16 | WARNING | A comma should follow the last multiline array item. Found:
    |         | 'default_user_picture_styles_field_handler_image_or_default'
--------------------------------------------------------------------------------


FILE: ...handlers/default_user_picture_styles_field_handler_image_or_default.inc
--------------------------------------------------------------------------------
FOUND 14 ERROR(S) AFFECTING 6 LINE(S)
--------------------------------------------------------------------------------
 10 | ERROR | Class name must begin with a capital letter
 10 | ERROR | Class name must use UpperCamel naming without underscores
 11 | ERROR | Missing function doc comment
 11 | ERROR | No scope modifier specified for function "init"
 15 | ERROR | Missing function doc comment
 15 | ERROR | Method name
    |       | "default_user_picture_styles_field_handler_image_or_default::options_form"
    |       | is not in lowerCamel format, it must not contain underscores
 15 | ERROR | No scope modifier specified for function "options_form"
 19 | ERROR | Missing function doc comment
 19 | ERROR | Method name
    |       | "default_user_picture_styles_field_handler_image_or_default::option_definition"
    |       | is not in lowerCamel format, it must not contain underscores
 19 | ERROR | No scope modifier specified for function "option_definition"
 24 | ERROR | Missing function doc comment
 24 | ERROR | No scope modifier specified for function "query"
 33 | ERROR | Missing function doc comment
 33 | ERROR | No scope modifier specified for function "render"
--------------------------------------------------------------------------------

Source: http://ventral.org/pareview - PAReview.sh online service

ibustos’s picture

Thank you ycshen! I'll have a look at them tomorrow night.

soap2013’s picture

Thank you

ibustos’s picture

Status: Needs work » Needs review

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

samail’s picture

Status: Needs review » Needs work

Hi 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

ibustos’s picture

Status: Needs work » Needs review

samail,

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!

tmctighe’s picture

Status: Needs review » Needs work

ibustos,

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.

ibustos’s picture

Status: Needs work » Needs review

tmctighe,

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!

veeraprasadd’s picture

Hi 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

ibustos’s picture

Veeraprasadd,

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.

seworthi’s picture

Status: Needs review » Reviewed & tested by the community

In "DUPStylesFieldHandler.inc" the init(), options_form(), and option_definition() are not needed, as they do nothing in your handler. Rest of module looks good.

kscheirer’s picture

Title: default user picture styles » [D7] Default User Picture Styles
Status: Reviewed & tested by the community » Fixed

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

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

Added the git repository. I forgot.