Re: Re: Hi Guys, I've got a related

Guest (not verified)

Hi Ryan, and thanks for looking into this.
Here are the lines included in ubercart-5.x-1.0-alpha7e.tar.gz /payement/credit/uc_credit.module

function uc_credit_cron() {
  // Empty anonymous carts.
  $time = strtotime(variable_get('uc_cart_anon_duration', '4') .' '
                  . variable_get('uc_cart_anon_unit', 'hours') .' ago');
  db_query("DELETE upc.* FROM {uc_orders} AS uo LEFT JOIN {uc_payment_credit} "
          ."AS upc ON uo.order_id = upc.order_id WHERE uo.modified <= %d AND "
          ."uo.order_status = 0", $time);

  // Mask old stored credit card numbers.
  $time = strtotime(variable_get('uc_credit_number_duration', '1') .' '
                  . variable_get('uc_credit_number_unit', 'years') .' ago');
  db_query("UPDATE {uc_orders} AS uo LEFT JOIN {uc_payment_credit} AS upc "
          ."ON uo.order_id = upc.order_id SET upc.cc_number = "
          ."RIGHT(upc.cc_number, 4), upc.cc_cvv = '000' WHERE uo.modified "
          ."<= %d AND uo.order_status = %d AND CHAR_LENGTH(upc.cc_number) > 4",
           $time, variable_get('uc_credit_clear_status', 4));
}

I did not update from any previous version of UC, it's a clean install, so my directory structure is as it should be (all payement stuff below ubercart/payement/)

I've replaced the query by the one you suggested, but still got the same kind of error:

user warning: Not unique table/alias: 'upc' query: DELETE upc.* FROM uc_orders AS uo LEFT JOIN uc_payment_credit AS upc ON uo.order_id = upc.order_id WHERE uo.modified <= 1193669983 AND uo.order_status = 'in_checkout'

Could it be that there is no order in the tables ? (site is still in construction)
Thanks a lot,
Sebastien

CC data where are you? By: bioben (14 replies) Wed, 10/10/2007 - 17:01