A standalone Drupal 7.x module for creating and assigning Rank and Decorations to Drupal users that have been designated as Clan members. The module relates to gaming groups or clans that want to organize their members and assign awards pins.

Project Line: Clan Rank and Decoration
Git Repo: git clone http://git.drupal.org/sandbox/gflamino/1803994.git clan_rank_and_decorations

Demonstration site: http://clantastic.newnetwork.cc

-- CONFIGURATION --

Upon installation a new Clan Roster link will be visible in the Navigation menu.

Configuration (from README.txt)

1. As administrator, select the registered Drupal user to include in
the Clan Roster (Navigation Menu > Clan Roster > Edit Roster)
2. Define Ranks and Awards (Navigation Menu > Clan Roster > Rank Maintenance or
> Award Maintenance). Feel free to use the preload definitions.
3. Assign Ranks and Awards to individual Clan Roster members (Navigation Menu >
Clan Roster > Mass Rank Assign or > Mass Award Assign)

Review of other projects:

Comments

gflamino’s picture

Issue summary: View changes

added project reviewed.

gflamino’s picture

Issue summary: View changes

add project review and link to demo site.

weebpal’s picture

StatusFileSize
new35.14 KB

Hi Gflamino,

- Your project is quite big, but the information we can read in your sandbox page is too little, please update it to help user easy to understand what is this project work for.
- Please check your project about Drupal Coding standard

Regards,
Steve Jan

issa.haddadin’s picture

Hello,

I did an automated project review for you, and i got some errors and warnings, please try to fix them.
http://ventral.org/pareview/httpgitdrupalorgsandboxgflamino1803994git

Good Luck.

gflamino’s picture

Fixed.

Those 'errors' that remain are really data files (not code) that are used to pre-populate the tables. Makes it easier for users to get going. I won't be fixing these.

gflamino’s picture

Status: Needs review » Fixed

Hi Steve (and issahh),

Thank you for taking the time to review this project for me. I have updated the Sandbox page a bit to describe the project (and cut-and-pasted the relevant README.txt file's content).

This is a simple non-Core / non-commercial module. It is intended for entertainment purposes only. I am not looking for a collaborator or assistance in maintaining the code.

gflamino’s picture

Status: Fixed » Needs review

think i don't get the status process here. moved back to needs review.

gflamino’s picture

Issue summary: View changes

updated repo link

adamelleston’s picture

Database tables
One thing with your db table names is that they are not all prefixed with your module name. I can see why you have probably not done this due to the length of the module. Maybe renaming the module to an acronym so its shorter? - http://drupal.org/node/2497#naming

Suggestion
I like the idea of being able to load dummy data, I wonder if there is a way to extend devel and devel generate. So you split your project into 2 modules. 1 for the actual functionality and one as a devel clan generate module. I think that would be awesome.

Spacing
There seems to be a lot of spacing between some array elements keys and values such as line 25 and 26 of your module file

      'title'          => t('View Clan Users'),
      'description'    => t('Allow users to view member details.'),

I believe this should just be one space either side of =>

Errors after install
Install went fine but when I went to the following URL I got the following error messages

clan_rank_and_decorations/member/roster

Notice: Undefined variable: default_value in clan_rank_and_decorations_roster() (line 487 of /vagrant/websites/blank.dev/public_html/sites/all/modules/contrib/clan_rank_and_decorations/clan_rank_and_decorations.members.inc).
Warning: Invalid argument supplied for foreach() in form_type_tableselect_value() (line 2331 of /vagrant/websites/blank.dev/public_html/includes/form.inc).

I think this may have been related to my site only having a single user (uid: 1)

When I added a user to the clan the default image was missing /sites/default/files/clantastic/images/a0.png

Git folder in repo
There seems to be a folder "git.drupal.org sandbox" in the repo when I cloned it.

Overall
Other than the above the module works really well, the code looks good overall. My only suggestions would be to show the users clan info, rank, awards on their user profile maybe create a tab on their user page.

Remove the excess whitespace, rename the module or database tables and get rid of the "git.drupal.org sandbox" directory and I think its all good.

gflamino’s picture

Hi Adam,

Thanks for taking the time to review my module - some good, clear comments.

I believe I've ticked off all of your concerns:

  1. Using proper naming conventions for database tables. ALSO, renamed project to 'clantastic' making the naming of these tables a snap too. Not sure what I was thinking with the stupid long name I gave this project originally. ;)
  2. I like your twist on dummy data. Including dummy data in this app makes getting started simpler but having it external would be much better in general. Gonna look at this more - I have another project that has similar requirements.
  3. Removed all extraneous spaces when assigning variables values and array key pairs.
  4. Good catch. Hadn't thought to test a virgin install.
  5. Removed extraneous folder ("git.drupal.org sandbox").
  6. Doing the hook to the user profile makes sense.

Thanks again!

Gil

roynilanjan’s picture

Status: Needs review » Needs work

Please have a look some code observation of technical point of view

  • Why keep the page arguments => array() from page callback function you can always get the dynamic argument from $_POST
    or $_REQUEST if you want
  • what is significance of this query to adjust the weight,
    db_update('system')
         ->fields(array('weight' => 999))
         ->condition('name', 'clantastic')
         ->execute();
    

    keep it in the default behavior of this module weight.. because I think you have use system module function(system_admin_menu_block_page) in your custom callback(admin/config/clantastic_) but the url is different so in the execution of this function only depend on the url

  • gflamino’s picture

    Status: Needs work » Fixed

    Roynilanjan, thank you for taking the time to review.

    Removed: extraneous update of the system table (no longer necessary).
    Fixed: a couple of bugs (i.e. 'admin/config/clantastic_') related to renaming the module to 'clantastic' (good catch!).

    klausi’s picture

    Status: Fixed » Needs review

    This application is not fixed? See http://drupal.org/node/532400

    We 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 :-)

    scott weston’s picture

    Status: Needs review » Needs work
    StatusFileSize
    new62.41 KB

    I have manually reviewed the module there are a few items that I noticed:

    • The functions to uninstall should be included in module_uninstall() wihtin the MODULE.install file, not a separate file. Note that tables created during installation are removed automatically by the uninstaller.
    • "module_load_include('inc', 'clantastic', '/includes/custom_functions');": no need to use module_load_include as you are including files from your own module which you already know where they are. Use something like require_once 'includes/custom_functions.inc';
    • clantastic_fetch_clantastic_member_value(): Do not use db_select() for simple static queries, use db_query() instead. See http://drupal.org/node/310075 . Also elsewhere within the module files.

    There are numerous spelling errors in the inline comments. In clantastic.admin.inc:

    • Line 18: * Award id to be editted. (should be edited)
    • Line 35: * Award id to be editted. (should be edited)
    • Line 38: // Get memeber details. (should be member)
    • And others

    When editing a member, I received the following errors:

    • Notice: Undefined variable: default_value in clantastic_member_detail_edit() (line 99 of /sites/all/modules/contrib/clantastic/clantastic.members.inc).
    • Warning: Invalid argument supplied for foreach() in form_type_tableselect_value() (line 2335 of /includes/form.inc).

    (See attached Image)

    PA robot’s picture

    Status: Needs work » Closed (won't fix)

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

    PA robot’s picture

    Issue summary: View changes

    added Configuration how-to instructions.