Info deliberately not set for US/Canada?

TR - July 22, 2008 - 06:59
Project:Ubercart EDI
Version:5.x-1.0
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

I don't understand why the following checks are in the module, but the end result is that !delivery_country_name, !billing_country_name, !delivery_country_code, and !billing_country_code are not set at all if the country is USA or Canada. There are four of these checks in the code. I replaced all four conditional expressions with "if (FALSE) {}" and it fixed the problem. (This is not the best fix, but I don't know what the intent of the code is so I didn't want to mess with the "else" part of the statements; this was the smallest change needed to achieve the desired result.)

if ($order['delivery_country'] == 124 || $order['delivery_country'] == 840) {
  $values['!delivery_country_name'] = ' ';
}

if ($order['billing_country'] == 124 || $order['billing_country'] == 840) {
  $values['!billing_country_name'] = ' ';
}

if ($order['delivery_country'] == 124 || $order['delivery_country'] == 840) {
  $values['!delivery_country_code'] = ' ';
}

if ($order['billing_country'] == 124 || $order['billing_country'] == 840) {
  $values['!billing_country_code'] = ' ';
}

#1

rszrama - July 24, 2008 - 19:27

heh I bet it was from when this module was developed I was writing it for a guy that only needed the country if it was outside of North America. I imagine those chunks can just be totally removed. Thanks for digging that up. ; )

#2

ezra-g - August 22, 2008 - 18:33
Status:active» needs review

I'm putting this up for review. This removes and restructures the if, elses in that function.

AttachmentSize
285655.patch 4.75 KB

#3

ezra-g - October 6, 2008 - 15:09
Status:needs review» reviewed & tested by the community

#4

ezra-g - January 5, 2009 - 22:23
Status:reviewed & tested by the community» fixed

Committed. Let's clean up this module for Drupal 6 :)!

#5

System Message - January 19, 2009 - 22:30
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.