updated ubercart contrib module

This commit is contained in:
Bachir Soussi Chiadmi 2019-10-14 10:35:12 +02:00
parent 26fadc74e4
commit 4e780cb6d4
55 changed files with 181 additions and 161 deletions

View File

@ -4,8 +4,8 @@ dependencies[] = uc_payment
package = Ubercart - payment package = Ubercart - payment
core = 7.x core = 7.x
; Information added by Drupal.org packaging script on 2019-03-06 ; Information added by Drupal.org packaging script on 2019-10-01
version = "7.x-3.12" version = "7.x-3.13"
core = "7.x" core = "7.x"
project = "ubercart" project = "ubercart"
datestamp = "1551862392" datestamp = "1569942207"

View File

@ -5,8 +5,8 @@ dependencies[] = uc_credit
package = Ubercart - payment package = Ubercart - payment
core = 7.x core = 7.x
; Information added by Drupal.org packaging script on 2019-03-06 ; Information added by Drupal.org packaging script on 2019-10-01
version = "7.x-3.12" version = "7.x-3.13"
core = "7.x" core = "7.x"
project = "ubercart" project = "ubercart"
datestamp = "1551862392" datestamp = "1569942207"

View File

@ -391,7 +391,7 @@ function _uc_authorizenet_cim_payment_profile_get($order, $profile_id, $payment_
} }
/** /**
* Handles authorizations and captures through AIM at Authorize.Net * Handles authorizations and captures through AIM at Authorize.net.
*/ */
function _uc_authorizenet_charge($order, $amount, $data) { function _uc_authorizenet_charge($order, $amount, $data) {
global $user; global $user;
@ -523,7 +523,7 @@ function _uc_authorizenet_charge($order, $amount, $data) {
$response[$i] = substr($response[$i], 1, strlen($response[$i]) - 2); $response[$i] = substr($response[$i], 1, strlen($response[$i]) - 2);
} }
/** /*
* Response key index: * Response key index:
* 0 = Response Code * 0 = Response Code
* 2 = Response Reason Code * 2 = Response Reason Code

View File

@ -5,8 +5,8 @@ dependencies[] = uc_credit
package = Ubercart - payment package = Ubercart - payment
core = 7.x core = 7.x
; Information added by Drupal.org packaging script on 2019-03-06 ; Information added by Drupal.org packaging script on 2019-10-01
version = "7.x-3.12" version = "7.x-3.13"
core = "7.x" core = "7.x"
project = "ubercart" project = "ubercart"
datestamp = "1551862392" datestamp = "1569942207"

View File

@ -8,8 +8,8 @@ core = 7.x
; Test cases ; Test cases
files[] = tests/uc_credit.test files[] = tests/uc_credit.test
; Information added by Drupal.org packaging script on 2019-03-06 ; Information added by Drupal.org packaging script on 2019-10-01
version = "7.x-3.12" version = "7.x-3.13"
core = "7.x" core = "7.x"
project = "ubercart" project = "ubercart"
datestamp = "1551862392" datestamp = "1569942207"

View File

@ -7,8 +7,8 @@ core = 7.x
; Class definitions ; Class definitions
files[] = uc_cybersource.soap.inc files[] = uc_cybersource.soap.inc
; Information added by Drupal.org packaging script on 2019-03-06 ; Information added by Drupal.org packaging script on 2019-10-01
version = "7.x-3.12" version = "7.x-3.13"
core = "7.x" core = "7.x"
project = "ubercart" project = "ubercart"
datestamp = "1551862392" datestamp = "1569942207"

View File

@ -139,7 +139,7 @@ function uc_cybersource_schema() {
'not null' => TRUE, 'not null' => TRUE,
'default' => '', 'default' => '',
), ),
'received' => array( 'received' => array(
'description' => 'The IPN receipt timestamp.', 'description' => 'The IPN receipt timestamp.',
'type' => 'int', 'type' => 'int',
'unsigned' => TRUE, 'unsigned' => TRUE,

View File

@ -485,7 +485,7 @@ function uc_cybersource_hop_form($form, $form_state, $order) {
$data['orderPage_sendMerchantReceiptEmail'] = variable_get('uc_cybersource_hop_merchant_receipt_email', 'true'); $data['orderPage_sendMerchantReceiptEmail'] = variable_get('uc_cybersource_hop_merchant_receipt_email', 'true');
$data['orderPage_sendMerchantURLPost'] = 'true'; $data['orderPage_sendMerchantURLPost'] = 'true';
// CyberSource posts payment confirmation to this URL. // CyberSource posts payment confirmation to this URL.
$data['orderPage_merchantURLPostAddress']= url('cybersource/hop-post', array('absolute' => TRUE)); $data['orderPage_merchantURLPostAddress'] = url('cybersource/hop-post', array('absolute' => TRUE));
$data['orderPage_buyButtonText'] = t('Checkout'); $data['orderPage_buyButtonText'] = t('Checkout');
$receipt_url = url('cybersource/hop-complete/' . $order->order_id, array('absolute' => TRUE)); $receipt_url = url('cybersource/hop-complete/' . $order->order_id, array('absolute' => TRUE));
$data['orderPage_receiptResponseURL'] = $receipt_url; $data['orderPage_receiptResponseURL'] = $receipt_url;

View File

@ -16,7 +16,7 @@ class CyberSourceSoapClient extends SoapClient {
/** /**
* Inserts the UsernameToken information in the outgoing request. * Inserts the UsernameToken information in the outgoing request.
*/ */
function __doRequest($request, $location, $action, $version) { function __doRequest($request, $location, $action, $version, $one_way = 0) {
$login = _uc_cybersource_soap_login_data(); $login = _uc_cybersource_soap_login_data();
$soapHeader = '<SOAP-ENV:Header xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"><wsse:Security SOAP-ENV:mustUnderstand="1"><wsse:UsernameToken><wsse:Username>' . $login['merchant_id'] . '</wsse:Username><wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">' . $login['transaction_key'] . '</wsse:Password></wsse:UsernameToken></wsse:Security></SOAP-ENV:Header>'; $soapHeader = '<SOAP-ENV:Header xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"><wsse:Security SOAP-ENV:mustUnderstand="1"><wsse:UsernameToken><wsse:Username>' . $login['merchant_id'] . '</wsse:Username><wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">' . $login['transaction_key'] . '</wsse:Password></wsse:UsernameToken></wsse:Security></SOAP-ENV:Header>';
@ -35,7 +35,7 @@ class CyberSourceSoapClient extends SoapClient {
die('Error adding UsernameToken: ' . $e->code); die('Error adding UsernameToken: ' . $e->code);
} }
return parent::__doRequest($request, $location, $action, $version); return parent::__doRequest($request, $location, $action, $version, $one_way);
} }
} }

