Simple module that gives option to add attributes for options in select box.

Sandbox URL: http://drupal.org/sandbox/vijaycs85/1340952

git clone --branch 6.x-1.x http://git.drupal.org/sandbox/vijaycs85/1340952.git options_attributes

CommentFileSizeAuthor
select_option_attr.jpg12.38 KBvijaycs85

Comments

devsaran’s picture

Great module.
Going to test the module.

Before that, I found README.txt is missing in your module.

Every contributed module should provide a README.txt in the package. This file should contain a basic overview of what the module does and how someone may use it.

--------------------
Saran Dev,
Doing B.Tech I.T,
Coimbatore.

vijaycs85’s picture

Hi saran.quardz,

Thank you for your time. Added README.txt file. Please have a look.

raynimmo’s picture

Master Branch
It appears you are working in the "master" branch in git. You should really be working in a version specific branch. The most direct documentation on this is Moving from a master branch to a version branch. For additional resources please see the documentation about release naming conventions and creating a branch in git.

Automated Review

  • Lines in README.txt should not exceed 80 characters, see the guidelines for in-project documentation.
  • Comments: there should be a space after "//", see http://drupal.org/node/1354#inline
    options_attributes.module:18:    //Theme for the drop-down.
    options_attributes.module:31:  //Setting the size of the element.
    options_attributes.module:33:  //Setting class for the drop-down
    options_attributes.module:36:  //Form element theme called and returned.
    options_attributes.module:91:  //get all forms for elements of tye select and append custom theme to them.
    options_attributes.module:94:      //TODO: append, if there any other theme function
    
  • ./options_attributes.module: comment lines should break at 80 characters, see http://drupal.org/node/1354#general
      // array_key_exists() accommodates the rare event where $element['#value'] is NULL.
    
  • ./options_attributes.module: The description on the line after the @param/@return documentation is either missing or not formatted correctly. See http://drupal.org/node/1354#functions
    48- */
    
  • All text files should end in a single newline (\n). See http://drupal.org/node/318#indenting
    ./options_attributes.info ./options_attributes.module ./README.txt
    

This automated report was generated with PAReview.sh, your friendly project application review script. Go and review some other project applications, so we can get back to yours sooner.

raynimmo’s picture

Status: Needs review » Needs work
vijaycs85’s picture

Status: Needs work » Needs review

Thanks for the report raynimmo. I have fixed the code and moved to version specific branch.

Please let me know, if you have any other thoughts.

raynimmo’s picture

Status: Needs review » Needs work

There are still a couple of minor points you should maybe address.

Automated Review

This automated report was generated with PAReview.sh, your friendly project application review script. Go and review some other project applications, so we can get back to yours sooner.

Manual Review

Also ran it through with Coder using all settings including 'Coder Tough Love', nothing reported back, well done.

Other than those two minor points everything else seems in order.

Good luck with the rest of yoir review.

vijaycs85’s picture

Status: Needs work » Needs review

Thank you for the review raynimmo. I have made the requested changes and ran coder.

Thank you.

Vijayachandran.

doitDave’s picture

Status: Needs review » Needs work

Automated review (Please keep in mind that this is primarily a high level check that does not replace but, after all, eases the review process. There is no guarantee that no other issues could show up in a more in-depth manual follow-up review.)

Review of the 6.x-1.x branch:

  • Run coder to check your style, some issues were found (please check the Drupal coding standards):
    Severity minor, Drupal Commenting Standards, Internationalization, Drupal Security Checks, Drupal SQL Standards, Drupal Coding Standards
    
    sites/all/modules/pareview_temp/test_candidate/options_attributes.module:
     +6: [minor] There should be no trailing spaces
     +20: [minor] There should be no trailing spaces
     +27: [minor] There should be no trailing spaces
     +39: [minor] Comment should be read "Implements hook_foo()."
     +40: [minor] There should be no trailing spaces
     +48: [minor] Comment should be read "Implements hook_foo()."
     +49: [minor] There should be no trailing spaces
     +72: [minor] There should be no trailing spaces
     +73: [minor] There should be no trailing spaces
     +74: [minor] There should be no trailing spaces
     +82: [minor] There should be no trailing spaces
     +89: [minor] There should be no trailing spaces
     +118: [normal] String concatenation should be formatted with a space separating the operators (dot .) and the surrounding terms
     +133: [minor] There should be no trailing spaces
    
    Status Messages:
     Coder found 1 projects, 1 files, 1 normal warnings, 13 minor warnings, 0 warnings were flagged to be ignored
    
  • Drupal Code Sniffer has found some code style issues (please check the Drupal coding standards):
    
    FILE: ...ites/all/modules/pareview_temp/test_candidate/options_attributes.module
    --------------------------------------------------------------------------------
    FOUND 12 ERROR(S) AND 4 WARNING(S) AFFECTING 16 LINE(S)
    --------------------------------------------------------------------------------
       6 | ERROR   | Whitespace found at end of line
       9 | WARNING | Line exceeds 80 characters; contains 96 characters
      20 | ERROR   | Whitespace found at end of line
      27 | ERROR   | Whitespace found at end of line
      39 | WARNING | Format should be * Implements hook_foo().
      40 | ERROR   | Whitespace found at end of line
      48 | WARNING | Format should be * Implements hook_foo().
      49 | ERROR   | Whitespace found at end of line
      55 | WARNING | A comma should follow the last multiline array item. Found: )
      72 | ERROR   | Whitespace found at end of line
      73 | ERROR   | Whitespace found at end of line
      74 | ERROR   | Whitespace found at end of line
      82 | ERROR   | Whitespace found at end of line
      89 | ERROR   | Whitespace found at end of line
     118 | ERROR   | Concat operator must be surrounded by spaces
     133 | ERROR   | Whitespace found at end of line
    --------------------------------------------------------------------------------
    
  • Lines in README.txt should not exceed 80 characters, see the guidelines for in-project documentation.
  • Comments should be on a separate line before the code line, see http://drupal.org/node/1354#inline
    15: *        // list of options
    29: *        // Actual form element.
    
  • Bad line endings were found, always use unix style terminators. See http://drupal.org/coding-standards#indenting
    ./README.txt:                ASCII English text, with CRLF line terminators
    README.txt
    
  • All text files should end in a single newline (\n). See http://drupal.org/node/318#indenting
    ./README.txt
    

