Description

A Drupal module with some node add-ons. Theses include the following:
A simple module to add to your site that lets you specify a default value to be cleared on click, and to reappear when the input is left empty 

This module enables admin user to pre-populate text, and textarea form fields with values to describe users how to fill in the form the way the admin users would like it to be.
Example, link text field: you could add -> http:// 

Admin user will be enable to fill in the setting page form (admin/settings/autofill) and save the information in the system.
Use a web tool like Firebug etc. to access the source code and then you'll be able to copy the textfield/textarea class or ID and paste it into the field that says ID

Link to module: http://drupal.org/sandbox/rui/1176850

CommentFileSizeAuthor
#17 drupalcs-result.txt1.09 KBklausi

Comments

rcb.ferreira’s picture

Title: Autofull » Autofill
rcb.ferreira’s picture

Assigned: rcb.ferreira » Unassigned
ivanbreet’s picture

Priority: Normal » Critical

Priority update as per http://drupal.org/node/894256

davisben’s picture

Priority: Critical » Normal
Status: Needs review » Needs work

Hi rcb.ferreira,
It appears that your git repo for the 6.x-1.x branch is missing js/autofill.js, so the module is not working properly. Please add that file to the repository, and set this back to Needs Review. Thanks!

rcb.ferreira’s picture

Status: Needs work » Needs review

Thank you for taking the time to review this module.

You don't need autofill.js to use the Autofill module, because you can add the data under the Autofill settings page. I included the path "js/autofill.js" as a way to override the system generated Autofill JS code. I took this approach because I needed a way to GIT commit changes for this modules autofill data which would otherwise reside in the database.

dave reid’s picture

The file http://drupalcode.org/sandbox/rui/1176850.git/blob/refs/heads/6.x-1.x:/j... looks like it is an external library?

From the Drupal.org Git usage policy:

DO NOT include code from a non-Drupal project in the repository. If your module requires non-Drupal code, such as a third-party JavaScript/PHP library, provide a link to where the other code can be downloaded and instructions on how to install it.

minnur’s picture

Status: Needs review » Needs work

Hi Rui,

1. Lines in README.txt should not exceed 80 characters.
And rename README to README.txt.

2. "if (empty($field['id']))" always use "{}" around if/else statements, even if it is just one line.
This often leads to bugs if you add lines later. The same rule applies for "for (), while (), foreach ()"

3. For some reason I don't see this module on your profile page.

Thanks,

Minnur

rcb.ferreira’s picture

Status: Needs work » Needs review
patrickd’s picture

Status: Needs review » Needs work

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

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.

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

rcb.ferreira’s picture

Status: Needs work » Needs review

Made necessary changes as requested.

Thank you for taking the time to review my module.

patrickd’s picture

rcb.ferreira’s picture

Status: Needs work » Needs review

Thank you for taking the time to review my module.

I used the online drupal code sniffer, it's getting errors I really can't see what's the problem.
I made all the necessary changes. And still it's getting a few errors.

Could someone just have a look and let me know if I'm doing something wrong, thank you very much.

patrickd’s picture

Status: Needs review » Needs work

autofill.module:
+46: [minor] Missing parenthesis after function name

* Implements hook_perm.
->
* Implements hook_perm().

autofill.admin.inc
86 | ERROR | Constants must be uppercase; expected SPECIFIC but found specific
86 | ERROR | Constants must be uppercase; expected GENERAL but found general

Be aware of using unescaped " in a string with "" ;-)
form_error($form, t("%field-id doesn\'t contain a CSS class or ID identifier (e.g. <em>#specific</em> for <em>id="specific"</em> and <em>.general</em> for <em>class="general"</em>).", array('%field-id' => $fields[$delta]['id'])));
->

form_error($form, t('%field-id doesn\'t contain a CSS class or ID identifier (e.g. <em>#specific</em> for <em>id="specific"</em> and <em>.general</em> for <em>class="general"</em>).', array('%field-id' => $fields[$delta]['id'])));

js/sample.js
21 | ERROR | Files must end in a single new line character
add an empty line to the end of this file

patrickd’s picture

Status: Needs work » Needs review

Switched back to needs review, so in-depth reviews won't be blocked by coding standart issues.

patrickd’s picture

// double post, sorry, internet was hanging.

jthorson’s picture

Status: Needs review » Reviewed & tested by the community

Did a fairly quick review, but everything looks good!

klausi’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +PAreview: security
StatusFileSize
new1.09 KB

Review of the 6.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. Go and review some other project applications, so we can get back to yours sooner.

manual review:

  • sample.js: always use 2 spaces per level for indentation, not one.
  • autofill_js(): Function doc block is wrong.
  • autofill_menu(): why do you need drupal_get_path() there? "/autofill" as path prefix should also do it.
  • autofill_js(): you should use drupal_json() here.
  • The page callbck to autofill_js() is unprotected. This means that anyone can retrieve a list of default form values used on your site. So you must never use sensitive information in your default values, as this can be leaked to anyone. This must be clearly stated at the project page. Or you could make it more secure: the ajax call passes the a path argument to Drupal and your page callback checks if the user even has access to that path. Of course this would mean that you only return default values for that particular path and not just everything. You would have to store path information with your default values.
  • autofill_form(): this is not a hook, this is a form constructor. See http://drupal.org/node/1354#forms
  • autofill_settings_form_validate(): indentation errors, always use 2 spaces per level, not 3.
misc’s picture

This application has been marked as 'needs work' for 19 weeks, and there is no contact form on the users profile page. I am closing this on.

@rcb.ferreira, if this is wrong, please reopen.

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.