View File

@ -6,8 +6,8 @@ dependencies[] = uc_quote
package = Ubercart - payment package = Ubercart - payment
core = 7.x core = 7.x
; Information added by Drupal.org packaging script on 2019-03-06 ; Information added by Drupal.org packaging script on 2019-10-01
version = "7.x-3.12" version = "7.x-3.13"
core = "7.x" core = "7.x"
project = "ubercart" project = "ubercart"
datestamp = "1551862392" datestamp = "1569942207"

View File

@ -1,6 +1,6 @@
/** /**
* @file * @file
* Styles for uc_payment module. * RTL Styles for uc_payment module.
*/ */
.payment-details-cod .form-item { .payment-details-cod .form-item {

View File

@ -10,8 +10,8 @@ files[] = tests/uc_payment.test
configure = admin/store/settings/payment configure = admin/store/settings/payment
; Information added by Drupal.org packaging script on 2019-03-06 ; Information added by Drupal.org packaging script on 2019-10-01
version = "7.x-3.12" version = "7.x-3.13"
core = "7.x" core = "7.x"
project = "ubercart" project = "ubercart"
datestamp = "1551862392" datestamp = "1569942207"

View File

@ -5,8 +5,8 @@ dependencies[] = uc_payment
package = Ubercart - payment package = Ubercart - payment
core = 7.x core = 7.x
; Information added by Drupal.org packaging script on 2019-03-06 ; Information added by Drupal.org packaging script on 2019-10-01
version = "7.x-3.12" version = "7.x-3.13"
core = "7.x" core = "7.x"
project = "ubercart" project = "ubercart"
datestamp = "1551862392" datestamp = "1569942207"

View File

@ -113,12 +113,12 @@ function uc_payment_method_cod($op, &$order, $form = NULL, $form_state = NULL) {
switch ($op) { switch ($op) {
case 'cart-details': case 'cart-details':
$build['policy'] = array( $build['policy'] = array(
'#markup' => '<p>' . variable_get('uc_cod_policy', t('Full payment is expected upon delivery or prior to pick-up.')) . '</p>' '#markup' => '<p>' . variable_get('uc_cod_policy', t('Full payment is expected upon delivery or prior to pick-up.')) . '</p>',
); );
if (($max = variable_get('uc_cod_max_order', 0)) > 0 && is_numeric($max)) { if (($max = variable_get('uc_cod_max_order', 0)) > 0 && is_numeric($max)) {
$build['eligibility'] = array( $build['eligibility'] = array(
'#markup' => '<p>' . t('Orders totalling more than !number are <b>not eligible</b> for COD.', array('!number' => uc_currency_format($max))) . '</p>' '#markup' => '<p>' . t('Orders totalling more than !number are <b>not eligible</b> for COD.', array('!number' => uc_currency_format($max))) . '</p>',
); );
} }
@ -186,7 +186,7 @@ function uc_payment_method_cod($op, &$order, $form = NULL, $form_state = NULL) {
$order->order_total > $max) { $order->order_total > $max) {
$result[] = array( $result[] = array(
'pass' => FALSE, 'pass' => FALSE,
'message' => t('Your final order total exceeds the maximum for COD payment. Please go back and select a different method of payment.') 'message' => t('Your final order total exceeds the maximum for COD payment. Please go back and select a different method of payment.'),
); );
$_SESSION['expanded_panes'][] = 'payment'; $_SESSION['expanded_panes'][] = 'payment';
return $result; return $result;
@ -264,7 +264,7 @@ function uc_payment_method_check($op, &$order, $form = NULL, &$form_state = NULL
switch ($op) { switch ($op) {
case 'cart-details': case 'cart-details':
$build['instructions'] = array( $build['instructions'] = array(
'#markup' => t('Checks should be made out to:') '#markup' => t('Checks should be made out to:'),
); );
if (!variable_get('uc_check_mailing_street1', FALSE)) { if (!variable_get('uc_check_mailing_street1', FALSE)) {
@ -303,7 +303,7 @@ function uc_payment_method_check($op, &$order, $form = NULL, &$form_state = NULL
} }
$build['policy'] = array( $build['policy'] = array(
'#markup' => '<p>' . variable_get('uc_check_policy', '') . '</p>' '#markup' => '<p>' . variable_get('uc_check_policy', '') . '</p>',
); );
return $build; return $build;
@ -321,7 +321,7 @@ function uc_payment_method_check($op, &$order, $form = NULL, &$form_state = NULL
variable_get('uc_store_zone', ''), variable_get('uc_store_zone', ''),
variable_get('uc_store_postal_code', ''), variable_get('uc_store_postal_code', ''),
variable_get('uc_store_country', 840) variable_get('uc_store_country', 840)
) ),
); );
} }
else { else {
@ -337,7 +337,7 @@ function uc_payment_method_check($op, &$order, $form = NULL, &$form_state = NULL
variable_get('uc_check_mailing_zone', ''), variable_get('uc_check_mailing_zone', ''),
variable_get('uc_check_mailing_postal_code', ''), variable_get('uc_check_mailing_postal_code', ''),
variable_get('uc_check_mailing_country', 840) variable_get('uc_check_mailing_country', 840)
) ),
); );
} }
return $review; return $review;

View File

@ -4,8 +4,8 @@ dependencies[] = uc_payment
package = Ubercart - payment package = Ubercart - payment
core = 7.x core = 7.x
; Information added by Drupal.org packaging script on 2019-03-06 ; Information added by Drupal.org packaging script on 2019-10-01
version = "7.x-3.12" version = "7.x-3.13"
core = "7.x" core = "7.x"
project = "ubercart" project = "ubercart"
datestamp = "1551862392" datestamp = "1569942207"

View File

@ -6,8 +6,8 @@ core = 7.x
configure = admin/store/settings/quotes/methods configure = admin/store/settings/quotes/methods
; Information added by Drupal.org packaging script on 2019-03-06 ; Information added by Drupal.org packaging script on 2019-10-01
version = "7.x-3.12" version = "7.x-3.13"
core = "7.x" core = "7.x"
project = "ubercart" project = "ubercart"
datestamp = "1551862392" datestamp = "1569942207"

View File

@ -101,11 +101,11 @@ function uc_flatrate_node_update($node) {
foreach ($node->flatrate as $mid => $rate) { foreach ($node->flatrate as $mid => $rate) {
if (is_numeric($rate) && $rate >= 0) { if (is_numeric($rate) && $rate >= 0) {
$query->values(array( $query->values(array(
'vid' => $node->vid, 'vid' => $node->vid,
'nid' => $node->nid, 'nid' => $node->nid,
'mid' => $mid, 'mid' => $mid,
'rate' => $rate, 'rate' => $rate,
)); ));
} }
} }

View File

@ -1,6 +1,6 @@
/** /**
* @file * @file
* Styles for shipping quote cart and checkout panes. * RTL Styles for shipping quote cart and checkout panes.
*/ */
#uc-cart-pane-quotes .form-submit { #uc-cart-pane-quotes .form-submit {

View File

@ -75,7 +75,7 @@ function uc_quote_admin_settings($form, &$form_state) {
); );
$form['actions'] = array('#type' => 'actions'); $form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array('#type' => 'submit', '#value' => t('Save configuration') ); $form['actions']['submit'] = array('#type' => 'submit', '#value' => t('Save configuration'));
return $form; return $form;
} }
@ -200,7 +200,7 @@ function uc_quote_method_settings($form, &$form_state) {
); );
$form['actions'] = array('#type' => 'actions'); $form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array('#type' => 'submit', '#value' => t('Save configuration') ); $form['actions']['submit'] = array('#type' => 'submit', '#value' => t('Save configuration'));
return $form; return $form;
} }
@ -216,7 +216,7 @@ function theme_uc_quote_method_settings($variables) {
drupal_add_tabledrag('uc-quote-methods', 'order', 'sibling', 'uc-quote-method-weight'); drupal_add_tabledrag('uc-quote-methods', 'order', 'sibling', 'uc-quote-method-weight');
$header = array(t('Shipping method'), t('Details'), array('data' => t('List position'), 'sort' => 'asc'), t('Operations')); $header = array(t('Shipping method'), t('Details'), array('data' => t('List position'), 'sort' => 'asc'), t('Operations'));
$rows = array(); $rows = array();
foreach (element_children($form['methods']) as $method) { foreach (element_children($form['methods']) as $method) {
$row = array( $row = array(

View File

@ -9,8 +9,8 @@ configure = admin/store/settings/quotes
; Test cases ; Test cases
files[] = tests/uc_quote.test files[] = tests/uc_quote.test
; Information added by Drupal.org packaging script on 2019-03-06 ; Information added by Drupal.org packaging script on 2019-10-01
version = "7.x-3.12" version = "7.x-3.13"
core = "7.x" core = "7.x"
project = "ubercart" project = "ubercart"
datestamp = "1551862392" datestamp = "1569942207"

View File

@ -562,7 +562,7 @@ function uc_checkout_pane_quotes($op, &$order, $form = NULL, &$form_state = NULL
$form_state['uc_ajax']['uc_quote']['panes][quotes][quote_button'] = array( $form_state['uc_ajax']['uc_quote']['panes][quotes][quote_button'] = array(
'payment-pane' => 'uc_ajax_replace_checkout_pane', 'payment-pane' => 'uc_ajax_replace_checkout_pane',
'quotes-pane' => 'uc_ajax_replace_checkout_pane' 'quotes-pane' => 'uc_ajax_replace_checkout_pane',
); );
$form_state['uc_ajax']['uc_quote']['panes][quotes][quotes][quote_option'] = array( $form_state['uc_ajax']['uc_quote']['panes][quotes][quotes][quote_option'] = array(
'payment-pane' => 'uc_ajax_replace_checkout_pane', 'payment-pane' => 'uc_ajax_replace_checkout_pane',
@ -768,7 +768,7 @@ function uc_quote_apply_quote_to_order($form, &$form_state) {
); );
} }
// Save selected shipping // Save selected shipping.
uc_quote_uc_order('save', $order, ''); uc_quote_uc_order('save', $order, '');
// Update line items. // Update line items.
@ -902,8 +902,8 @@ function uc_quote_replace_order_quotes($form, $form_state) {
} }
/** /**
* AJAX callback for applying shipping rates. * AJAX callback for applying shipping rates.
*/ */
function uc_quote_order_update_rates($form, $form_state) { function uc_quote_order_update_rates($form, $form_state) {
// Update shipping line item. // Update shipping line item.
if (isset($form_state['uc_quote'])) { if (isset($form_state['uc_quote'])) {

View File

@ -22,7 +22,7 @@ function uc_quote_assemble_quotes($order) {
$shipping_types = array(); $shipping_types = array();
foreach ($products as $product) { foreach ($products as $product) {
$shipping_types[] = uc_product_get_shipping_type($product); $shipping_types[] = uc_product_get_shipping_type($product);
} }
$shipping_types = array_unique($shipping_types); $shipping_types = array_unique($shipping_types);
@ -83,7 +83,7 @@ function uc_quote_action_get_quote($order, $method) {
} }
} }
ob_start(); ob_start();
// Load include file containing quote callback, if there is one // Load include file containing quote callback, if there is one.
if (isset($method['quote']['file'])) { if (isset($method['quote']['file'])) {
$inc_file = drupal_get_path('module', $method['module']) . '/' . $method['quote']['file']; $inc_file = drupal_get_path('module', $method['module']) . '/' . $method['quote']['file'];
if (is_file($inc_file)) { if (is_file($inc_file)) {

View File

@ -8,8 +8,8 @@ core = 7.x
files[] = views/uc_shipping_handler_field_shipment_id.inc files[] = views/uc_shipping_handler_field_shipment_id.inc
files[] = views/uc_shipping_handler_field_package_weight.inc files[] = views/uc_shipping_handler_field_package_weight.inc
; Information added by Drupal.org packaging script on 2019-03-06 ; Information added by Drupal.org packaging script on 2019-10-01
version = "7.x-3.12" version = "7.x-3.13"
core = "7.x" core = "7.x"
project = "ubercart" project = "ubercart"
datestamp = "1551862392" datestamp = "1569942207"

View File

@ -228,7 +228,7 @@ function uc_shipping_schema() {
), ),
'indexes' => array( 'indexes' => array(
'order_id' => array('order_id'), 'order_id' => array('order_id'),
), ),
); );
$schema['uc_packages'] = array( $schema['uc_packages'] = array(

View File

@ -457,10 +457,10 @@ function uc_shipping_package_save($package) {
foreach ($package->products as $id => $product) { foreach ($package->products as $id => $product) {
$insert->values(array( $insert->values(array(
'package_id' => $package->package_id, 'package_id' => $package->package_id,
'order_product_id' => $id, 'order_product_id' => $id,
'qty' => $product->qty, 'qty' => $product->qty,
)); ));
$result = db_query("SELECT data FROM {uc_order_products} WHERE order_product_id = :id", array(':id' => $id)); $result = db_query("SELECT data FROM {uc_order_products} WHERE order_product_id = :id", array(':id' => $id));
if ($order_product = $result->fetchObject()) { if ($order_product = $result->fetchObject()) {

View File

@ -6,8 +6,8 @@ core = 7.x
configure = admin/store/settings/quotes/settings/ups configure = admin/store/settings/quotes/settings/ups
; Information added by Drupal.org packaging script on 2019-03-06 ; Information added by Drupal.org packaging script on 2019-10-01
version = "7.x-3.12" version = "7.x-3.13"
core = "7.x" core = "7.x"
project = "ubercart" project = "ubercart"
datestamp = "1551862392" datestamp = "1569942207"

View File

@ -6,8 +6,8 @@ core = 7.x
configure = admin/store/settings/quotes/settings/usps configure = admin/store/settings/quotes/settings/usps
; Information added by Drupal.org packaging script on 2019-03-06 ; Information added by Drupal.org packaging script on 2019-10-01
version = "7.x-3.12" version = "7.x-3.13"
core = "7.x" core = "7.x"
project = "ubercart" project = "ubercart"
datestamp = "1551862392" datestamp = "1569942207"

View File

@ -6,8 +6,8 @@ core = 7.x
configure = admin/store/settings/quotes/methods configure = admin/store/settings/quotes/methods
; Information added by Drupal.org packaging script on 2019-03-06 ; Information added by Drupal.org packaging script on 2019-10-01
version = "7.x-3.12" version = "7.x-3.13"
core = "7.x" core = "7.x"
project = "ubercart" project = "ubercart"
datestamp = "1551862392" datestamp = "1569942207"

View File

@ -103,11 +103,11 @@ function uc_weightquote_node_update($node) {
foreach ($node->weightquote as $mid => $rate) { foreach ($node->weightquote as $mid => $rate) {
if (is_numeric($rate) && $rate >= 0) { if (is_numeric($rate) && $rate >= 0) {
$query->values(array( $query->values(array(
'vid' => $node->vid, 'vid' => $node->vid,
'nid' => $node->nid, 'nid' => $node->nid,
'mid' => $mid, 'mid' => $mid,
'rate' => $rate, 'rate' => $rate,
)); ));
} }
} }
@ -222,7 +222,7 @@ function uc_weightquote_quote($products, $details, $method) {
// Add the product-specific rate. // Add the product-specific rate.
$product_rate = $product->weightquote[$mid] * $product->qty; $product_rate = $product->weightquote[$mid] * $product->qty;
} }
$rate += $product_rate * $product->weight * uc_weight_conversion($product->weight_units, variable_get('uc_weight_unit', 'lb')); $rate += $product_rate * $product->weight * uc_weight_conversion($product->weight_units, variable_get('uc_weight_unit', 'lb'));
} }
$quotes[] = array( $quotes[] = array(

View File

@ -4,8 +4,8 @@ dependencies[] = uc_cart
package = Ubercart - extra package = Ubercart - extra
core = 7.x core = 7.x
; Information added by Drupal.org packaging script on 2019-03-06 ; Information added by Drupal.org packaging script on 2019-10-01
version = "7.x-3.12" version = "7.x-3.13"
core = "7.x" core = "7.x"
project = "ubercart" project = "ubercart"
datestamp = "1551862392" datestamp = "1569942207"

View File

@ -316,7 +316,7 @@ class UbercartAttributeTestCase extends UbercartTestHelper {
$edit = (array) self::createAttribute(array(), FALSE); $edit = (array) self::createAttribute(array(), FALSE);
$this->drupalPost('admin/store/products/attributes/add', $edit, t('Submit')); $this->drupalPost('admin/store/products/attributes/add', $edit, t('Submit'));
if ($edit['display'] !=0) { if ($edit['display'] != 0) {
// We redirect to add options page ONLY for non-textfield attributes. // We redirect to add options page ONLY for non-textfield attributes.
$this->assertText('Options for ' . $edit['name']); $this->assertText('Options for ' . $edit['name']);
$this->assertText('No options for this attribute have been added yet.'); $this->assertText('No options for this attribute have been added yet.');
@ -650,7 +650,7 @@ class UbercartAttributeTestCase extends UbercartTestHelper {
$this->clickLink('Add an attribute'); $this->clickLink('Add an attribute');
$this->assertText($attribute->name); $this->assertText($attribute->name);
$this->drupalPost(NULL, array('add_attributes[' . $attribute->aid. ']' => 1), t('Add attributes')); $this->drupalPost(NULL, array('add_attributes[' . $attribute->aid . ']' => 1), t('Add attributes'));
$this->assertText('1 attribute has been added.'); $this->assertText('1 attribute has been added.');
$this->assertText($attribute->name, 'Attribute name found'); $this->assertText($attribute->name, 'Attribute name found');
$this->assertFieldByName('attributes[' . $attribute->aid . '][label]', $attribute->label, 'Attribute label found'); $this->assertFieldByName('attributes[' . $attribute->aid . '][label]', $attribute->label, 'Attribute label found');
@ -662,7 +662,7 @@ class UbercartAttributeTestCase extends UbercartTestHelper {
$this->assertNoText($attribute->name); $this->assertNoText($attribute->name);
$this->assertText('No attributes left to add.'); $this->assertText('No attributes left to add.');
$edit = array('attributes[' . $attribute->aid. '][remove]' => 1); $edit = array('attributes[' . $attribute->aid . '][remove]' => 1);
$this->drupalPost('node/' . $product->nid . '/edit/attributes', $edit, t('Save changes')); $this->drupalPost('node/' . $product->nid . '/edit/attributes', $edit, t('Save changes'));
$this->assertText('You must first add attributes to this product.'); $this->assertText('You must first add attributes to this product.');
} }

View File

@ -8,8 +8,8 @@ core = 7.x
files[] = tests/uc_attribute.test files[] = tests/uc_attribute.test
files[] = tests/uc_attribute_checkout.test files[] = tests/uc_attribute_checkout.test
; Information added by Drupal.org packaging script on 2019-03-06 ; Information added by Drupal.org packaging script on 2019-10-01
version = "7.x-3.12" version = "7.x-3.13"
core = "7.x" core = "7.x"
project = "ubercart" project = "ubercart"
datestamp = "1551862392" datestamp = "1569942207"

View File

@ -3,8 +3,8 @@ core = 7.x
dependencies[] = uc_cart dependencies[] = uc_cart
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2019-03-06 ; Information added by Drupal.org packaging script on 2019-10-01
version = "7.x-3.12" version = "7.x-3.13"
core = "7.x" core = "7.x"
project = "ubercart" project = "ubercart"
datestamp = "1551862392" datestamp = "1569942207"

View File

@ -16,8 +16,8 @@ files[] = uc_cart.controller.inc
configure = admin/store/settings/cart configure = admin/store/settings/cart
; Information added by Drupal.org packaging script on 2019-03-06 ; Information added by Drupal.org packaging script on 2019-10-01
version = "7.x-3.12" version = "7.x-3.13"
core = "7.x" core = "7.x"
project = "ubercart" project = "ubercart"
datestamp = "1551862392" datestamp = "1569942207"

View File

@ -1,6 +1,6 @@
/** /**
* @file * @file
* Styles for the uc_cart module cart block. * RTL Styles for the uc_cart module cart block.
*/ */
.cart-block-icon-full, .cart-block-icon-full,

View File

@ -63,13 +63,13 @@ function uc_cart_links_settings_form_validate($form, &$form_state) {
foreach ($data as $message) { foreach ($data as $message) {
// Ignore blank lines. // Ignore blank lines.
if (preg_match('/^\s*$/', $message)) { if (preg_match('/^\s*$/', $message)) {
continue; continue;
} }
// Check for properly formattted messages. // Check for properly formattted messages.
// Each line must be one or more numeric characters for the key followed // Each line must be one or more numeric characters for the key followed
// by "|" followed by one or more characters for the value. Both the key // by "|" followed by one or more characters for the value. Both the key
// and the value may have leading and/or trailing whitespace. // and the value may have leading and/or trailing whitespace.
else if (!preg_match('/^\s*[1-9][0-9]*\s*\|\s*\S+.*$/', $message)) { elseif (!preg_match('/^\s*[1-9][0-9]*\s*\|\s*\S+.*$/', $message)) {
form_set_error('uc_cart_links_messages', t('Invalid Cart Links message "%message". Messages must be a numeric key followed by "|" followed by a value.', array('%message' => $message))); form_set_error('uc_cart_links_messages', t('Invalid Cart Links message "%message". Messages must be a numeric key followed by "|" followed by a value.', array('%message' => $message)));
break; break;
} }

View File

@ -9,8 +9,8 @@ files[] = tests/uc_cart_links.test
configure = admin/store/settings/cart-links configure = admin/store/settings/cart-links
; Information added by Drupal.org packaging script on 2019-03-06 ; Information added by Drupal.org packaging script on 2019-10-01
version = "7.x-3.12" version = "7.x-3.13"
core = "7.x" core = "7.x"
project = "ubercart" project = "ubercart"
datestamp = "1551862392" datestamp = "1569942207"

View File

@ -15,8 +15,8 @@ files[] = tests/uc_catalog.test
configure = admin/store/settings/catalog configure = admin/store/settings/catalog
; Information added by Drupal.org packaging script on 2019-03-06 ; Information added by Drupal.org packaging script on 2019-10-01
version = "7.x-3.12" version = "7.x-3.13"
core = "7.x" core = "7.x"
project = "ubercart" project = "ubercart"
datestamp = "1551862392" datestamp = "1569942207"

View File

@ -22,10 +22,10 @@ define('UC_FILE_FORM_ACTION', 1 );
function uc_file_admin_files_form($form, &$form_state) { function uc_file_admin_files_form($form, &$form_state) {
if (isset($form_state['storage']['step']) && $form_state['storage']['step'] == UC_FILE_FORM_ACTION) { if (isset($form_state['storage']['step']) && $form_state['storage']['step'] == UC_FILE_FORM_ACTION) {
return array( return array(
'#validate' => array('uc_file_admin_files_form_action_validate'), '#validate' => array('uc_file_admin_files_form_action_validate'),
'#submit' => array('uc_file_admin_files_form_action_submit'), '#submit' => array('uc_file_admin_files_form_action_submit'),
) + $form + uc_file_admin_files_form_action($form, $form_state); ) + $form + uc_file_admin_files_form_action($form, $form_state);
} }
else { else {
// Refresh our file list before display. // Refresh our file list before display.
@ -283,15 +283,31 @@ function uc_file_admin_files_form_action($form, &$form_state) {
break; break;
case 'uc_file_upload': case 'uc_file_upload':
// Calculate the max size of uploaded files, in bytes. // Calculate the maximum size of uploaded files in bytes.
$max_bytes = trim(ini_get('post_max_size')); $post_max_size = ini_get('post_max_size');
switch (strtolower($max_bytes{strlen($max_bytes) - 1})) { if (is_numeric($post_max_size)) {
case 'g': // Handle the case where 'post_max_size' has no suffix.
$max_bytes *= 1024; // An explicit cast is needed because floats are not allowed.
case 'm': $max_bytes = (int) $post_max_size;
$max_bytes *= 1024; }
case 'k': else {
$max_bytes *= 1024; // Handle the case where 'post_max_size' has a suffix of
// 'M', 'K', or 'G' (case insensitive).
$max_bytes = (int) substr($post_max_size, 0, -1);
$suffix = strtolower(substr($post_max_size, -1));
switch ($suffix) {
case 'k':
$max_bytes *= 1024;
break;
case 'm':
$max_bytes *= 1048576;
break;
case 'g':
$max_bytes *= 1073741824;
break;
}
} }
// Gather list of directories under the selected one(s). // Gather list of directories under the selected one(s).
@ -313,7 +329,9 @@ function uc_file_admin_files_form_action($form, &$form_state) {
$form['upload'] = array( $form['upload'] = array(
'#type' => 'file', '#type' => 'file',
'#title' => t('File'), '#title' => t('File'),
'#description' => t('The maximum file size that can be uploaded is %size bytes. You will need to use a different method to upload the file to the directory (e.g. (S)FTP, SCP) if your file exceeds this size. Files you upload using one of these alternate methods will be automatically detected.', array('%size' => number_format($max_bytes))), // Deliberately concatenate the strings to preserve backwards
// compatibility with existing translations.
'#description' => t('The maximum file size that can be uploaded is %size bytes. You will need to use a different method to upload the file to the directory (e.g. (S)FTP, SCP) if your file exceeds this size. Files you upload using one of these alternate methods will be automatically detected.', array('%size' => number_format($max_bytes))) . ' ' . t("Note: A value of '0' means there is no size limit."),
); );
$form['#attributes']['class'][] = 'foo'; $form['#attributes']['class'][] = 'foo';
@ -375,7 +393,6 @@ function uc_file_admin_files_form_action_validate($form, &$form_state) {
break; break;
default: default:
// This action isn't handled by us, so check if any // This action isn't handled by us, so check if any
// hook_uc_file_action('validate', $args) are implemented. // hook_uc_file_action('validate', $args) are implemented.
foreach (module_implements('uc_file_action') as $module) { foreach (module_implements('uc_file_action') as $module) {

View File

@ -11,8 +11,8 @@ files[] = tests/uc_file.test
stylesheets[all][] = uc_file.css stylesheets[all][] = uc_file.css
scripts[] = uc_file.js scripts[] = uc_file.js
; Information added by Drupal.org packaging script on 2019-03-06 ; Information added by Drupal.org packaging script on 2019-10-01
version = "7.x-3.12" version = "7.x-3.13"
core = "7.x" core = "7.x"
project = "ubercart" project = "ubercart"
datestamp = "1551862392" datestamp = "1569942207"

View File

@ -7,8 +7,8 @@ dependencies[] = uc_store
package = Ubercart - extra package = Ubercart - extra
core = 7.x core = 7.x
; Information added by Drupal.org packaging script on 2019-03-06 ; Information added by Drupal.org packaging script on 2019-10-01
version = "7.x-3.12" version = "7.x-3.13"
core = "7.x" core = "7.x"
project = "ubercart" project = "ubercart"
datestamp = "1551862392" datestamp = "1569942207"

View File

@ -1,6 +1,6 @@
/** /**
* @file * @file
* Styles for uc_order module. * RTL Styles for uc_order module.
*/ */
.view-uc-orders #edit-delivery-first-name-wrapper, .view-uc-orders #edit-delivery-first-name-wrapper,

View File

@ -39,8 +39,8 @@ files[] = uc_order.info.inc
configure = admin/store/settings/orders configure = admin/store/settings/orders
stylesheets[all][] = uc_order.css stylesheets[all][] = uc_order.css
; Information added by Drupal.org packaging script on 2019-03-06 ; Information added by Drupal.org packaging script on 2019-10-01
version = "7.x-3.12" version = "7.x-3.13"
core = "7.x" core = "7.x"
project = "ubercart" project = "ubercart"
datestamp = "1551862392" datestamp = "1569942207"

View File

@ -1481,6 +1481,7 @@ function uc_order_load_line_items_display($order) {
} }
} }
foreach ($line_items as &$item) { foreach ($line_items as &$item) {
$item['title'] = check_plain($item['title']);
$item['formatted_amount'] = uc_currency_format($item['amount']); $item['formatted_amount'] = uc_currency_format($item['amount']);
} }
@ -1776,6 +1777,8 @@ function template_preprocess_uc_order(&$variables) {
$variables['products'] = $order->products; $variables['products'] = $order->products;
$display = uc_order_product_view_multiple($order->products); $display = uc_order_product_view_multiple($order->products);
foreach ($variables['products'] as &$product) { foreach ($variables['products'] as &$product) {
$product->title = check_plain($product->title);
$product->model = check_plain($product->model);
$product->total_price = render($display['uc_order_product'][$product->order_product_id]['total']); $product->total_price = render($display['uc_order_product'][$product->order_product_id]['total']);
if ($product->qty > 1) { if ($product->qty > 1) {
$product->individual_price = t('(!price each)', array('!price' => uc_currency_format($display['uc_order_product'][$product->order_product_id]['price']['#price']))); $product->individual_price = t('(!price each)', array('!price' => uc_currency_format($display['uc_order_product'][$product->order_product_id]['price']['#price'])));

View File

@ -1,6 +1,6 @@
/** /**
* @file * @file
* Styles for uc_product module. * RTL Styles for uc_product module.
*/ */
.product-image { .product-image {

View File

@ -20,8 +20,8 @@ files[] = views/uc_product_handler_filter_product.inc
configure = admin/store/settings/products configure = admin/store/settings/products
stylesheets[all][] = uc_product.css stylesheets[all][] = uc_product.css
; Information added by Drupal.org packaging script on 2019-03-06 ; Information added by Drupal.org packaging script on 2019-10-01
version = "7.x-3.12" version = "7.x-3.13"
core = "7.x" core = "7.x"
project = "ubercart" project = "ubercart"
datestamp = "1551862392" datestamp = "1569942207"

View File

@ -1,6 +1,6 @@
/** /**
* @file * @file
* Styles for uc_product_kit module. * RTL Styles for uc_product_kit module.
*/ */
#block-cart-contents .kit-component-cart-desc ul.product-description { #block-cart-contents .kit-component-cart-desc ul.product-description {

View File

@ -10,8 +10,8 @@ files[] = tests/uc_product_kit.test
files[] = views/uc_product_kit_handler_filter_product_kit.inc files[] = views/uc_product_kit_handler_filter_product_kit.inc
files[] = views/uc_product_kit_handler_filter_product_kit_item.inc files[] = views/uc_product_kit_handler_filter_product_kit_item.inc
; Information added by Drupal.org packaging script on 2019-03-06 ; Information added by Drupal.org packaging script on 2019-10-01
version = "7.x-3.12" version = "7.x-3.13"
core = "7.x" core = "7.x"
project = "ubercart" project = "ubercart"
datestamp = "1551862392" datestamp = "1569942207"

View File

@ -7,8 +7,8 @@ core = 7.x
configure = admin/store/settings/store configure = admin/store/settings/store
; Information added by Drupal.org packaging script on 2019-03-06 ; Information added by Drupal.org packaging script on 2019-10-01
version = "7.x-3.12" version = "7.x-3.13"
core = "7.x" core = "7.x"
project = "ubercart" project = "ubercart"
datestamp = "1551862392" datestamp = "1569942207"

View File

@ -11,8 +11,8 @@ files[] = tests/uc_roles.test
; Views handlers ; Views handlers
files[] = views/uc_roles_handler_field_rid.inc files[] = views/uc_roles_handler_field_rid.inc
; Information added by Drupal.org packaging script on 2019-03-06 ; Information added by Drupal.org packaging script on 2019-10-01
version = "7.x-3.12" version = "7.x-3.13"
core = "7.x" core = "7.x"
project = "ubercart" project = "ubercart"
datestamp = "1551862392" datestamp = "1569942207"

View File

@ -12,8 +12,8 @@ files[] = views/uc_stock_handler_filter_below_threshold.inc
configure = admin/store/settings/stock configure = admin/store/settings/stock
; Information added by Drupal.org packaging script on 2019-03-06 ; Information added by Drupal.org packaging script on 2019-10-01
version = "7.x-3.12" version = "7.x-3.13"
core = "7.x" core = "7.x"
project = "ubercart" project = "ubercart"
datestamp = "1551862392" datestamp = "1569942207"

View File

@ -1,6 +1,6 @@
/** /**
* @file * @file
* Styles for uc_store module. * RTL Styles for uc_store module.
*/ */
.uc-inline-form .form-item { .uc-inline-form .form-item {

View File

@ -16,8 +16,8 @@ files[] = tests/uc_ajax.test
configure = admin/store/settings/store configure = admin/store/settings/store
stylesheets[all][] = uc_store.css stylesheets[all][] = uc_store.css
; Information added by Drupal.org packaging script on 2019-03-06 ; Information added by Drupal.org packaging script on 2019-10-01
version = "7.x-3.12" version = "7.x-3.13"
core = "7.x" core = "7.x"
project = "ubercart" project = "ubercart"
datestamp = "1551862392" datestamp = "1569942207"

View File

@ -5,8 +5,8 @@ dependencies[] = uc_taxes
package = Ubercart - core (optional) package = Ubercart - core (optional)
core = 7.x core = 7.x
; Information added by Drupal.org packaging script on 2019-03-06 ; Information added by Drupal.org packaging script on 2019-10-01
version = "7.x-3.12" version = "7.x-3.13"
core = "7.x" core = "7.x"
project = "ubercart" project = "ubercart"
datestamp = "1551862392" datestamp = "1569942207"

View File

@ -11,8 +11,8 @@ files[] = tests/uc_taxes.test
configure = admin/store/settings/taxes configure = admin/store/settings/taxes
; Information added by Drupal.org packaging script on 2019-03-06 ; Information added by Drupal.org packaging script on 2019-10-01
version = "7.x-3.12" version = "7.x-3.13"
core = "7.x" core = "7.x"
project = "ubercart" project = "ubercart"
datestamp = "1551862392" datestamp = "1569942207"