The service field in the ec_shipping_service table is getting filled incorrectly. Specifically, we're getting duplicate data--the service and method fields both get what's supposed to go into the method field. For example, if the 'ups' service's '2DA' method is selected, both service and method get 2DAY as a value--instead of service getting 'ups' and method getting '2DA'. This is due to an error in how the data are passed from shipping modules to the shipping api.

Attached patch fixes the issue.

CommentFileSizeAuthor
shipping-service.patch2.97 KBnedjo

Comments

nedjo’s picture

Users who have operated sites without this patch will need to correct their database records. If you have only used one service (e.g., UPS), this is easy. E.g.,

UPDATE ec_shipping_product SET service = 'ups';

But if you've used e.g. both UPS and USPS the update is more complex. Here's a (draft, untested) suggestion:


    $methods = shipping_get_methods();
    foreach ($methods as $service => $method) {
      foreach (element_children($method) as $key) {
        db_query("UPDATE {ec_shipping_product} SET service = '%s' WHERE method = '%s'", $service, $key);
      }
    }

You could run this in e.g. a PHP block using devel.module, or create a page of format PHP and run it there.

nedjo’s picture

Status: Needs review » Fixed

Fix applied to both 4.7 and HEAD.

Anonymous’s picture

Status: Fixed » Closed (fixed)