This is an interesting module I want to contribute myself.

There are some minor things to be fixed, which I'm sending a patch:

  • Do not add .css on the .info file: if you add .css in the .info it will be added on every page. The correct way is via the form array (the way you are doing in code) or drupal_add_js(). Read: https://drupal.org/node/542202#stylesheets
  • Minor fixes on some comments.
  • There is no need for using if ($widget['type'] == 'addressfield_standard') { because you have only 1 widget. Moreover, after the if you return $form, which may be undefined. I've fixed it removing the conditional.
  • In function addressfield_autocomplete_field_attach_submit() there is $items = field_get_items(...). This may lead to a bug at the next line - foreach - because field_get_items() may return FALSE. I've fixed it adding a conditional before the foreach().
  • There are many coding standard mistakes at the JS file, for example not using lowerCamelCase for variable names. I've fixed only 2 of these variables.
  • A couple trailing spaces somewhere. Fixed.

The attached patch can be applied using git apply patchname.patch. This will keep the correct author information.

Comments

adammitchell’s picture

Status: Active » Closed (fixed)

Hi Mac_Weber,

Many thanks for reviewing the module and providing the patch, this has been applied to the project. I have also updated the js file to be more in keeping with Drupal's coding standards.

Regards,

Adam