CVS edit link for mearnest

Trees for Life has created modules integrating Ubercart, Location and Salesforce, and we want to make these available to the open source community.

uc_location integrates Ubercart and Location, and is ready to be released publicly.

Comments

mearnest’s picture

Component: Miscellaneous » Code
Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new5.41 KB

This is integration between Ubercart and the Location module.

Same code as in #590472: bibeksahu [bibeksahu]

avpaderno’s picture

Component: Code » Miscellaneous

As I have already written, first one application is approved, and then the other user may ask to get a CVS account to become co-maintainer of the module (in the case the first application is approved).

Having two different applications for the same module is only confusing.

avpaderno’s picture

Status: Needs review » Needs work
  1. The module should use Drupal Unicode functions, when there is such functions.
  2. The indentation used in some cases is not two spaces.
  3.   foreach ($user->locations as $location) {
    

    That code would cause an error wrong argument passed to foreach(), in the case $user->locations is undefined.

  4.     '#attributes' => array('onchange' => 'apply_address(\''. $type .'\', this.value); '),
    

    The code should use a different method to attach a JavaScript function to a form field event (it could use Drupal behaviors, in example).

mearnest’s picture

Status: Needs work » Needs review
StatusFileSize
new6.24 KB

Applied the four suggestions mentioned above in #3. Attached is the resubmission.

avpaderno’s picture

Status: Needs review » Fixed
  1. If you are going to unconditionally include a PHP file, it would be better to merge it with the module file.
  2. Drupal Unicode functions include also drupal_strlen(), which should be used instead of strlen().
  3. function _uc_location_order_to_location(&$order, $type) {
      // Queries database for the zone code and name based on order zone number.
      $zone = db_fetch_object(db_query("SELECT zone_code, zone_name FROM {uc_zones} WHERE zone_id = %d", 
                                       $order->{$type .'_zone'})
                                      );
      // Queries database for the country iso code and name based on order country number.
      $country = db_fetch_object(db_query("SELECT country_iso_code_2 as country_code, country_name FROM ". 
                                          "{uc_countries} WHERE country_id = %d", 
                                          $order->{$type .'_country'})
                                         );
    
    

    The indentation should be changed (it suddenly passes from two spaces to 36 spaces). Concatenating two literal strings to build a SQL query is useless.

mearnest’s picture

StatusFileSize
new6.14 KB

Attached is another resubmission addressing #5. In addition, the is_primary location field is set based on the billing address when there is no primary location and locations are being added.

mearnest’s picture

StatusFileSize
new6.13 KB

Changed readme to include drupal links to this project.

avpaderno’s picture

Thank you for the updates! I have already approved your CVS account.

Status: Fixed » Closed (fixed)

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

avpaderno’s picture

Component: Miscellaneous » new project application
Assigned: Unassigned » avpaderno
Issue summary: View changes
Status: Closed (fixed) » Fixed

Status: Fixed » Closed (fixed)

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