This automated report was generated with PAReview.sh, your friendly project application review script. Go and review some other project applications, so we can get back to yours sooner.

hth, dave

misc’s picture

@vijaycs85 has been contacted to ask if the application is abandoned.

After ten weeks with a status of needs work: the applicant may be contacted by a reviewer to determine whether the application was indeed abandoned. The action taken by the reviewer should be documented in the project application issue.

http://drupal.org/node/894256

vijaycs85’s picture

Status: Needs work » Postponed

Hi MiSc,

Thanks for your mail. As mentioned in my mail, I will resume this when I get time. For now, changing status to postponed.

Thank you.

Regards,
Vijay.

vijaycs85’s picture

Status: Postponed » Needs review

Fixed code review fixes in #8. Please review and let me know if any issues.

Thank you.

Regards,
Vijay.

misc’s picture

You still need to fix the master branch as is says in commment #3, and you missed some stuff in the coding standards, and some things where added:

options_attributes.module
--------------------------------------------------------------------------------
FOUND 7 ERROR(S) AND 1 WARNING(S) AFFECTING 7 LINE(S)
--------------------------------------------------------------------------------
  48 | WARNING | Format should be "* Implements hook_foo()." or "Implements
     |         | hook_foo_BAR_ID_bar() for xyz_bar()."
  55 | ERROR   | Array indentation error, expected 6 spaces but found 7
  81 | ERROR   | There must be an empty line before the parameter block
  81 | ERROR   | Missing parameter type at position 1
  83 | ERROR   | Missing parameter type at position 2
  86 | ERROR   | Data type of return value is missing
  87 | ERROR   | Return comment indentation must be 2 additional spaces
 148 | ERROR   | Files must end in a single new line character
--------------------------------------------------------------------------------
vijaycs85’s picture

I stopped working on master branch long back. 6.x is up to date. Should I remove changes from master?

misc’s picture

You should remove all the files from the Master branch and just add a README.txt that points the users to the right branch.

vijaycs85’s picture

Updated master as advised in #14. please review and let me know, if any other issues.

c-logemann’s picture

Assigned: Unassigned » c-logemann

Assigned to myself to show I am working on manual review.

c-logemann’s picture

Assigned: c-logemann » Unassigned
Status: Needs review » Needs work

Manual review

Documentation Issue:

Here and in your README.txt you write only one sentence to explain. And on the project page you are only showing an image. Please give us more information:
A detailed description of what your project does, including how it is different from other, similar projects, if applicable. - http://drupal.org/node/1011698
After checking your code I have an idea what your module is doing. It's an helping module to improve theming option lists. Is this right?

I think a sitebuilder without programming skills can't use this module and have a bad experience if trying. So please make this clear in your module description. I think moving the "usage description" from the module file to README.txt would be better. And maybe add a link to form API documentation.

Please change git link in issue summary to public access:
git clone --branch 6.x-1.x http://git.drupal.org/sandbox/vijaycs85/1340952.git options_attributes
And maybe add a link to pareview.

Code questions

I seems that this module is only an API for extending forms with hook_form or hook_form_alter. This is the reason why I have not tested the funtionality yet. But when I am think about your strategy there might be a problem with hook_form_alter of other modules. I think you have to deal with module weights to make sure your hook is called after the custom alter of your user?
Is it necessary to add yout theme on every form (options_attributes_add_theme(&$form)) even if it's not containing any options especially your special addon?

Automatic Code Review:

There are some conding standard issues reported:
http://ventral.org/pareview/httpgitdrupalorgsandboxvijaycs851340952git

vijaycs85’s picture

Nice work C_Logemann. I will update you once done with my changes.

klausi’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.

vijaycs85’s picture

Assigned: Unassigned » vijaycs85
Status: Closed (won't fix) » Needs work
vijaycs85’s picture

Issue summary: View changes

git instruction change, so check out from version specific branch instead of master.

vijaycs85’s picture

Hello,

Reply for #17:

1. Moved usage to readme.txt. It was in readme and I moved to module because I read some restriction on number of characters in readme file. However, I moved back now.

2. Added a note in readme.txt that its for developers (not site builders).

3. Update link

4. Yes, we do scan the form and check for select element with #option_attributes set. It would be costly, if we do these check on

vijaycs85’s picture

Assigned: vijaycs85 » Unassigned
Status: Needs work » Needs review
jdjeet’s picture

Status: Needs review » Needs work

Hey, I guess I took the right link to Vendral.

http://git.drupal.org/sandbox/vijaycs85/1340952.git

There are still small errors in doc, info and options_attributes.module file

I did some manual review. found the same as of Vendral..
Once you fix them we can review at once.

klausi’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.

If you reopen this please keep in mind that 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 :-)

klausi’s picture

Issue summary: View changes

updating git link to public accessible link.