Browse Source

security update link,module_filters,search_api_solr,ubercart,views

Bachir Soussi Chiadmi 5 years ago
parent
commit
514f3bd89e
100 changed files with 1036 additions and 646 deletions
  1. 2 2
      PATCH_LIST.txt
  2. 21 5
      sites/all/modules/contrib/admin/context/context.core.inc
  3. 3 4
      sites/all/modules/contrib/admin/context/context.info
  4. 5 0
      sites/all/modules/contrib/admin/context/context.module
  5. 3 4
      sites/all/modules/contrib/admin/context/context_layouts/context_layouts.info
  6. 3 4
      sites/all/modules/contrib/admin/context/context_ui/context_ui.info
  7. 1 1
      sites/all/modules/contrib/admin/context/plugins/context_condition_query_string.inc
  8. 11 10
      sites/all/modules/contrib/admin/context/plugins/context_reaction_block.inc
  9. 1 1
      sites/all/modules/contrib/admin/context/plugins/context_reaction_block.js
  10. 5 1
      sites/all/modules/contrib/admin/context/plugins/context_reaction_region.inc
  11. 23 12
      sites/all/modules/contrib/admin/module_filter/CHANGELOG.txt
  12. 2 2
      sites/all/modules/contrib/admin/module_filter/README.txt
  13. 6 0
      sites/all/modules/contrib/admin/module_filter/css/module_filter.css
  14. 0 3
      sites/all/modules/contrib/admin/module_filter/css/module_filter_tab.css
  15. 8 2
      sites/all/modules/contrib/admin/module_filter/css/modules.css
  16. BIN
      sites/all/modules/contrib/admin/module_filter/images/collapsed.png
  17. BIN
      sites/all/modules/contrib/admin/module_filter/images/expanded.png
  18. 3 0
      sites/all/modules/contrib/admin/module_filter/js/module_filter.js
  19. 9 12
      sites/all/modules/contrib/admin/module_filter/js/module_filter_tab.js
  20. 7 2
      sites/all/modules/contrib/admin/module_filter/js/modules.js
  21. 19 7
      sites/all/modules/contrib/admin/module_filter/module_filter.admin.inc
  22. 3 5
      sites/all/modules/contrib/admin/module_filter/module_filter.info
  23. 2 0
      sites/all/modules/contrib/admin/module_filter/module_filter.install
  24. 60 24
      sites/all/modules/contrib/admin/module_filter/module_filter.module
  25. 12 5
      sites/all/modules/contrib/admin/module_filter/module_filter.pages.inc
  26. 36 18
      sites/all/modules/contrib/admin/module_filter/module_filter.theme.inc
  27. 3 4
      sites/all/modules/contrib/ecommerce/ubercart/payment/uc_2checkout/uc_2checkout.info
  28. 3 4
      sites/all/modules/contrib/ecommerce/ubercart/payment/uc_2checkout/uc_2checkout.module
  29. 0 1
      sites/all/modules/contrib/ecommerce/ubercart/payment/uc_2checkout/uc_2checkout.pages.inc
  30. 3 4
      sites/all/modules/contrib/ecommerce/ubercart/payment/uc_authorizenet/uc_authorizenet.info
  31. 36 13
      sites/all/modules/contrib/ecommerce/ubercart/payment/uc_authorizenet/uc_authorizenet.module
  32. 1 2
      sites/all/modules/contrib/ecommerce/ubercart/payment/uc_authorizenet/uc_authorizenet.pages.inc
  33. 3 4
      sites/all/modules/contrib/ecommerce/ubercart/payment/uc_credit/tests/test_gateway.info
  34. 1 1
      sites/all/modules/contrib/ecommerce/ubercart/payment/uc_credit/tests/test_gateway.module
  35. 2 2
      sites/all/modules/contrib/ecommerce/ubercart/payment/uc_credit/tests/uc_credit.test
  36. 3 4
      sites/all/modules/contrib/ecommerce/ubercart/payment/uc_credit/uc_credit.info
  37. 0 1
      sites/all/modules/contrib/ecommerce/ubercart/payment/uc_credit/uc_credit.install
  38. 72 38
      sites/all/modules/contrib/ecommerce/ubercart/payment/uc_credit/uc_credit.module
  39. 3 4
      sites/all/modules/contrib/ecommerce/ubercart/payment/uc_cybersource/uc_cybersource.info
  40. 74 6
      sites/all/modules/contrib/ecommerce/ubercart/payment/uc_cybersource/uc_cybersource.module
  41. 2 0
      sites/all/modules/contrib/ecommerce/ubercart/payment/uc_cybersource/uc_cybersource.soap.inc
  42. 3 4
      sites/all/modules/contrib/ecommerce/ubercart/payment/uc_google_checkout/uc_google_checkout.info
  43. 7 2
      sites/all/modules/contrib/ecommerce/ubercart/payment/uc_payment/tests/uc_payment.test
  44. 0 1
      sites/all/modules/contrib/ecommerce/ubercart/payment/uc_payment/uc_payment.admin.inc
  45. 3 4
      sites/all/modules/contrib/ecommerce/ubercart/payment/uc_payment/uc_payment.info
  46. 0 1
      sites/all/modules/contrib/ecommerce/ubercart/payment/uc_payment/uc_payment.module
  47. 3 0
      sites/all/modules/contrib/ecommerce/ubercart/payment/uc_payment/uc_payment.rules.inc
  48. 1 0
      sites/all/modules/contrib/ecommerce/ubercart/payment/uc_payment/uc_payment_order_pane.inc
  49. 3 4
      sites/all/modules/contrib/ecommerce/ubercart/payment/uc_payment_pack/uc_payment_pack.info
  50. 0 1
      sites/all/modules/contrib/ecommerce/ubercart/payment/uc_payment_pack/uc_payment_pack.module
  51. 0 1
      sites/all/modules/contrib/ecommerce/ubercart/payment/uc_payment_pack/uc_payment_pack.variable.inc
  52. 3 4
      sites/all/modules/contrib/ecommerce/ubercart/payment/uc_paypal/uc_paypal.info
  53. 49 8
      sites/all/modules/contrib/ecommerce/ubercart/payment/uc_paypal/uc_paypal.module
  54. 23 17
      sites/all/modules/contrib/ecommerce/ubercart/payment/uc_paypal/uc_paypal.pages.inc
  55. 3 4
      sites/all/modules/contrib/ecommerce/ubercart/shipping/uc_flatrate/uc_flatrate.info
  56. 0 1
      sites/all/modules/contrib/ecommerce/ubercart/shipping/uc_flatrate/uc_flatrate.module
  57. 20 11
      sites/all/modules/contrib/ecommerce/ubercart/shipping/uc_quote/tests/uc_quote.test
  58. 3 4
      sites/all/modules/contrib/ecommerce/ubercart/shipping/uc_quote/uc_quote.info
  59. 1 2
      sites/all/modules/contrib/ecommerce/ubercart/shipping/uc_quote/uc_quote.module
  60. 0 1
      sites/all/modules/contrib/ecommerce/ubercart/shipping/uc_quote/uc_quote.variable.inc
  61. 1 1
      sites/all/modules/contrib/ecommerce/ubercart/shipping/uc_shipping/uc-packing-slip.tpl.php
  62. 18 10
      sites/all/modules/contrib/ecommerce/ubercart/shipping/uc_shipping/uc_shipping.admin.inc
  63. 3 2
      sites/all/modules/contrib/ecommerce/ubercart/shipping/uc_shipping/uc_shipping.api.php
  64. 3 4
      sites/all/modules/contrib/ecommerce/ubercart/shipping/uc_shipping/uc_shipping.info
  65. 1 5
      sites/all/modules/contrib/ecommerce/ubercart/shipping/uc_shipping/uc_shipping.module
  66. 1 1
      sites/all/modules/contrib/ecommerce/ubercart/shipping/uc_shipping/uc_shipping.rules.inc
  67. 0 1
      sites/all/modules/contrib/ecommerce/ubercart/shipping/uc_shipping/uc_shipping.tokens.inc
  68. 2 0
      sites/all/modules/contrib/ecommerce/ubercart/shipping/uc_shipping/views/uc_shipping_handler_field_package_weight.inc
  69. 10 10
      sites/all/modules/contrib/ecommerce/ubercart/shipping/uc_ups/uc_ups.admin.inc
  70. 3 4
      sites/all/modules/contrib/ecommerce/ubercart/shipping/uc_ups/uc_ups.info
  71. 14 10
      sites/all/modules/contrib/ecommerce/ubercart/shipping/uc_ups/uc_ups.module
  72. 13 13
      sites/all/modules/contrib/ecommerce/ubercart/shipping/uc_ups/uc_ups.ship.inc
  73. 9 9
      sites/all/modules/contrib/ecommerce/ubercart/shipping/uc_usps/uc_usps.admin.inc
  74. 3 4
      sites/all/modules/contrib/ecommerce/ubercart/shipping/uc_usps/uc_usps.info
  75. 15 12
      sites/all/modules/contrib/ecommerce/ubercart/shipping/uc_usps/uc_usps.module
  76. 2 2
      sites/all/modules/contrib/ecommerce/ubercart/shipping/uc_usps/uc_usps.rules_defaults.inc
  77. 3 4
      sites/all/modules/contrib/ecommerce/ubercart/shipping/uc_weightquote/uc_weightquote.info
  78. 0 1
      sites/all/modules/contrib/ecommerce/ubercart/shipping/uc_weightquote/uc_weightquote.module
  79. 3 4
      sites/all/modules/contrib/ecommerce/ubercart/uc_ajax_admin/uc_ajax_admin.info
  80. 2 1
      sites/all/modules/contrib/ecommerce/ubercart/uc_ajax_admin/uc_ajax_admin.module
  81. 2 1
      sites/all/modules/contrib/ecommerce/ubercart/uc_attribute/tests/uc_attribute.test
  82. 4 1
      sites/all/modules/contrib/ecommerce/ubercart/uc_attribute/tests/uc_attribute_checkout.test
  83. 14 5
      sites/all/modules/contrib/ecommerce/ubercart/uc_attribute/uc_attribute.admin.inc
  84. 3 4
      sites/all/modules/contrib/ecommerce/ubercart/uc_attribute/uc_attribute.info
  85. 103 78
      sites/all/modules/contrib/ecommerce/ubercart/uc_attribute/uc_attribute.module
  86. 91 34
      sites/all/modules/contrib/ecommerce/ubercart/uc_cart/tests/uc_cart.test
  87. 3 4
      sites/all/modules/contrib/ecommerce/ubercart/uc_cart/tests/uc_cart_entity_test.info
  88. 5 4
      sites/all/modules/contrib/ecommerce/ubercart/uc_cart/uc_cart.admin.inc
  89. 1 2
      sites/all/modules/contrib/ecommerce/ubercart/uc_cart/uc_cart.api.php
  90. 4 2
      sites/all/modules/contrib/ecommerce/ubercart/uc_cart/uc_cart.controller.inc
  91. 3 4
      sites/all/modules/contrib/ecommerce/ubercart/uc_cart/uc_cart.info
  92. 0 1
      sites/all/modules/contrib/ecommerce/ubercart/uc_cart/uc_cart.info.inc
  93. 1 1
      sites/all/modules/contrib/ecommerce/ubercart/uc_cart/uc_cart.install
  94. 11 11
      sites/all/modules/contrib/ecommerce/ubercart/uc_cart/uc_cart.module
  95. 1 2
      sites/all/modules/contrib/ecommerce/ubercart/uc_cart/uc_cart.rules.inc
  96. 1 1
      sites/all/modules/contrib/ecommerce/ubercart/uc_cart/uc_cart.rules_defaults.inc
  97. 0 1
      sites/all/modules/contrib/ecommerce/ubercart/uc_cart/uc_cart.variable.inc
  98. 1 1
      sites/all/modules/contrib/ecommerce/ubercart/uc_cart/uc_cart_checkout_pane.inc
  99. 106 105
      sites/all/modules/contrib/ecommerce/ubercart/uc_cart_links/tests/uc_cart_links.test
  100. 3 4
      sites/all/modules/contrib/ecommerce/ubercart/uc_cart_links/uc_cart_links.info

+ 2 - 2
PATCH_LIST.txt

@@ -9,7 +9,7 @@ https://www.drupal.org/node/1754162
 
 # Modules :
 
-link : allow any tld (https://www.drupal.org/node/2299657#comment-11414075)
+// link : allow any tld (https://www.drupal.org/node/2299657#comment-11414075) commited in dev
 cer
 contentadminrelink
 // entity_translation_search_api
@@ -23,7 +23,7 @@ filter_path_alias
 // search_api_page
 // search_api_solr
 termreferencetree
-views
+?? views
 wysiwyg
 views_rss_media
 node_export :

+ 21 - 5
sites/all/modules/contrib/admin/context/context.core.inc

@@ -94,11 +94,27 @@ function context_theme_registry_alter(&$theme_registry) {
  */
 function context_ctools_render_alter($info, $page, $data) {
   extract($data);
-  if ($page && in_array($task['name'], array('node_view', 'node_edit'), TRUE)) {
-    foreach ($contexts as $ctools_context) {
-      if (in_array('node', $ctools_context->type) && !empty($ctools_context->data)) {
-        context_node_condition($ctools_context->data, $task['name'] === 'node_view' ? 'view' : 'form');
-        break;
+
+  // Check for page handlers.
+  if ($page) {
+    // Check for node page handler.
+    if (in_array($task['name'], array('node_view', 'node_edit'), TRUE)) {
+      foreach ($contexts as $ctools_context) {
+        if (in_array('node', $ctools_context->type) && !empty($ctools_context->data)) {
+          context_node_condition($ctools_context->data, $task['name'] === 'node_view' ? 'view' : 'form');
+          break;
+        }
+      }
+    }
+    // Check for taxonomy term page handler.
+    elseif (in_array($task['name'], array('term_view', 'term_edit'), TRUE)) {
+      foreach ($contexts as $ctools_context) {
+        if (in_array('taxonomy_term', $ctools_context->type) && !empty($ctools_context->data)) {
+          if ($plugin = context_get_plugin('condition', 'taxonomy_term')) {
+            $plugin->execute($ctools_context->data, $task['name'] === 'term_view' ? 'view' : 'form');
+          }
+          break;
+        }
       }
     }
   }

+ 3 - 4
sites/all/modules/contrib/admin/context/context.info

@@ -8,9 +8,8 @@ files[] = tests/context.test
 files[] = tests/context.conditions.test
 files[] = tests/context.reactions.test
 
-; Information added by Drupal.org packaging script on 2016-05-18
-version = "7.x-3.7"
+; Information added by Drupal.org packaging script on 2019-02-26
+version = "7.x-3.10"
 core = "7.x"
 project = "context"
-datestamp = "1463605446"
-
+datestamp = "1551220089"

+ 5 - 0
sites/all/modules/contrib/admin/context/context.module

@@ -243,6 +243,11 @@ function context_preprocess_menu_link(&$variables) {
         //   css class to the link of this menu.
         // - Do not add class twice on current page.
         if (in_array($variables['element']['#href'], $reaction_menu_paths) && $variables['element']['#href'] != $_GET['q']) {
+          // Initialize classes array if not set.
+          if (!isset($variables['element']['#localized_options']['attributes']['class'])) {
+            $variables['element']['#localized_options']['attributes']['class'] = array();
+          }
+
           // Do not add the 'active' class twice in views tabs.
           if (!in_array('active', $variables['element']['#localized_options']['attributes']['class'])) {
             $variables['element']['#localized_options']['attributes']['class'][] = 'active';

+ 3 - 4
sites/all/modules/contrib/admin/context/context_layouts/context_layouts.info

@@ -6,9 +6,8 @@ core = 7.x
 
 files[] = plugins/context_layouts_reaction_block.inc
 
-; Information added by Drupal.org packaging script on 2016-05-18
-version = "7.x-3.7"
+; Information added by Drupal.org packaging script on 2019-02-26
+version = "7.x-3.10"
 core = "7.x"
 project = "context"
-datestamp = "1463605446"
-
+datestamp = "1551220089"

+ 3 - 4
sites/all/modules/contrib/admin/context/context_ui/context_ui.info

@@ -8,9 +8,8 @@ configure = admin/structure/context
 files[] = context.module
 files[] = tests/context_ui.test
 
-; Information added by Drupal.org packaging script on 2016-05-18
-version = "7.x-3.7"
+; Information added by Drupal.org packaging script on 2019-02-26
+version = "7.x-3.10"
 core = "7.x"
 project = "context"
-datestamp = "1463605446"
-
+datestamp = "1551220089"

+ 1 - 1
sites/all/modules/contrib/admin/context/plugins/context_condition_query_string.inc

@@ -16,7 +16,7 @@ class context_condition_query_string extends context_condition_path {
    */
   function execute() {
     if ($this->condition_used()) {
-      $current_query_string = $_SERVER["QUERY_STRING"];
+      $current_query_string = empty($_SERVER["QUERY_STRING"]) ? '' : $_SERVER["QUERY_STRING"];
       foreach ($this->get_contexts() as $context) {
         $query_strings = $this->fetch_from_context($context, 'values');
         if ($this->match($current_query_string, $query_strings, TRUE)) {

+ 11 - 10
sites/all/modules/contrib/admin/context/plugins/context_reaction_block.inc

@@ -400,13 +400,17 @@ class context_reaction_block extends context_reaction {
       unset($_context_blocks);
 
       foreach ($context_blocks as $r => $blocks) {
-        //only render blocks in an active region
+        // Only render blocks in an active region.
         if (array_key_exists($r, $active_regions)) {
           $context_blocks[$r] = _block_render_blocks($blocks);
 
-          // Make blocks editable if allowed.
-          if ($this->is_editable_region($r)) {
-            foreach ($context_blocks[$r] as $key => $block) {
+          $editable = $this->is_editable_region($r);
+          foreach ($context_blocks[$r] as $key => $block) {
+            // Add the region property to each block.
+            $context_blocks[$r][$key]->region = $r;
+
+            // Make blocks editable if allowed.
+            if ($editable) {
               $context_blocks[$r][$key] = $this->editable_block($block);
             }
           }
@@ -450,12 +454,9 @@ class context_reaction_block extends context_reaction {
    */
   protected function max_block_weight() {
     $blocks = $this->get_blocks();
-    $block_count = 0;
-    foreach ($blocks as $region => $block_list) {
-      $block_count += count($block_list);
-    }
-    // Add 2 to make sure there's space at either end of the block list
-    return round(($block_count + 2) / 2);
+
+    // Add 2 to make sure there's space at either end of the block list.
+    return round((count($blocks) + 2) / 2);
   }
 
   /**

+ 1 - 1
sites/all/modules/contrib/admin/context/plugins/context_reaction_block.js

@@ -68,7 +68,7 @@ DrupalContextBlockForm = function(blockForm) {
 
     // Hide enabled blocks from selector that are used
     $('table.context-blockform-region tr').each(function() {
-      var bid = $(this).attr('id');
+      var bid = Drupal.checkPlain($(this).attr('id'));
       $('div.context-blockform-selector input[value="'+bid+'"]').parents('div.form-item').eq(0).hide();
     });
     // Show blocks in selector that are unused

+ 5 - 1
sites/all/modules/contrib/admin/context/plugins/context_reaction_region.inc

@@ -17,7 +17,7 @@ class context_reaction_region extends context_reaction {
           '#type' => 'fieldset',
           '#title' => "Disable Regions in {$theme->name} Theme",
           '#collapsible' => TRUE,
-          '#collapsed' => !array_reduce($default, create_function('$a, $b', 'return $a || $b;')),
+          '#collapsed' => !array_reduce($default, 'context_reaction_region::collapseRegion'),
         );
         $form[$theme->name]['disable'] = array(
           '#type' => 'checkboxes',
@@ -29,6 +29,10 @@ class context_reaction_region extends context_reaction {
     }
     return $form;
   }
+
+  function collapseRegion($a, $b) {
+    return $a || $b;
+  }
   
   function execute(&$page) {  
     global $theme;

+ 23 - 12
sites/all/modules/contrib/admin/module_filter/CHANGELOG.txt

@@ -1,27 +1,38 @@
-Module Filter 7.x-2.x, 2015-02-20
+Module Filter 7.x-2.1, 2017-06-09
 ---------------------------------
-Simplifying the table rows by hiding version and requirements until a
-  particular description is clicked.
+Issue #2437439 by mikhail.krainiuk, greenSkin, jayhawkfan75: Module Filter does
+  not care about anchors in permission links.
+Issue #2866236 by Munavijayalakshmi, dhruveshdtripathi: Typo error in
+  README.TXT file.
+Issue #2452067 by Madis: Option to show description expanded as default
+  not working.
+Issue #2580791 by makbul_khan8: Coding standards and few function without
+  help comments.
+Issue #2153697 by annya: Disabling option "Number of enabled modules" breaks
+  tabs functionality.
+Issue #1710230 by willvincent: On | Off buttons does not change state with
+  jquery_update module active.
+Added option to show description as expanded by default.
+Improved description field so when it is open, interacting with it's contents
+  does not make it collapse.
+Placed collapsed/expanded images inside of module for easier, more reliable
+  access.
+Added option to place version in own column.
+Issue #2113191 by joelpittet: Category tabs not working.
 
 
-Module Filter 7.x-2.x, 2014-09-01
+Module Filter 7.x-2.0, 2015-02-22
 ---------------------------------
+Simplifying the table rows by hiding version and requirements until a
+  particular description is clicked.
 #2235553 by greenSkin: Fixed latest jquery_update breaks module filter.
 #2304687 by mpdonadio: Fixed Remove hardcoded operations.
 #2293029 by topsitemakers: Fixed Take header offset into account when selecting
   a tab.
 #2290213 by topsitemakers: Minor typo in description - "has no affect" -> "has
   no effect".
-
-
-Module Filter 7.x-2.0-alpha2, 2013-12-06
-----------------------------------------
 #2141743, #2141743 by greenSkin: Fixed issues related to the new dynamically
   positioned tabs and using the dynamically positioned save button.
-
-
-Module Filter 7.x-2.0-alpha1, 2013-11-18
-----------------------------------------
 by greenSkin: Tabs now should always be visible while scrolling large lists of
   modules.
 #1854348 by alexweber, greenSkin: Make filter textfield wider on modules page

+ 2 - 2
sites/all/modules/contrib/admin/module_filter/README.txt

@@ -17,8 +17,8 @@ visibility of modules that are disabled and depend on module(s) that are
 missing.
 
 The update status report filter also contains four checkboxes: Up-to-Date,
-Update availabe, Security update, and Unknown. These directly affect the
-visibilty of each project; whether it is up-to-date, there is an update
+Update available, Security update, and Unknown. These directly affect the
+visibility of each project; whether it is up-to-date, there is an update
 available, a security update is available, or the status is unknown.
 
 Installation

+ 6 - 0
sites/all/modules/contrib/admin/module_filter/css/module_filter.css

@@ -18,3 +18,9 @@
   text-transform: uppercase;
   color: #888;
 }
+#module-filter-modules {
+  position: relative;
+}
+#module-filter-modules table {
+  position: absolute;
+}

+ 0 - 3
sites/all/modules/contrib/admin/module_filter/css/module_filter_tab.css

@@ -167,9 +167,6 @@ html.js #module-filter-modules table td {
 .admin-version {
   white-space: nowrap;
 }
-.admin-operations {
-  float: right;
-}
 .admin-operations a.module-link {
   display: inline;
 }

+ 8 - 2
sites/all/modules/contrib/admin/module_filter/css/modules.css

@@ -7,6 +7,9 @@
 #system-modules th.name {
   width: 25%;
 }
+#system-modules th.version {
+  width: 10%;
+}
 #system-modules th.links {
   width: 15%;
 }
@@ -14,12 +17,12 @@
   vertical-align: top;
 }
 #system-modules .expand.inner {
-  background: transparent url(/misc/menu-collapsed.png) left 0.6em no-repeat;
+  background: transparent url(../images/collapsed.png) left 0.6em no-repeat;
   margin-left: -12px;
   padding-left: 12px;
 }
 #system-modules .expanded.expand.inner {
-  background: transparent url(/misc/menu-expanded.png) left 0.6em no-repeat;
+  background: transparent url(../images/expanded.png) left 0.6em no-repeat;
 }
 #system-modules .description {
   cursor: pointer;
@@ -29,6 +32,9 @@
   text-overflow: ellipsis;
   white-space: nowrap;
 }
+#system-modules .description .inner.expanded > * {
+  cursor: auto;
+}
 #system-modules .description .requirements,
 #system-modules .description .links {
   display: none;

BIN
sites/all/modules/contrib/admin/module_filter/images/collapsed.png


BIN
sites/all/modules/contrib/admin/module_filter/images/expanded.png


+ 3 - 0
sites/all/modules/contrib/admin/module_filter/js/module_filter.js

@@ -265,6 +265,9 @@ $.fn.moduleFilter = function(selector, options) {
   if (Drupal.settings.moduleFilter.setFocus) {
     filterInput.focus();
   }
+  if (Drupal.settings.moduleFilter.expandedDescription) {
+    $('#system-modules td.description .inner.expand').addClass('expanded');
+  }
   filterInput.data('moduleFilter', new Drupal.ModuleFilter.Filter(this, selector, options));
 };
 

+ 9 - 12
sites/all/modules/contrib/admin/module_filter/js/module_filter_tab.js

@@ -57,7 +57,7 @@ Drupal.behaviors.moduleFilterTabs = {
         // Build tabs from package title rows.
         var tabs = '<ul>';
         for (var i in Drupal.settings.moduleFilter.packageIDs) {
-          var id = Drupal.settings.moduleFilter.packageIDs[i];
+          var id = Drupal.checkPlain(Drupal.settings.moduleFilter.packageIDs[i]);
 
           var name = id;
           var tabClass = 'project-tab';
@@ -84,9 +84,9 @@ Drupal.behaviors.moduleFilterTabs = {
                 summary += '<span>' + Drupal.t('No modules were enabled or disabled within the last week.') + '</span>';
               }
               break;
-            default: 
-              var $row = $('#' + id + '-package');
-              name = $.trim($row.text());
+            default:
+              var $row = $('#' + id + '-package', this);
+              name = Drupal.checkPlain($.trim($row.text()));
               $row.remove();
               break;
           }
@@ -233,8 +233,8 @@ Drupal.behaviors.moduleFilterTabs = {
         }
 
         if (Drupal.settings.moduleFilter.useSwitch) {
-          $('td.checkbox div.form-item').hide();
-          $('td.checkbox').each(function(i) {
+          $('td.checkbox div.form-item', table).hide();
+          $('td.checkbox', table).each(function(i) {
             var $cell = $(this);
             var $checkbox = $(':checkbox', $cell);
             var $switch = $('.toggle-enable', $cell);
@@ -242,17 +242,14 @@ Drupal.behaviors.moduleFilterTabs = {
               if (!$(this).hasClass('disabled')) {
                 if (Drupal.ModuleFilter.jQueryIsNewer()) {
                   $checkbox.click();
+                  $switch.toggleClass('off');
                 }
                 else {
                   $checkbox.click().change();
+                  $switch.toggleClass('off');
                 }
               }
             });
-            $checkbox.click(function() {
-              if (!$switch.hasClass('disabled')) {
-                $switch.toggleClass('off');
-              }
-            });
           });
         }
 
@@ -520,7 +517,7 @@ Drupal.ModuleFilter.updateVisualAid = function(type, $row) {
   }
 
   var tab = Drupal.ModuleFilter.tabs[id];
-  var name = $('td:nth(1) strong', $row).text();
+  var name = Drupal.checkPlain($('td:nth(1) strong', $row).text());
   switch (type) {
     case 'enable':
       if (Drupal.ModuleFilter.disabling[id + name] != undefined) {

+ 7 - 2
sites/all/modules/contrib/admin/module_filter/js/modules.js

@@ -3,8 +3,13 @@
 Drupal.behaviors.moduleFilter = {
   attach: function(context) {
     $('#system-modules td.description').once('description', function() {
-      $('.inner.expand', $(this)).click(function() {
-        $(this).toggleClass('expanded');
+      $(this).click(function() {
+        $('.inner.expand', $(this)).toggleClass('expanded');
+      });
+      $('.inner.expand', $(this)).children().click(function(e) {
+        if ($(this).parent().hasClass('expanded')) {
+          e.stopPropagation();
+        }
       });
     });
 

+ 19 - 7
sites/all/modules/contrib/admin/module_filter/module_filter.admin.inc

@@ -25,44 +25,44 @@ function module_filter_settings() {
     '#type' => 'checkbox',
     '#title' => t('Enhance the modules page with tabs'),
     '#description' => t('Alternate tabbed theme that restructures packages into tabs.'),
-    '#default_value' => variable_get('module_filter_tabs', 1)
+    '#default_value' => variable_get('module_filter_tabs', 1),
   );
   $form['tabs'] = array(
     '#type' => 'fieldset',
     '#title' => t('Tabs'),
     '#description' => t('Settings used with the tabs view of the modules page.'),
     '#collapsible' => TRUE,
-    '#collapsed' => FALSE
+    '#collapsed' => FALSE,
   );
   $form['tabs']['module_filter_count_enabled'] = array(
     '#type' => 'checkbox',
     '#title' => t('Number of enabled modules'),
     '#description' => t('Display the number of enabled modules in the active tab along with the total number of modules.'),
-    '#default_value' => variable_get('module_filter_count_enabled', 1)
+    '#default_value' => variable_get('module_filter_count_enabled', 1),
   );
   $form['tabs']['module_filter_visual_aid'] = array(
     '#type' => 'checkbox',
     '#title' => t('Visual aids'),
     '#description' => t('When enabling/disabling modules, the module name will display in the tab summary.<br />When filtering, a count of results for each tab will be presented.'),
-    '#default_value' => variable_get('module_filter_visual_aid', 1)
+    '#default_value' => variable_get('module_filter_visual_aid', 1),
   );
   $form['tabs']['module_filter_hide_empty_tabs'] = array(
     '#type' => 'checkbox',
     '#title' => t('Hide tabs with no results'),
     '#description' => t('When a filter returns no results for a tab, the tab is hidden. This is dependent on visual aids being enabled.'),
-    '#default_value' => variable_get('module_filter_hide_empty_tabs', 0)
+    '#default_value' => variable_get('module_filter_hide_empty_tabs', 0),
   );
   $form['tabs']['module_filter_dynamic_save_position'] = array(
     '#type' => 'checkbox',
     '#title' => t('Dynamically position Save button'),
     '#description' => t("For sites with lots of tabs, enable to help keep the 'Save configuration' button more accessible."),
-    '#default_value' => variable_get('module_filter_dynamic_save_position', 1)
+    '#default_value' => variable_get('module_filter_dynamic_save_position', 1),
   );
   $form['tabs']['module_filter_use_url_fragment'] = array(
     '#type' => 'checkbox',
     '#title' => t('Use URL fragment'),
     '#description' => t('Use URL fragment when navigating between tabs. This lets you use the browsers back/forward buttons to navigate through the tabs you selected.') . '<br />' . t('When the Overlay module is enabled this functionality will not be used since overlay relies on the URL fragment.'),
-    '#default_value' => variable_get('module_filter_use_url_fragment', 1)
+    '#default_value' => variable_get('module_filter_use_url_fragment', 1),
   );
   $form['tabs']['module_filter_use_switch'] = array(
     '#type' => 'checkbox',
@@ -82,6 +82,18 @@ function module_filter_settings() {
     '#description' => t('When enabled, the active tab will be remembered.'),
     '#default_value' => variable_get('module_filter_remember_active_tab', 1),
   );
+  $form['tabs']['module_filter_version_column'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Place version in own column'),
+    '#description' => t("Moves the version out of the description and into it's own column"),
+    '#default_value' => variable_get('module_filter_version_column', 0),
+  );
+  $form['tabs']['module_filter_expanded_description'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Expand description by default'),
+    '#description' => t('When enabled, the description will be expanded by default.'),
+    '#default_value' => variable_get('module_filter_expanded_description', 0),
+  );
 
   $form['update'] = array(
     '#type' => 'fieldset',

+ 3 - 5
sites/all/modules/contrib/admin/module_filter/module_filter.info

@@ -4,7 +4,6 @@ core = 7.x
 package = Administration
 
 files[] = module_filter.install
-files[] = module_filter.js
 files[] = module_filter.module
 files[] = module_filter.admin.inc
 files[] = module_filter.theme.inc
@@ -17,9 +16,8 @@ files[] = js/module_filter_tab.js
 
 configure = admin/config/user-interface/modulefilter
 
-; Information added by Drupal.org packaging script on 2015-02-22
-version = "7.x-2.0"
+; Information added by Drupal.org packaging script on 2019-03-27
+version = "7.x-2.2"
 core = "7.x"
 project = "module_filter"
-datestamp = "1424631189"
-
+datestamp = "1553698385"

+ 2 - 0
sites/all/modules/contrib/admin/module_filter/module_filter.install

@@ -19,6 +19,8 @@ function module_filter_uninstall() {
   variable_del('module_filter_track_recent_modules');
   variable_del('module_filter_remember_active_tab');
   variable_del('module_filter_remember_update_state');
+  variable_del('module_filter_version_column');
+  variable_del('module_filter_expanded_description');
 }
 
 /**

+ 60 - 24
sites/all/modules/contrib/admin/module_filter/module_filter.module

@@ -18,8 +18,8 @@ function module_filter_permission() {
   return array(
     'administer module filter' => array(
       'title' => t('Administer Module Filter'),
-      'description' => t('Configure how Module Filter performs.')
-    )
+      'description' => t('Configure how Module Filter performs.'),
+    ),
   );
 }
 
@@ -33,7 +33,7 @@ function module_filter_menu() {
     'access arguments' => array('administer module filter'),
     'page callback' => 'drupal_get_form',
     'page arguments' => array('module_filter_settings'),
-    'file' => 'module_filter.admin.inc'
+    'file' => 'module_filter.admin.inc',
   );
   return $items;
 }
@@ -63,32 +63,32 @@ function module_filter_form_system_modules_alter(&$form, &$form_state, $form_id)
     '#type' => 'module_filter',
     '#attached' => array(
       'js' => array(
-        drupal_get_path('module', 'module_filter') . '/js/modules.js'
-      )
-    )
+        drupal_get_path('module', 'module_filter') . '/js/modules.js' => array('weight' => 1),
+      ),
+    ),
   );
   $checkbox_defaults = array(
     ((isset($_GET['enabled'])) ? $_GET['enabled'] : 1) ? 'enabled' : '',
     ((isset($_GET['disabled'])) ? $_GET['disabled'] : 1) ? 'disabled' : '',
     ((isset($_GET['required'])) ? $_GET['required'] : 1) ? 'required' : '',
-    ((isset($_GET['unavailable'])) ? $_GET['unavailable'] : 1) ? 'unavailable' : ''
+    ((isset($_GET['unavailable'])) ? $_GET['unavailable'] : 1) ? 'unavailable' : '',
   );
   $form['module_filter']['show'] = array(
     '#type' => 'checkboxes',
     '#default_value' => array_filter($checkbox_defaults),
     '#options' => array('enabled' => t('Enabled'), 'disabled' => t('Disabled'), 'required' => t('Required'), 'unavailable' => t('Unavailable')),
     '#prefix' => '<div id="module-filter-show-wrapper">',
-    '#suffix' => '</div>'
+    '#suffix' => '</div>',
   );
 
   if (variable_get('module_filter_tabs', 1)) {
-    $form['module_filter']['#attached']['css'][] = drupal_get_path('module', 'module_filter') .'/css/module_filter_tab.css';
+    $form['module_filter']['#attached']['css'][] = drupal_get_path('module', 'module_filter') . '/css/module_filter_tab.css';
     $form['module_filter']['#attached']['library'][] = array('system', 'jquery.bbq');
-    $form['module_filter']['#attached']['js'][] = drupal_get_path('module', 'module_filter') .'/js/module_filter_tab.js';
+    $form['module_filter']['#attached']['js'][drupal_get_path('module', 'module_filter') . '/js/module_filter_tab.js'] = array('weight' => 2);
 
     if (!module_exists('page_actions') && variable_get('module_filter_dynamic_save_position', 1)) {
-      $form['module_filter']['#attached']['css'][] = drupal_get_path('module', 'module_filter') .'/css/dynamic_position.css';
-      $form['module_filter']['#attached']['js'][] = drupal_get_path('module', 'module_filter') .'/js/dynamic_position.js';
+      $form['module_filter']['#attached']['css'][] = drupal_get_path('module', 'module_filter') . '/css/dynamic_position.css';
+      $form['module_filter']['#attached']['js'][drupal_get_path('module', 'module_filter') . '/js/dynamic_position.js'] = array('weight' => 3);
     }
 
     $form['#attached']['css'][] = drupal_get_path('module', 'module_filter') . '/css/modules.css';
@@ -128,7 +128,7 @@ function module_filter_element_info() {
     '#process' => array('form_process_module_filter', 'ajax_process_form'),
     '#weight' => -1,
     '#tree' => TRUE,
-    '#theme' => 'module_filter'
+    '#theme' => 'module_filter',
   );
   return $types;
 }
@@ -153,6 +153,18 @@ function module_filter_theme() {
   );
 }
 
+/**
+ * Create and add new textfield element.
+ *
+ * @param $element
+ *   An associative array containing the properties and children of the
+ *   form actions container.
+ * @param $form_state
+ *   The $form_state array for the form this element belongs to.
+ *
+ * @return
+ *   The processed element.
+ */
 function form_process_module_filter($element, &$form_state) {
   $element['name'] = array(
     '#type' => 'textfield',
@@ -163,7 +175,7 @@ function form_process_module_filter($element, &$form_state) {
     '#attributes' => ((isset($element['#attributes'])) ? $element['#attributes'] : array()) + array('autocomplete' => 'off'),
     '#attached' => array(
       'css' => array(
-        drupal_get_path('module', 'module_filter') . '/css/module_filter.css'
+        drupal_get_path('module', 'module_filter') . '/css/module_filter.css',
       ),
       'js' => array(
         'misc/jquery.cookie.js',
@@ -182,12 +194,13 @@ function form_process_module_filter($element, &$form_state) {
               'trackRecent' => variable_get('module_filter_track_recent_modules', 1),
               'rememberActiveTab' => variable_get('module_filter_remember_active_tab', 1),
               'rememberUpdateState' => variable_get('module_filter_remember_update_state', 0),
-            )
+              'expandedDescription' => variable_get('module_filter_expanded_description', 0),
+            ),
           ),
-          'type' => 'setting'
-        )
-      )
-    )
+          'type' => 'setting',
+        ),
+      ),
+    ),
   );
   if (isset($element['#description'])) {
     $element['name']['#description'] = $element['#description'];
@@ -195,15 +208,18 @@ function form_process_module_filter($element, &$form_state) {
   return $element;
 }
 
+/**
+ * Form submission handler to filters module list.
+ */
 function module_filter_system_modules_submit_redirect($form, &$form_state) {
   $query = array();
   if (!empty($form_state['values']['module_filter']['name'])) {
     $query['filter'] = $form_state['values']['module_filter']['name'];
   }
-  $query['enabled'] = (int)(!empty($form_state['values']['module_filter']['show']['enabled']));
-  $query['disabled'] = (int)(!empty($form_state['values']['module_filter']['show']['disabled']));
-  $query['required'] = (int)(!empty($form_state['values']['module_filter']['show']['required']));
-  $query['unavailable'] = (int)(!empty($form_state['values']['module_filter']['show']['unavailable']));
+  $query['enabled'] = (int) (!empty($form_state['values']['module_filter']['show']['enabled']));
+  $query['disabled'] = (int) (!empty($form_state['values']['module_filter']['show']['disabled']));
+  $query['required'] = (int) (!empty($form_state['values']['module_filter']['show']['required']));
+  $query['unavailable'] = (int) (!empty($form_state['values']['module_filter']['show']['unavailable']));
 
   $form_state['redirect'] = array(
     'admin/modules',
@@ -211,6 +227,9 @@ function module_filter_system_modules_submit_redirect($form, &$form_state) {
   );
 }
 
+/**
+ * Form submission handler to track recently enabled/disabled modules
+ */
 function module_filter_system_modules_submit_recent($form, &$form_state) {
   $recent_modules = variable_get('module_filter_recent_modules', array());
 
@@ -225,6 +244,11 @@ function module_filter_system_modules_submit_recent($form, &$form_state) {
   variable_set('module_filter_recent_modules', $recent_modules);
 }
 
+/**
+ * Create list of newly added modules (within a week)
+ * @return
+ *   An array of newly added modules.
+ */
 function module_filter_new_modules() {
   // Get current list of modules.
   $files = system_rebuild_module_data();
@@ -249,12 +273,24 @@ function module_filter_new_modules() {
   return $new_modules;
 }
 
+/**
+ * Function to replace special characters with hyphen.
+ * @param string $text
+ * @return
+ *   String
+ */
 function module_filter_get_id($text) {
   $id = strtolower($text);
   $id = preg_replace('/([^a-z0-9]+)/', '-', $id);
   return trim($id, '-');
 }
 
+/**
+ * Function to return true/false depending on module changed time and a week timestamp
+ * @param integer $var
+ * @return
+ *   Boolean indicating
+ */
 function module_filter_recent_filter($var) {
-  return (!($var < REQUEST_TIME - 60*60*24*7));
+  return (!($var < REQUEST_TIME - 60 * 60 * 24 * 7));
 }

+ 12 - 5
sites/all/modules/contrib/admin/module_filter/module_filter.pages.inc

@@ -1,5 +1,9 @@
 <?php
 
+/**
+ * @file
+ */
+
 /**
  * Wrapper function for update_status().
  *
@@ -12,20 +16,23 @@ function module_filter_update_status() {
   return array(
     'module_filter' => drupal_get_form('module_filter_update_status_form'),
     'update_report' => array(
-      '#markup' => $update_report
-    )
+      '#markup' => $update_report,
+    ),
   );
 }
 
+/**
+ * Form builder for the module filter form.
+ */
 function module_filter_update_status_form($form, &$form_state) {
   $form['module_filter'] = array(
     '#type' => 'module_filter',
     '#attached' => array(
       'css' => array(
-        drupal_get_path('module', 'module_filter') . '/css/update_status.css'
+        drupal_get_path('module', 'module_filter') . '/css/update_status.css',
       ),
       'js' => array(
-        drupal_get_path('module', 'module_filter') . '/js/update_status.js'
+        drupal_get_path('module', 'module_filter') . '/js/update_status.js',
       ),
     ),
   );
@@ -34,7 +41,7 @@ function module_filter_update_status_form($form, &$form_state) {
     '#default_value' => (isset($_GET['show']) && in_array($_GET['show'], array('all', 'updates', 'security', 'unknown'))) ? $_GET['show'] : 'all',
     '#options' => array('all' => t('All'), 'updates' => t('Update available'), 'security' => t('Security update'), 'unknown' => t('Unknown')),
     '#prefix' => '<div id="module-filter-show-wrapper">',
-    '#suffix' => '</div>'
+    '#suffix' => '</div>',
   );
   if (module_exists('update_advanced')) {
     $options = $form['module_filter']['show']['#options'];

+ 36 - 18
sites/all/modules/contrib/admin/module_filter/module_filter.theme.inc

@@ -37,6 +37,9 @@ function theme_module_filter_system_modules_tabs($variables) {
     array('data' => t('Description'), 'class' => array('description')),
     array('data' => t('Links'), 'class' => array('links')),
   );
+  if (variable_get('module_filter_version_column', 0)) {
+    array_splice($header, 2, 0, array(array('data' => t('Version'), 'class' => array('version'))));
+  }
   $package_ids = array('all');
   $enabled['all'] = array();
 
@@ -101,11 +104,18 @@ function theme_module_filter_system_modules_tabs($variables) {
       }
       $row[] = array('class' => array('name'), 'data' => $label . '><strong>' . drupal_render($module['name']) . '</strong> <span class="module-machine-name">(' . $key . ')</span></label>');
 
+      if (variable_get('module_filter_version_column', 0) && $version) {
+        $row[] = array('class' => array('version'), 'data' => drupal_render($module['version']));
+      }
+
       // Add the description, along with any modules it requires.
+      if (empty($module['description']['#markup'])) {
+        $module['description']['#markup'] = '<em>' . t('No description available.') . '</em>';
+      }
       $description = '<span class="details"><span class="text">' . drupal_render($module['description']) . '</span></span>';
-      if ($version || $requires || $required_by) {
+      if ($requires || $required_by || (!variable_get('module_filter_version_column', 0) && $version)) {
         $description .= '<div class="requirements">';
-        if ($version) {
+        if (!variable_get('module_filter_version_column', 0) && $version) {
           $description .= '<div class="admin-requirements">' . t('Version: !module-version', array('!module-version' => drupal_render($module['version']))) . '</div>';
         }
         if ($requires) {
@@ -136,21 +146,20 @@ function theme_module_filter_system_modules_tabs($variables) {
     $form['modules'][$package]['#printed'] = TRUE;
   }
 
-  if (variable_get('module_filter_count_enabled', 1)) {
-    $enabled_counts = array();
-    foreach ($enabled as $package_id => $value) {
-      $enabled_counts[$package_id] = array(
-        'enabled' => count(array_filter($value)),
-        'total' => count($value),
-      );
-    }
-    drupal_add_js(array(
-      'moduleFilter' => array(
-        'packageIDs' => $package_ids,
-        'enabledCounts' => $enabled_counts,
-      )
-    ), 'setting');
+  //Get packages and count number of modules
+  $enabled_counts = array();
+  foreach ($enabled as $package_id => $value) {
+    $enabled_counts[$package_id] = array(
+      'enabled' => count(array_filter($value)),
+      'total' => count($value),
+    );
   }
+  drupal_add_js(array(
+    'moduleFilter' => array(
+      'packageIDs' => $package_ids,
+      'enabledCounts' => $enabled_counts,
+    )
+  ), 'setting');
 
   // Add first and last class to rows.
   $rows[0]['class'][] = 'first';
@@ -165,6 +174,12 @@ function theme_module_filter_system_modules_tabs($variables) {
   return $output;
 }
 
+/**
+ * Theme function for module filter operations.
+ * @param $variables
+ * @return
+ *   HTML for admin status operations.
+ */
 function theme_module_filter_operations(&$vars) {
   $links = &$vars['links'];
   $dropbutton = $vars['dropbutton'];
@@ -174,16 +189,19 @@ function theme_module_filter_operations(&$vars) {
     if ($dropbutton) {
       hide($links[$key]);
       if (!empty($links[$key]['#href'])) {
-        $operations[] = array(
+        $operations[$key] = array(
           'title' => $links[$key]['#title'],
           'href' => $links[$key]['#href'],
         );
+        if (isset($links[$key]['#options'])) {
+          $operations[$key] += $links[$key]['#options'];
+        }
       }
     }
     else {
       $data = drupal_render($links[$key]);
       if (!empty($data)) {
-        $operations[] = array('data' => $data);
+        $operations[$key] = array('data' => $data);
       }
     }
   }

+ 3 - 4
sites/all/modules/contrib/ecommerce/ubercart/payment/uc_2checkout/uc_2checkout.info

@@ -4,9 +4,8 @@ dependencies[] = uc_payment
 package = Ubercart - payment
 core = 7.x
 
-; Information added by Drupal.org packaging script on 2016-07-16
-version = "7.x-3.10"
+; Information added by Drupal.org packaging script on 2019-03-06
+version = "7.x-3.12"
 core = "7.x"
 project = "ubercart"
-datestamp = "1468644909"
-
+datestamp = "1551862392"

+ 3 - 4
sites/all/modules/contrib/ecommerce/ubercart/payment/uc_2checkout/uc_2checkout.module

@@ -5,7 +5,6 @@
  * Integrates 2Checkout.com's redirected payment service.
  */
 
-
 /**
  * Implements hook_help().
  */
@@ -153,7 +152,7 @@ function uc_payment_method_2checkout($op, &$order, $form = NULL, &$form_state =
         '#title' => t('Currency for the sale'),
         '#options' => array(
           '' => t('Auto detected by 2CO'),
-          'USD', 'EUR', 'ARS', 'AUD', 'BRL', 'GBP', 'CAD', 'DKK', 'HKD', 'INR', 'ILS', 'JPY', 'LTL', 'MYR', 'MXN', 'NZD', 'NOK', 'PHP', 'RON', 'RUB', 'SGD', 'ZAR', 'SEK', 'CHF', 'TRY', 'AED'
+          'USD', 'EUR', 'ARS', 'AUD', 'BRL', 'GBP', 'CAD', 'DKK', 'HKD', 'INR', 'ILS', 'JPY', 'LTL', 'MYR', 'MXN', 'NZD', 'NOK', 'PHP', 'RON', 'RUB', 'SGD', 'ZAR', 'SEK', 'CHF', 'TRY', 'AED',
         ),
         '#default_value' => variable_get('uc_2checkout_currency_code', ''),
       );
@@ -227,8 +226,8 @@ function uc_2checkout_form($form, &$form_state, $order) {
   $i = 0;
   foreach ($order->products as $product) {
     $i++;
-    $data['li_' . $i .  '_name'] = $product->title;
-    $data['li_' . $i .  '_price'] = uc_currency_format($product->price, FALSE, FALSE, '.');
+    $data['li_' . $i . '_name'] = $product->title;
+    $data['li_' . $i . '_price'] = uc_currency_format($product->price, FALSE, FALSE, '.');
   }
 
   if (variable_get('uc_2checkout_checkout_type', 'dynamic') == 'direct') {

+ 0 - 1
sites/all/modules/contrib/ecommerce/ubercart/payment/uc_2checkout/uc_2checkout.pages.inc

@@ -113,7 +113,6 @@ function uc_2checkout_process_notification() {
           uc_order_update_status($order_id, uc_order_state_default('canceled'));
           uc_order_comment_save($order_id, 0, t('Order have not passed 2Checkout fraud review.'));
           die('fraud');
-          break;
       }
     }
     elseif ($values['message_type'] == 'REFUND_ISSUED') {

+ 3 - 4
sites/all/modules/contrib/ecommerce/ubercart/payment/uc_authorizenet/uc_authorizenet.info

@@ -5,9 +5,8 @@ dependencies[] = uc_credit
 package = Ubercart - payment
 core = 7.x
 
-; Information added by Drupal.org packaging script on 2016-07-16
-version = "7.x-3.10"
+; Information added by Drupal.org packaging script on 2019-03-06
+version = "7.x-3.12"
 core = "7.x"
 project = "ubercart"
-datestamp = "1468644909"
-
+datestamp = "1551862392"

+ 36 - 13
sites/all/modules/contrib/ecommerce/ubercart/payment/uc_authorizenet/uc_authorizenet.module

@@ -3,8 +3,6 @@
 /**
  * @file
  * Processes payments using Authorize.net. Supports AIM and ARB.
- *
- * Development sponsored by Digital Dollhouse - http://www.digitaldollhouse.com
  */
 
 define('UC_AUTHORIZENET_TEST_GATEWAY_URL', 'https://test.authorize.net/gateway/transact.dll');
@@ -110,11 +108,10 @@ function uc_authorizenet_settings_form($form, &$form_state) {
     '#default_value' => variable_get('uc_authnet_response_debug', FALSE),
   );
 
-
   $form['arb_settings'] = array(
     '#type' => 'fieldset',
     '#title' => t('ARB settings'),
-    '#description' => t('These settings pertain to the Authorize.Net Automated Recurring Billing service.')
+    '#description' => t('These settings pertain to the Authorize.Net Automated Recurring Billing service.'),
   );
   $form['arb_settings']['uc_authnet_arb_mode'] = array(
     '#type' => 'radios',
@@ -144,7 +141,7 @@ function uc_authorizenet_settings_form($form, &$form_state) {
   $form['cim_settings'] = array(
     '#type' => 'fieldset',
     '#title' => t('CIM settings'),
-    '#description' => t('These settings pertain to the Authorize.Net Customer Information Management service.')
+    '#description' => t('These settings pertain to the Authorize.Net Customer Information Management service.'),
   );
   $form['cim_settings']['uc_authnet_cim_profile'] = array(
     '#type' => 'checkbox',
@@ -163,7 +160,6 @@ function uc_authorizenet_settings_form($form, &$form_state) {
     '#default_value' => variable_get('uc_authnet_cim_mode', 'disabled'),
   );
 
-
   return $form;
 }
 
@@ -602,14 +598,14 @@ function _uc_authorizenet_charge($order, $amount, $data) {
 /**
  * Sends an XML API Request to Authorize.Net.
  *
- * @param $server
+ * @param string $server
  *   The name of the server to send a request to - 'production' or 'developer'.
- * @param $xml
+ * @param string $xml
  *   The XML to send to Authorize.Net.
  * @param $callback
  *   The name of the function that should process the response.
  *
- * @return
+ * @return bool
  *   TRUE or FALSE indicating the success of the API request.
  */
 function uc_authorizenet_xml_api($server, $xml) {
@@ -626,7 +622,7 @@ function uc_authorizenet_xml_api($server, $xml) {
   $ch = curl_init();
   curl_setopt($ch, CURLOPT_URL, $post_url);
   curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
-  curl_setopt($ch, CURLOPT_HTTPHEADER, Array("Content-Type: text/xml"));
+  curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: text/xml"));
   curl_setopt($ch, CURLOPT_HEADER, 1);
   curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
   curl_setopt($ch, CURLOPT_POST, 1);
@@ -649,12 +645,12 @@ function uc_authorizenet_xml_api($server, $xml) {
  *
  * @param $subscription_id
  *   The ID of the subscription at Authorize.Net.
- * @param $updates
+ * @param array $updates
  *   An array of data to update using key/value pairs from the XML API for ARB;
  *   keys should be children of the subscription element in the XML.
  *   See the ARB_guide.pdf from Authorize.Net for ARBCreateSubscriptionRequests.
  *
- * @return
+ * @return bool
  *   TRUE or FALSE indicating the success of the cancellation.
  */
 function uc_authorizenet_arb_update($subscription_id, $updates, $order_id = NULL) {
@@ -666,7 +662,7 @@ function uc_authorizenet_arb_update($subscription_id, $updates, $order_id = NULL
   $data = array(
     'refId' => substr($order_id . '-' . REQUEST_TIME, 0, 20),
     'subscriptionId' => $subscription_id,
-    'subscription' => $updates
+    'subscription' => $updates,
   );
 
   // Build the XML string.
@@ -696,6 +692,8 @@ function uc_authorizenet_arb_update($subscription_id, $updates, $order_id = NULL
 }
 
 /**
+ * Helper function for XML API requests.
+ *
  * Wraps XML API request child elements in the request element and includes
  * the merchant authentication information.
  */
@@ -738,39 +736,51 @@ function _uc_authorizenet_avs($code) {
     case 'A':
       $text .= t('Address (Street) matches, ZIP does not');
       break;
+
     case 'B':
       $text .= t('Address information not provided for AVS check');
       break;
+
     case 'E':
       $text .= t('AVS error');
       break;
+
     case 'G':
       $text .= t('Non-U.S. Card Issuing Bank');
       break;
+
     case 'N':
       $text .= t('No Match on Address (Street) or ZIP');
       break;
+
     case 'P':
       $text .= t('AVS not applicable for this transaction');
       break;
+
     case 'R':
       $text .= t('Retry – System unavailable or timed out');
       break;
+
     case 'S':
       $text .= t('Service not supported by issuer');
       break;
+
     case 'U':
       $text .= t('Address information is unavailable');
       break;
+
     case 'W':
       $text .= t('Nine digit ZIP matches, Address (Street) does not');
       break;
+
     case 'X':
       $text .= t('Address (Street) and nine digit ZIP match');
       break;
+
     case 'Y':
       $text .= t('Address (Street) and five digit ZIP match');
       break;
+
     case 'Z':
       $text .= t('Five digit ZIP matches, Address (Street) does not');
       break;
@@ -789,15 +799,19 @@ function _uc_authorizenet_cvv($code) {
     case 'M':
       $text .= t('Match');
       break;
+
     case 'N':
       $text .= t('No Match');
       break;
+
     case 'P':
       $text .= t('Not Processed');
       break;
+
     case 'S':
       $text .= t('Should have been present');
       break;
+
     case 'U':
       $text .= t('Issuer unable to process request');
       break;
@@ -813,14 +827,19 @@ function _uc_authorizenet_txn_type($type) {
   switch (strtoupper($type)) {
     case 'AUTH_CAPTURE':
       return t('Authorization and capture');
+
     case 'AUTH_ONLY':
       return t('Authorization only');
+
     case 'PRIOR_AUTH_CAPTURE':
       return t('Prior authorization capture');
+
     case 'CAPTURE_ONLY':
       return t('Capture only');
+
     case 'CREDIT':
       return t('Credit');
+
     case 'VOID':
       return t('Void');
   }
@@ -833,12 +852,16 @@ function _uc_authorizenet_txn_map($type) {
   switch ($type) {
     case UC_CREDIT_AUTH_ONLY:
       return 'AUTH_ONLY';
+
     case UC_CREDIT_PRIOR_AUTH_CAPTURE:
       return 'PRIOR_AUTH_CAPTURE';
+
     case UC_CREDIT_AUTH_CAPTURE:
       return 'AUTH_CAPTURE';
+
     case UC_CREDIT_CREDIT:
       return 'CREDIT';
+
     case UC_CREDIT_VOID:
       return 'VOID';
   }

+ 1 - 2
sites/all/modules/contrib/ecommerce/ubercart/payment/uc_authorizenet/uc_authorizenet.pages.inc

@@ -5,12 +5,11 @@
  * Page callback for Authorize.Net's Silent POST feature.
  */
 
-
 /**
  * Receives a payment notification and handles it appropriately.
  */
 function uc_authorizenet_silent_post() {
-  // Determine if this is an ARB notification or not
+  // Determine if this is an ARB notification or not.
   $arb = (isset($_POST['x_subscription_id']) and isset($_POST['x_subscription_paynum']));
 
   // Log ARB payment notification, if enabled.

+ 3 - 4
sites/all/modules/contrib/ecommerce/ubercart/payment/uc_credit/tests/test_gateway.info

@@ -5,9 +5,8 @@ dependencies[] = uc_credit
 package = Ubercart - payment
 core = 7.x
 
-; Information added by Drupal.org packaging script on 2016-07-16
-version = "7.x-3.10"
+; Information added by Drupal.org packaging script on 2019-03-06
+version = "7.x-3.12"
 core = "7.x"
 project = "ubercart"
-datestamp = "1468644909"
-
+datestamp = "1551862392"

+ 1 - 1
sites/all/modules/contrib/ecommerce/ubercart/payment/uc_credit/tests/test_gateway.module

@@ -52,7 +52,7 @@ function test_gateway_charge($order_id, $amount, $data) {
   // cc_exp_month and cc_exp_year are also validated by
   // _uc_credit_valid_card_expiration() on the checkout form.
   $month = $order->payment_details['cc_exp_month'];
-  $year  = $order->payment_details['cc_exp_year'];
+  $year = $order->payment_details['cc_exp_year'];
   if ($year < 100) {
     $year = $year + 2000;
   }

+ 2 - 2
sites/all/modules/contrib/ecommerce/ubercart/payment/uc_credit/tests/uc_credit.test

@@ -47,7 +47,6 @@ class UbercartCreditCardTestCase extends UbercartTestHelper {
     '4012888818888',
   );
 
-
   /**
    * Describes this test case.
    */
@@ -141,7 +140,7 @@ class UbercartCreditCardTestCase extends UbercartTestHelper {
   /**
    * Implements DrupalWebTestCase::tearDown().
    */
-  public function tearDown() {
+  protected function tearDown() {
     // Cleanup keys directory after test.
     drupal_unlink('sites/default/files/simpletest.keys/' . UC_CREDIT_KEYFILE_NAME);
     drupal_rmdir('sites/default/files/simpletest.keys');
@@ -318,4 +317,5 @@ class UbercartCreditCardTestCase extends UbercartTestHelper {
       }
     }
   }
+
 }

+ 3 - 4
sites/all/modules/contrib/ecommerce/ubercart/payment/uc_credit/uc_credit.info

@@ -8,9 +8,8 @@ core = 7.x
 ; Test cases
 files[] = tests/uc_credit.test
 
-; Information added by Drupal.org packaging script on 2016-07-16
-version = "7.x-3.10"
+; Information added by Drupal.org packaging script on 2019-03-06
+version = "7.x-3.12"
 core = "7.x"
 project = "ubercart"
-datestamp = "1468644909"
-
+datestamp = "1551862392"

+ 0 - 1
sites/all/modules/contrib/ecommerce/ubercart/payment/uc_credit/uc_credit.install

@@ -69,7 +69,6 @@ function uc_credit_update_7000(&$sandbox) {
     $sandbox['message'] = $t('Scrubbed credit card data from order @order_id', array('@order_id' => $order->order_id));
   }
 
-
   if ($sandbox['progress'] < $sandbox['max']) {
     $sandbox['#finished'] = min(0.99, $sandbox['progress'] / $sandbox['max']);
   }

+ 72 - 38
sites/all/modules/contrib/ecommerce/ubercart/payment/uc_credit/uc_credit.module

@@ -5,39 +5,56 @@
  * Defines the credit card payment method and hooks in payment gateways.
  */
 
-
-/** Just authorize an amount on a credit card account. */
+/**
+ * Just authorize an amount on a credit card account.
+ */
 define('UC_CREDIT_AUTH_ONLY', 'authorize');
 
-/** Capture funds from a prior authorization. */
+/**
+ * Capture funds from a prior authorization.
+ */
 define('UC_CREDIT_PRIOR_AUTH_CAPTURE', 'prior_auth_capture');
 
-/** Authorize and capture money all at once. */
+/**
+ * Authorize and capture money all at once.
+ */
 define('UC_CREDIT_AUTH_CAPTURE', 'auth_capture');
 
-/** Set up a credit card reference through the payment gateway. */
+/**
+ * Set up a credit card reference through the payment gateway.
+ */
 define('UC_CREDIT_REFERENCE_SET', 'reference_set');
 
-/** Capture funds using a credit card reference. */
+/**
+ * Capture funds using a credit card reference.
+ */
 define('UC_CREDIT_REFERENCE_TXN', 'reference_txn');
 
-/** Remove a reference from the payment gateway. */
+/**
+ * Remove a reference from the payment gateway.
+ */
 define('UC_CREDIT_REFERENCE_REMOVE', 'reference_remove');
 
-/** Credit funds to a reference at the payment gateway. */
+/**
+ * Credit funds to a reference at the payment gateway.
+ */
 define('UC_CREDIT_REFERENCE_CREDIT', 'reference_credit');
 
-/** Credit funds to a credit card account. */
+/**
+ * Credit funds to a credit card account.
+ */
 define('UC_CREDIT_CREDIT', 'credit');
 
-/** Void a transaction before the transaction clears. */
+/**
+ * Void a transaction before the transaction clears.
+ */
 define('UC_CREDIT_VOID', 'void');
 
-
-/** Name of encryption key file. */
+/**
+ * Name of encryption key file.
+ */
 define('UC_CREDIT_KEYFILE_NAME', 'uc_credit.key');
 
-
 /**
  * Implements hook_help().
  */
@@ -547,7 +564,9 @@ function uc_payment_method_credit_form($form, &$form_state, $order) {
   }
 
   $form['cc_policy'] = array(
-    '#markup' => '<p>' . variable_get('uc_credit_policy', t('Your billing information must match the billing address for the credit card entered below or we will be unable to process your payment.')) . '</p>'
+    '#prefix' => '<p>',
+    '#markup' => variable_get('uc_credit_policy', t('Your billing information must match the billing address for the credit card entered below or we will be unable to process your payment.')),
+    '#suffix' => '</p>',
   );
 
   $types = variable_get('uc_credit_accepted_types', implode("\r\n", array(t('Visa'), t('Mastercard'), t('Discover'), t('American Express'))));
@@ -714,12 +733,12 @@ function uc_credit_display_number($number) {
 /**
  * Caches CC details on a pageload for use in various functions.
  *
- * @param $op
+ * @param string $op
  *   The cache operation to perform; either 'save', 'load', or 'clear'.
- * @param $data
+ * @param string $data
  *   The encrypted, serialized string containing the CC data.
  *
- * @return
+ * @return array
  *   An array of credit card details.
  */
 function uc_credit_cache($op, $data = NULL, $encrypted = TRUE) {
@@ -809,7 +828,13 @@ function _uc_credit_valid_cvv($cvv) {
 /**
  * Validates a credit card number during checkout.
  *
- * Luhn algorithm.  See: http://www.merriampark.com/anatomycc.htm
+ * @param string $number
+ *   Credit card number as a string.
+ *
+ * @return bool
+ *   TRUE if card number is valid according to the Luhn algorithm.
+ *
+ * @see https://en.wikipedia.org/wiki/Luhn_algorithm
  */
 function _uc_credit_valid_card_number($number) {
   $id = substr($number, 0, 1);
@@ -843,12 +868,12 @@ function _uc_credit_valid_card_number($number) {
 /**
  * Validates a start date on a card.
  *
- * @param $month
+ * @param int $month
  *   The 1 or 2-digit numeric representation of the month, i.e. 1, 6, 12.
- * @param $year
+ * @param int $year
  *   The 4-digit numeric representation of the year, i.e. 2008.
  *
- * @return
+ * @return bool
  *   TRUE for cards whose start date is blank (both month and year) or in the
  *   past, FALSE otherwise.
  */
@@ -876,12 +901,12 @@ function _uc_credit_valid_card_start($month, $year) {
 /**
  * Validates an expiration date on a card.
  *
- * @param $month
+ * @param int $month
  *   The 1 or 2-digit numeric representation of the month, i.e. 1, 6, 12.
- * @param $year
+ * @param int $year
  *   The 4-digit numeric representation of the year, i.e. 2008.
  *
- * @return
+ * @return bool
  *   TRUE for non-expired cards, FALSE for expired.
  */
 function _uc_credit_valid_card_expiration($month, $year) {
@@ -899,6 +924,12 @@ function _uc_credit_valid_card_expiration($month, $year) {
 
 /**
  * Validates an issue number on a card; returns TRUE or FALSE.
+ *
+ * @param string $issue
+ *   The issue number.
+ *
+ * @return bool
+ *   TRUE if the issue number if valid, FALSE otherwise.
  */
 function _uc_credit_valid_card_issue($issue) {
   if (empty($issue) || (is_numeric($issue) && $issue > 0)) {
@@ -914,8 +945,8 @@ function _uc_credit_valid_card_issue($issue) {
  * Path to key file is stored in system variable 'uc_credit_encryption_path'.
  * Key file name is stored in constant UC_CREDIT_KEYFILE_NAME.
  *
- * @return
- *   FALSE if no encryption key is found.
+ * @return string|false
+ *   Key, or FALSE if no encryption key is found.
  */
 function uc_credit_encryption_key() {
   static $key = FALSE;
@@ -957,6 +988,9 @@ function _uc_credit_save_cc_data_to_order($cc_data, $order_id) {
 
 /**
  * Returns an array of default credit card transaction types.
+ *
+ * @return array
+ *   Associative array of transaction types, keyed by defined constant value.
  */
 function uc_credit_transaction_types() {
   $types = array(
@@ -972,7 +1006,7 @@ function uc_credit_transaction_types() {
 /**
  * Retrieves the ID of the default credit card gateway.
  *
- * @return
+ * @return string|false
  *   A string containing the ID of the default gateway or FALSE if none exists
  *   or none have valid credit callbacks.
  */
@@ -996,14 +1030,14 @@ function uc_credit_default_gateway() {
 /**
  * Stores a credit card authorization to an order's data array.
  *
- * @param $order_id
+ * @param int $order_id
  *   The order associated with the credit card authorization.
- * @param $auth_id
+ * @param string $auth_id
  *   The payment service's ID for the authorization.
- * @param $amount
+ * @param float $amount
  *   The amount that was authorized on the card.
  *
- * @return
+ * @return array
  *   The entire updated data array for the order.
  */
 function uc_credit_log_authorization($order_id, $auth_id, $amount) {
@@ -1029,12 +1063,12 @@ function uc_credit_log_authorization($order_id, $auth_id, $amount) {
 /**
  * Logs the capture of a prior authorization to an order's data array.
  *
- * @param $order_id
+ * @param int $order_id
  *   The order associated with the credit card capture.
- * @param $auth_id
+ * @param string $auth_id
  *   The payment service's ID for the authorization that was captured.
  *
- * @return
+ * @return array|false
  *   The entire updated data array for the order or FALSE to indicate the
  *   specified authorization was not found.
  */
@@ -1063,16 +1097,16 @@ function uc_credit_log_prior_auth_capture($order_id, $auth_id) {
 /**
  * Logs a credit card reference to an order's data array.
  *
- * @param $order_id
+ * @param int $order_id
  *   The order associated with the credit card details.
- * @param $ref_id
+ * @param string $ref_id
  *   The payment service's ID for the reference that may be used to charge the
  *     same credit card at a later date.
- * @param $cc_number
+ * @param string $cc_number
  *   The credit card number associated with this reference.  Only the last 4
  *     digits will be stored.
  *
- * @return
+ * @return array
  *   The entire updated data array for the order.
  */
 function uc_credit_log_reference($order_id, $ref_id, $cc_number) {

+ 3 - 4
sites/all/modules/contrib/ecommerce/ubercart/payment/uc_cybersource/uc_cybersource.info

@@ -7,9 +7,8 @@ core = 7.x
 ; Class definitions
 files[] = uc_cybersource.soap.inc
 
-; Information added by Drupal.org packaging script on 2016-07-16
-version = "7.x-3.10"
+; Information added by Drupal.org packaging script on 2019-03-06
+version = "7.x-3.12"
 core = "7.x"
 project = "ubercart"
-datestamp = "1468644909"
-
+datestamp = "1551862392"

+ 74 - 6
sites/all/modules/contrib/ecommerce/ubercart/payment/uc_cybersource/uc_cybersource.module

@@ -13,7 +13,6 @@
  * http://growingventuresolutions.com
  */
 
-
 /**
  * Implements hook_menu().
  */
@@ -179,12 +178,15 @@ function uc_cybersource_hop_post() {
       uc_cart_complete_sale($order);
       uc_order_comment_save($order_id, 0, t('Payment of @amount @currency submitted through CyberSource with request ID @rid.', array('@amount' => $payment_amount, '@currency' => $payment_currency, '@rid' => $request_id)), 'order', 'payment_received');
       break;
+
     case 'ERROR':
       uc_order_comment_save($order_id, 0, t("Payment error:@reason with request ID @rid", array('@reason' => $reason, '@rid' => '@request_id')), 'admin');
       break;
+
     case 'REJECT':
       uc_order_comment_save($order_id, 0, t("Payment is rejected:@reason with request ID @rid", array('@reason' => $reason, '@rid' => '@request_id')), 'admin');
       break;
+
     case 'REVIEW':
       uc_order_update_status($order_id, 'review');
       uc_order_comment_save($order_id, 0, t('Payment is in review & not complete: @reason. Request ID @rid', array('@reason' => $reason, '@rid' => '@request_id')), 'admin');
@@ -533,13 +535,16 @@ function uc_cybersource_charge($order_id, $amount, $data) {
       case 'american express':
         $cc_type = '003';
         break;
+
       case 'visa':
         $cc_type = '001';
         break;
+
       case 'mastercard':
       case 'master card':
         $cc_type = '002';
         break;
+
       case 'discover':
         $cc_type = '004';
         break;
@@ -1170,7 +1175,7 @@ function uc_cybersource_uc_calculate_tax($order) {
     if ($reply->reasonCode == '100') {
       // Add a city tax if applicable.
       if (floatval($reply->taxReply->totalCityTaxAmount) > 0) {
-        $result['city'] = (object)array(
+        $result['city'] = (object) array(
           'id' => 'city',
           'name' => t('@city city tax', array('@city' => floatval($reply->taxReply->city))),
           'amount' => floatval($reply->taxReply->totalCityTaxAmount),
@@ -1179,7 +1184,7 @@ function uc_cybersource_uc_calculate_tax($order) {
 
       // Add a county tax if applicable.
       if (floatval($reply->taxReply->totalCountyTaxAmount) > 0) {
-        $result['county'] = (object)array(
+        $result['county'] = (object) array(
           'id' => 'county',
           'name' => t('County tax'),
           'amount' => floatval($reply->taxReply->totalCountryTaxAmount),
@@ -1188,7 +1193,7 @@ function uc_cybersource_uc_calculate_tax($order) {
 
       // Add a district tax if applicable.
       if (floatval($reply->taxReply->totalDistrictTaxAmount) > 0) {
-        $result['district'] = (object)array(
+        $result['district'] = (object) array(
           'id' => 'district',
           'name' => t('District tax'),
           'amount' => floatval($reply->taxReply->totalDistrictTaxAmount),
@@ -1197,7 +1202,7 @@ function uc_cybersource_uc_calculate_tax($order) {
 
       // Add a state tax if applicable.
       if (floatval($reply->taxReply->totalStateTaxAmount) > 0) {
-        $result['state'] = (object)array(
+        $result['state'] = (object) array(
           'id' => 'state',
           'name' => t('@state state tax', array('@state' => $reply->taxReply->state)),
           'amount' => floatval($reply->taxReply->totalStateTaxAmount),
@@ -1215,7 +1220,7 @@ function uc_cybersource_uc_calculate_tax($order) {
         watchdog('uc_cybersource', 'Tax calculation produced uneven results. Expected a total of @total, received the following: @dump', array('@total' => uc_currency_format($reply->taxReply->totalTaxAmount), '@dump' => '<pre>' . print_r($result, TRUE) . '</pre>'), WATCHDOG_ERROR);
 
         $result = array(
-          'total' => (object)array(
+          'total' => (object) array(
             'id' => 'total',
             'name' => t('Tax'),
             'amount' => floatval($reply->taxReply->totalTaxAmount),
@@ -1310,10 +1315,13 @@ function _uc_cybersource_card_type($cc_number) {
       else {
         return '007';  // JCB
       }
+
     case '4':
       return '001';  // Visa
+
     case '5':
       return '002';  // MasterCard
+
     case '6':
       return '004';  // Discover
   }
@@ -1328,58 +1336,85 @@ function _uc_cybersource_parse_reason_code($code) {
   switch ($code) {
     case '100':
       return t('Successful transaction.');
+
     case '102':
       return t('One or more fields in the request are missing or invalid.<br /><b>Possible action:</b> Resend the request with the correct information.');
+
     case '150':
       return t('<b>Error:</b> General system failure.<br /><b>Possible action:</b> Wait a few minutes and resend the request.');
+
     case '151':
       return t('<b>Error:</b> The request was received, but a server time-out occurred. This error does not include time-outs between the client and the server.<br /><b>Possible action:</b> To avoid duplicating the order, do not resend the request until you have reviewed the order status in the Business Center.');
+
     case '152':
       return t('<b>Error:</b> The request was received, but a service did not finish running in time.<br /><b>Possible action:</b> To avoid duplicating the order, do not resend the request until you have reviewed the order status in the Business Center.');
+
     case '200':
       return t('The authorization request was approved by the issuing bank but declined by CyberSource because it did not pass the Address Verification Service (AVS) check.<br /><b>Possible action:</b> You can capture the authorization, but consider reviewing the order for the possibility of fraud.');
+
     case '202':
       return t('Expired card.<br /><b>Possible action:</b> Request a different card or other form of payment.');
+
     case '203':
       return t('General decline of the card. No other information provided by the issuing bank.<br /><b>Possible action:</b> Request a different card or other form of payment.');
+
     case '204':
       return t('Insufficient funds in the account.<br /><b>Possible action:</b> Request a different card or other form of payment.');
+
     case '205':
       return t("Stolen or lost card.<br /><b>Possible action:</b> Review the customer's information and determine if you want to request a different card from the customer.");
+
     case '207':
       return t('Issuing bank unavailable.<br /><b>Possible action:</b> Wait a few minutes and resend the request.');
+
     case '208':
       return t('Inactive card or card not authorized for card-not-present transactions.<br /><b>Possible action:</b> Request a different card or other form of payment.');
+
     case '210':
       return t('The card has reached the credit limit.<br /><b>Possible action:</b> Request a different card or other form of payment.');
+
     case '211':
       return t('The card verification number is invalid.<br /><b>Possible action:</b> Request a different card or other form of payment.');
+
     case '220':
       return t("The processor declined the request based on a general issue with the customer's account.<br /><b>Possible action:</b> Request a different form of payment.");
+
     case '221':
       return t('The customer matched an entry on the processor’s negative file.<br /><b>Possible action:</b> Review the order and contact the payment processor.');
+
     case '222':
       return t("The customer's bank account is frozen.<br /><b>Possible action:</b> Review the order or request a different form of payment.");
+
     case '230':
       return t('The authorization request was approved by the issuing bank but declined by CyberSource because it did not pass the card verification number check.<br /><b>Possible action:</b> You can capture the authorization, but consider reviewing the order for the possibility of fraud.');
+
     case '231':
       return t('Invalid account number.<br /><b>Possible action:</b> Request a different card or other form of payment.');
+
     case '232':
       return t('The card type is not accepted by the payment processor.<br /><b>Possible action:</b> Request a different card or other form of payment. Also, check with CyberSource Customer Support to make sure that your account is configured correctly.');
+
     case '233':
       return t('The processor declined the request based on an issue with the request itself.<br /><b>Possible action:</b> Request a different form of payment.');
+
     case '234':
       return t('There is a problem with your CyberSource merchant configuration.<br /><b>Possible action:</b> Do not resend the request. Contact Customer Support to correct the configuration problem.');
+
     case '236':
       return t('Processor failure.<br /><b>Possible action:</b> Possible action: Wait a few minutes and resend the request.');
+
     case '240':
       return t('The card type sent is invalid or does not correlate with the credit card number.<br /><b>Possible action:</b> Ask your customer to verify that the card is really the type indicated in your Web store, then resend the request.');
+
     case '250':
       return t('<b>Error:</b> The request was received, but a time-out occurred with the payment processor.<br /><b>Possible action:</b> To avoid duplicating the transaction, do not resend the request until you have reviewed the transaction status in the Business Center.');
+
     case '475':
       return t('The customer is enrolled in payer authentication.<br /><b>Possible action:</b> Authenticate the cardholder before continuing with the transaction.');
+
     case '476':
       return t("The customer cannot be authenticated.<br /><b>Possible action:</b> Review the customer's order.");
+
     case '520':
       return t('The authorization request was approved by the issuing bank but declined by CyberSource based on your Smart Authorization settings.<br /><b>Possible action:</b> Do not capture the authorization without further review. Review the avsCode, cvResult, and factorCode fields to determine why CyberSource rejected the request.');
   }
@@ -1392,50 +1427,73 @@ function _uc_cybersource_parse_avs_code($code) {
   switch ($code) {
     case 'A':
       return t('Street address matches, but 5- and 9-digit postal codes do not match.');
+
     case 'B':
       return t('Street address matches, but postal code not verified. Returned only for non U.S.-issued Visa cards.');
+
     case 'C':
       return t('Street address and postal code do not match. Returned only for non U.S.-issued Visa cards.');
+
     case 'D':
       return t('Street address and postal code match. Returned only for non U.S.-issued Visa cards.');
+
     case 'E':
       return t('AVS data is invalid, or AVS is not allowed for this card type.');
+
     case 'F':
       return t("Card member's name does not match, but postal code matches. Returned only for the American Express card type.");
+
     case 'G':
       return t('Non-U.S. issuing bank does not support AVS.');
+
     case 'H':
       return t("Card member's name does not match. Street address and postal code match. Returned only for the American Express card type.");
+
     case 'I':
       return t('Address not verified. Returned only for non U.S.-issued Visa cards.');
+
     case 'K':
       return t("Card member's name matches but billing address and billing postal code do not match. Returned only for the American Express card type.");
+
     case 'L':
       return t("Card member's name and billing postal code match, but billing address does not match. Returned only for the American Express card type");
+
     case 'N':
       return t("Street address and postal code do not match. - or - Card member's name, street address and postal code do not match. Returned only for the American Express card type.");
+
     case 'O':
       return t("Card member's name and billing address match, but billing postal code does not match. Returned only for the American Express card type.");
+
     case 'P':
       return t('Postal code matches, but street address not verified. Returned only for non-U.S.-issued Visa cards.');
+
     case 'R':
       return t('System unavailable.');
+
     case 'S':
       return t('U.S.-issuing bank does not support AVS.');
+
     case 'T':
       return t("Card member's name does not match, but street address matches. Returned only for the American Express card type.");
+
     case 'U':
       return t('Address information unavailable. Returned if non-U.S. AVS is not available or if the AVS in a U.S. bank is not functioning properly.');
+
     case 'W':
       return t('Street address does not match, but 9-digit postal code matches.');
+
     case 'X':
       return t('Exact match. Street address and 9-digit postal code match.');
+
     case 'Y':
       return t('Exact match. Street address and 5-digit postal code match.');
+
     case 'Z':
       return t('Street address does not match, but 5-digit postal code matches.');
+
     case '1':
       return t('AVS is not supported for this processor or card type.');
+
     case '2':
       return t('The processor returned an unrecognized value for the AVS response.');
   }
@@ -1448,24 +1506,34 @@ function _uc_cybersource_parse_cvv_code($code) {
   switch ($code) {
     case 'D':
       return t('Transaction determined suspicious by issuing bank.');
+
     case 'I':
       return t("Card verification number failed processor's data validation check.");
+
     case 'M':
       return t('Card verification number matched.');
+
     case 'N':
       return t('Card verification number not matched.');
+
     case 'P':
       return t('Card verification number not processed by processor for unspecified reason.');
+
     case 'S':
       return t('Card verification number is on the card but was not included in the request.');
+
     case 'U':
       return t('Card verification is not supported by the issuing bank.');
+
     case 'X':
       return t('Card verification is not supported by the card association.');
+
     case '1':
       return t('Card verification is not supported for this processor or card type.');
+
     case '2':
       return t('Unrecognized result code returned by processor for card verification response.');
+
     case '3':
       return t('No result code returned by processor.');
   }

+ 2 - 0
sites/all/modules/contrib/ecommerce/ubercart/payment/uc_cybersource/uc_cybersource.soap.inc

@@ -8,6 +8,7 @@
  */
 
 class CyberSourceSoapClient extends SoapClient {
+
   function __construct($wsdl, $options = NULL) {
     parent::__construct($wsdl, $options);
   }
@@ -36,4 +37,5 @@ class CyberSourceSoapClient extends SoapClient {
 
     return parent::__doRequest($request, $location, $action, $version);
   }
+
 }

+ 3 - 4
sites/all/modules/contrib/ecommerce/ubercart/payment/uc_google_checkout/uc_google_checkout.info

@@ -6,9 +6,8 @@ dependencies[] = uc_quote
 package = Ubercart - payment
 core = 7.x
 
-; Information added by Drupal.org packaging script on 2016-07-16
-version = "7.x-3.10"
+; Information added by Drupal.org packaging script on 2019-03-06
+version = "7.x-3.12"
 core = "7.x"
 project = "ubercart"
-datestamp = "1468644909"
-
+datestamp = "1551862392"

+ 7 - 2
sites/all/modules/contrib/ecommerce/ubercart/payment/uc_payment/tests/uc_payment.test

@@ -2,9 +2,12 @@
 
 /**
  * @file
- * Ubercart payment related tests
+ * Ubercart payment related tests.
  */
 
+/**
+ * Tests the checkout payment pane.
+ */
 class UbercartPaymentPaneTestCase extends UbercartTestHelper {
 
   public static function getInfo() {
@@ -72,7 +75,8 @@ class UbercartPaymentPaneTestCase extends UbercartTestHelper {
     $this->assertNoText('No payment required');
     $this->assertNoText('Subtotal: $0.00');
 
-    // Check that a mixture of free and paid products cannot be purchased for free.
+    // Check that a mixture of free and paid products
+    // cannot be purchased for free.
     $this->drupalPost('node/' . $free_product->nid, array(), t('Add to cart'));
     $this->drupalGet('cart/checkout');
     $this->assertText('Check or money order');
@@ -92,4 +96,5 @@ class UbercartPaymentPaneTestCase extends UbercartTestHelper {
     $this->assertNoText('Select a payment method from the following options.');
     $this->assertFieldByXPath("//input[@name='panes[payment][payment_method]' and @disabled='disabled']");
   }
+
 }

+ 0 - 1
sites/all/modules/contrib/ecommerce/ubercart/payment/uc_payment/uc_payment.admin.inc

@@ -5,7 +5,6 @@
  * Payment administration menu items.
  */
 
-
 /**
  * Displays an overview of the available payment methods.
  *

+ 3 - 4
sites/all/modules/contrib/ecommerce/ubercart/payment/uc_payment/uc_payment.info

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

+ 0 - 1
sites/all/modules/contrib/ecommerce/ubercart/payment/uc_payment/uc_payment.module

@@ -13,7 +13,6 @@
 require_once dirname(__FILE__) . '/uc_payment_checkout_pane.inc';
 require_once dirname(__FILE__) . '/uc_payment_order_pane.inc';
 
-
 /**
  * Implements hook_menu().
  */

+ 3 - 0
sites/all/modules/contrib/ecommerce/ubercart/payment/uc_payment/uc_payment.rules.inc

@@ -75,10 +75,13 @@ function uc_payment_condition_order_balance($order, $balance_comparison, $includ
   switch ($balance_comparison) {
     case 'less':
       return $balance < 0;
+
     case 'less_equal':
       return $balance <= 0.01;
+
     case 'equal':
       return $balance < 0.01 && $balance > -0.01;
+
     case 'greater':
       return $balance >= 0.01;
   }

+ 1 - 0
sites/all/modules/contrib/ecommerce/ubercart/payment/uc_payment/uc_payment_order_pane.inc

@@ -104,6 +104,7 @@ function uc_order_pane_payment($op, $order, &$form = NULL, &$form_state = NULL)
       return drupal_render($form['payment']);
 
     case 'edit-process':
+      $changes = array();
       $changes['payment_method'] = $form_state['values']['payment_method'];
       $changes['payment_details'] = isset($form_state['values']['payment_details']) ? $form_state['values']['payment_details'] : array();
       $func = _uc_payment_method_data($form_state['values']['payment_method'], 'callback');

+ 3 - 4
sites/all/modules/contrib/ecommerce/ubercart/payment/uc_payment_pack/uc_payment_pack.info

@@ -5,9 +5,8 @@ dependencies[] = uc_payment
 package = Ubercart - payment
 core = 7.x
 
-; Information added by Drupal.org packaging script on 2016-07-16
-version = "7.x-3.10"
+; Information added by Drupal.org packaging script on 2019-03-06
+version = "7.x-3.12"
 core = "7.x"
 project = "ubercart"
-datestamp = "1468644909"
-
+datestamp = "1551862392"

+ 0 - 1
sites/all/modules/contrib/ecommerce/ubercart/payment/uc_payment_pack/uc_payment_pack.module

@@ -5,7 +5,6 @@
  * Provides the Check/Money Order, COD, and "Other" payment methods.
  */
 
-
 /**
  * Implements hook_menu().
  */

+ 0 - 1
sites/all/modules/contrib/ecommerce/ubercart/payment/uc_payment_pack/uc_payment_pack.variable.inc

@@ -5,7 +5,6 @@
  * Variable module hook implementations.
  */
 
-
 /**
  * Implements hook_variable_group_info().
  */

+ 3 - 4
sites/all/modules/contrib/ecommerce/ubercart/payment/uc_paypal/uc_paypal.info

@@ -4,9 +4,8 @@ dependencies[] = uc_payment
 package = Ubercart - payment
 core = 7.x
 
-; Information added by Drupal.org packaging script on 2016-07-16
-version = "7.x-3.10"
+; Information added by Drupal.org packaging script on 2019-03-06
+version = "7.x-3.12"
 core = "7.x"
 project = "ubercart"
-datestamp = "1468644909"
-
+datestamp = "1551862392"

+ 49 - 8
sites/all/modules/contrib/ecommerce/ubercart/payment/uc_paypal/uc_paypal.module

@@ -8,14 +8,8 @@
  * You should turn on Instant Payment Notifications in your PayPal profile and
  * set the IPN URL to http://{yoursite.com}/uc_paypal/ipn. See
  * https://drupal.org/node/1311198 for further information.
- *
- * If you have not yet signed up for your PayPal account, please support
- * Ubercart by using the following link.  Thank you!
- *
- * https://www.paypal.com/us/mrb/pal=6NXAPNGSS6DFJ
  */
 
-
 /**
  * Implements hook_menu().
  */
@@ -208,13 +202,16 @@ function uc_paypal_wpp_charge($order_id, $amount, $data) {
         case 'american express':
           $cc_type = 'Amex';
           break;
+
         case 'visa':
           $cc_type = 'Visa';
           break;
+
         case 'mastercard':
         case 'master card':
           $cc_type = 'MasterCard';
           break;
+
         case 'discover':
           $cc_type = 'Discover';
           break;
@@ -247,7 +244,7 @@ function uc_paypal_wpp_charge($order_id, $amount, $data) {
       'IPADDRESS' => $ip_address,
       'AMT' => uc_currency_format($amount, FALSE, FALSE, '.'),
       'CREDITCARDTYPE' => $cc_type,
-      'ACCT' =>  $order->payment_details['cc_number'],
+      'ACCT' => $order->payment_details['cc_number'],
       'EXPDATE' => $expdate,
       'CVV2' => $order->payment_details['cc_cvv'],
       'FIRSTNAME' => substr($order->billing_first_name, 0, 25),
@@ -338,6 +335,7 @@ function uc_paypal_wpp_charge($order_id, $amount, $data) {
         ->execute();
 
       break;
+
     case 'FailureWithWarning':
       // Fall through.
     case 'Failure':
@@ -348,6 +346,7 @@ function uc_paypal_wpp_charge($order_id, $amount, $data) {
         'uid' => $user->uid,
       );
       break;
+
     default:
       $message = t('Unexpected acknowledgement status: @status', array('@status' => $nvp_response['ACK']));
       $result = array(
@@ -921,7 +920,7 @@ function uc_paypal_wps_form($form, &$form_state, $order) {
         $o = 0;
         foreach ($item->data['attributes'] as $name => $setting) {
           $data['on' . $o . '_' . $i] = $name;
-          $data['os' . $o . '_' . $i] = implode(', ', (array)$setting);
+          $data['os' . $o . '_' . $i] = implode(', ', (array) $setting);
           $o++;
         }
       }
@@ -1031,10 +1030,13 @@ function _uc_paypal_card_type($cc_number) {
   switch (substr(strval($cc_number), 0, 1)) {
     case '3':
       return 'Amex';
+
     case '4':
       return 'Visa';
+
     case '5':
       return 'MasterCard';
+
     case '6':
       return 'Discover';
   }
@@ -1062,14 +1064,19 @@ function _uc_paypal_avscode_message($code) {
     switch ($code) {
       case '0':
         return t('All the address information matched.');
+
       case '1':
         return t('None of the address information matched; transaction declined.');
+
       case '2':
         return t('Part of the address information matched.');
+
       case '3':
         return t('The merchant did not provide AVS information. Not processed.');
+
       case '4':
         return t('Address not checked, or acquirer had no response. Service not available.');
+
       default:
         return t('No AVS response was obtained.');
     }
@@ -1079,32 +1086,43 @@ function _uc_paypal_avscode_message($code) {
     case 'A':
     case 'B':
       return t('Address matched; postal code did not');
+
     case 'C':
     case 'N':
       return t('Nothing matched; transaction declined');
+
     case 'D':
     case 'F':
     case 'X':
     case 'Y':
       return t('Address and postal code matched');
+
     case 'E':
       return t('Not allowed for MOTO transactions; transaction declined');
+
     case 'G':
       return t('Global unavailable');
+
     case 'I':
       return t('International unavailable');
+
     case 'P':
     case 'W':
     case 'Z':
       return t('Postal code matched; address did not');
+
     case 'R':
       return t('Retry for validation');
+
     case 'S':
       return t('Service not supported');
+
     case 'U':
       return t('Unavailable');
+
     case 'Null':
       return t('No AVS response was obtained.');
+
     default:
       return t('An unknown error occurred.');
   }
@@ -1118,14 +1136,19 @@ function _uc_paypal_cvvmatch_message($code) {
     switch ($code) {
       case '0':
         return t('Matched');
+
       case '1':
         return t('No match');
+
       case '2':
         return t('The merchant has not implemented CVV2 code handling.');
+
       case '3':
         return t('Merchant has indicated that CVV2 is not present on card.');
+
       case '4':
         return t('Service not available');
+
       default:
         return t('Unkown error');
     }
@@ -1134,16 +1157,22 @@ function _uc_paypal_cvvmatch_message($code) {
   switch ($code) {
     case 'M':
       return t('Match');
+
     case 'N':
       return t('No match');
+
     case 'P':
       return t('Not processed');
+
     case 'S':
       return t('Service not supported');
+
     case 'U':
       return t('Service not available');
+
     case 'X':
       return t('No response');
+
     default:
       return t('Not checked');
   }
@@ -1156,21 +1185,29 @@ function _uc_paypal_pending_message($reason) {
   switch ($reason) {
     case 'address':
       return t('Customer did not include a confirmed shipping address per your address settings.');
+
     case 'authorization':
       return t('Waiting on you to capture the funds per your authorization settings.');
+
     case 'echeck':
       return t('eCheck has not yet cleared.');
+
     case 'intl':
       return t('You must manually accept or deny this international payment from your Account Overview.');
+
     case 'multi-currency':
     case 'multi_currency':
       return t('You must manually accept or deny a payment of this currency from your Account Overview.');
+
     case 'unilateral':
       return t('Your e-mail address is not yet registered or confirmed.');
+
     case 'upgrade':
       return t('You must upgrade your account to Business or Premier status to receive credit card payments.');
+
     case 'verify':
       return t('You must verify your account before you can accept this payment.');
+
     case 'other':
     default:
       return t('Reason "@reason" unknown; contact PayPal Customer Service for more information.', array('@reason' => $reason));
@@ -1184,12 +1221,16 @@ function _uc_paypal_reversal_message($reason) {
   switch ($reason) {
     case 'chargeback':
       return t('The customer has initiated a chargeback.');
+
     case 'guarantee':
       return t('The customer triggered a money-back guarantee.');
+
     case 'buyer-complaint':
       return t('The customer filed a complaint about the transaction.');
+
     case 'refund':
       return t('You gave the customer a refund.');
+
     case 'other':
     default:
       return t('Reason "@reason" unknown; contact PayPal Customer Service for more information.', array('@reason' => $reason));

+ 23 - 17
sites/all/modules/contrib/ecommerce/ubercart/payment/uc_paypal/uc_paypal.pages.inc

@@ -59,34 +59,40 @@ function uc_paypal_ipn() {
     return;
   }
 
-  $req = '';
-
   foreach ($_POST as $key => $value) {
-    $value = urlencode(stripslashes($value));
-    $req .= $key . '=' . $value . '&';
+    $post_fields[] = $key . '=' . urlencode(stripslashes($value));
   }
 
-  $req .= 'cmd=_notify-validate';
+  $post_fields[] = 'cmd=_notify-validate';
 
   if (variable_get('uc_paypal_wpp_server', '') == 'https://api-3t.paypal.com/nvp') {
-    $host = 'https://www.paypal.com/cgi-bin/webscr';
+    $host = 'https://ipnpb.paypal.com/cgi-bin/webscr';
   }
   else {
-    $host = variable_get('uc_paypal_wps_server', 'https://www.sandbox.paypal.com/cgi-bin/webscr');
+    $host = variable_get('uc_paypal_wps_server', 'https://ipnpb.sandbox.paypal.com/cgi-bin/webscr');
   }
 
-  $response = drupal_http_request($host, array(
-    'method' => 'POST',
-    'data' => $req,
-  ));
-
-  // TODO: Change this to property_exists when we have a PHP requirement >= 5.1.
-  if (array_key_exists('error', $response)) {
-    watchdog('uc_paypal', 'IPN failed with HTTP error @error, code @code.', array('@error' => $response->error, '@code' => $response->code), WATCHDOG_ERROR);
+  // Setup the cURL request.
+  $ch = curl_init();
+  curl_setopt($ch, CURLOPT_URL, $host);
+  curl_setopt($ch, CURLOPT_VERBOSE, 0);
+  curl_setopt($ch, CURLOPT_POST, 1);
+  curl_setopt($ch, CURLOPT_POSTFIELDS, implode('&', $post_fields));
+  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
+  curl_setopt($ch, CURLOPT_NOPROGRESS, 1);
+  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
+  $response = curl_exec($ch);
+
+  // Log any errors to the watchdog.
+  if ($error = curl_error($ch)) {
+    watchdog('uc_paypal', 'IPN failed with cURL error: @error', array('@error' => $error), WATCHDOG_ERROR);
     return;
   }
 
-  if (strcmp($response->data, 'VERIFIED') == 0) {
+  curl_close($ch);
+
+  if (strcmp($response, 'VERIFIED') == 0) {
     watchdog('uc_paypal', 'IPN transaction verified.');
 
     $duplicate = (bool) db_query_range('SELECT 1 FROM {uc_payment_paypal_ipn} WHERE txn_id = :id AND status <> :status', 0, 1, array(':id' => $txn_id, ':status' => 'Pending'))->fetchField();
@@ -162,7 +168,7 @@ function uc_paypal_ipn() {
         break;
     }
   }
-  elseif (strcmp($response->data, 'INVALID') == 0) {
+  elseif (strcmp($response, 'INVALID') == 0) {
     watchdog('uc_paypal', 'IPN transaction failed verification.', array(), WATCHDOG_ERROR);
     uc_order_comment_save($order_id, 0, t('An IPN transaction failed verification for this order.'), 'admin');
   }

+ 3 - 4
sites/all/modules/contrib/ecommerce/ubercart/shipping/uc_flatrate/uc_flatrate.info

@@ -6,9 +6,8 @@ core = 7.x
 
 configure = admin/store/settings/quotes/methods
 
-; Information added by Drupal.org packaging script on 2016-07-16
-version = "7.x-3.10"
+; Information added by Drupal.org packaging script on 2019-03-06
+version = "7.x-3.12"
 core = "7.x"
 project = "ubercart"
-datestamp = "1468644909"
-
+datestamp = "1551862392"

+ 0 - 1
sites/all/modules/contrib/ecommerce/ubercart/shipping/uc_flatrate/uc_flatrate.module

@@ -5,7 +5,6 @@
  * Shipping quote module that defines a flat shipping rate for each product.
  */
 
-
 /**
  * Implements hook_menu().
  */

+ 20 - 11
sites/all/modules/contrib/ecommerce/ubercart/shipping/uc_quote/tests/uc_quote.test

@@ -22,7 +22,13 @@ class UbercartQuoteTestCase extends UbercartTestHelper {
    * Overrides DrupalWebTestCase::setUp().
    */
   protected function setUp($modules = array(), $permissions = array()) {
-    $modules = array('rules_admin', 'uc_payment', 'uc_payment_pack', 'uc_quote', 'uc_flatrate');
+    $modules = array(
+      'rules_admin',
+      'uc_payment',
+      'uc_payment_pack',
+      'uc_quote',
+      'uc_flatrate',
+    );
     $permissions = array('administer rules', 'bypass rules access');
     parent::setUp($modules, $permissions);
     module_load_include('inc', 'uc_flatrate', 'uc_flatrate.admin');
@@ -32,14 +38,14 @@ class UbercartQuoteTestCase extends UbercartTestHelper {
   /**
    * Creates a flat rate shipping quote with optional conditions.
    *
-   * @param $edit
+   * @param array $edit
    *   Data to use to create shipping quote, same format as the values
    *   submitted from the add flatrate method form.
-   * @param $condition
+   * @param bool $condition
    *   If specified, a RulesAnd component defining the conditions to apply
    *   for this method.
    */
-  function createQuote($edit = array(), $condition = FALSE) {
+  protected function createQuote(array $edit = array(), $condition = FALSE) {
     $edit += array(
       'title' => $this->randomName(8),
       'label' => $this->randomName(8),
@@ -67,7 +73,7 @@ class UbercartQuoteTestCase extends UbercartTestHelper {
   /**
    * Simulates selection of a delivery country on the checkout page.
    *
-   * @param $country
+   * @param string $country
    *   The text version of the country name to select, e.g. "Canada" or
    *   "United States".
    */
@@ -91,7 +97,7 @@ class UbercartQuoteTestCase extends UbercartTestHelper {
   /**
    * Simulates selection of a quote on the checkout page.
    *
-   * @param $n
+   * @param int $n
    *   The index of the quote to select.
    */
   protected function selectQuote($n) {
@@ -150,10 +156,10 @@ class UbercartQuoteTestCase extends UbercartTestHelper {
       'USES VARIABLES' => array(
         'order' => array(
           'type' => 'uc_order',
-          'label' => 'Order'
+          'label' => 'Order',
         ),
       ),
-      'AND' => array( array(
+      'AND' => array(array(
         'data_is' => array(
           'data' => array('order:delivery-address:country'),
           'value' => '840',
@@ -175,9 +181,11 @@ class UbercartQuoteTestCase extends UbercartTestHelper {
     $this->assertText($quote2->option_text, 'The second quote option is available');
     $this->assertText($quote1->total, 'Order total includes the default quote.');
 
-    // Select a different quote and ensure the total updates correctly.  Currently, we have to do this
-    // by examining the ajax return value directly (rather than the page contents) because drupalPostAjax() can
-    // only handle replacements via the 'wrapper' property, and the ajax callback may use a command with a selector.
+    // Select a different quote and ensure the total updates correctly.
+    // Currently, we have to do this by examining the ajax return value
+    // directly (rather than the page contents) because drupalPostAjax()
+    // can only handle replacements via the 'wrapper' property, and the ajax
+    // callback may use a command with a selector.
     $edit = array('panes[quotes][quotes][quote_option]' => 'flatrate_2---0');
     $result = $this->ucPostAjax(NULL, $edit, $edit);
     $this->assertText($quote2->total, 'The order total includes the selected quote.');
@@ -229,4 +237,5 @@ class UbercartQuoteTestCase extends UbercartTestHelper {
     }
 
   }
+
 }

+ 3 - 4
sites/all/modules/contrib/ecommerce/ubercart/shipping/uc_quote/uc_quote.info

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

+ 1 - 2
sites/all/modules/contrib/ecommerce/ubercart/shipping/uc_quote/uc_quote.module

@@ -9,7 +9,6 @@
  * their specific information so that a shipment may be quoted and requested.
  */
 
-
 /**
  * Implements hook_permission().
  */
@@ -690,7 +689,7 @@ function uc_order_pane_quotes($op, $order, &$form = NULL, &$form_state = NULL) {
         if (isset($form_state['values']['products']) && is_array($form_state['values']['products'])) {
           foreach ($form_state['values']['products'] as $product) {
             $product['data'] = unserialize($product['data']);
-            $product = (object)$product;
+            $product = (object) $product;
             $order->products[] = $product;
           }
         }

+ 0 - 1
sites/all/modules/contrib/ecommerce/ubercart/shipping/uc_quote/uc_quote.variable.inc

@@ -5,7 +5,6 @@
  * Variable module hook implementations.
  */
 
-
 /**
  * Implements hook_variable_group_info().
  */

+ 1 - 1
sites/all/modules/contrib/ecommerce/ubercart/shipping/uc_shipping/uc-packing-slip.tpl.php

@@ -132,7 +132,7 @@
                                 <?php echo t('SKU: ') . $product->model; ?><br />
                                 <?php if (isset($product->data['attributes']) && is_array($product->data['attributes']) && count($product->data['attributes']) > 0) {
                                   foreach ($product->data['attributes'] as $attribute => $option) {
-                                    echo '<li>' . t('@attribute: @options', array('@attribute' => $attribute, '@options' => implode(', ', (array)$option))) . '</li>';
+                                    echo '<li>' . t('@attribute: @options', array('@attribute' => $attribute, '@options' => implode(', ', (array) $option))) . '</li>';
                                   }
                                 } ?>
                               <br />

+ 18 - 10
sites/all/modules/contrib/ecommerce/ubercart/shipping/uc_shipping/uc_shipping.admin.inc

@@ -88,6 +88,7 @@ function uc_shipping_order_packages($order) {
  * @see uc_shipping_new_package_validate()
  * @see uc_shipping_new_package_submit()
  * @see theme_uc_shipping_new_package_fieldset()
+ *
  * @ingroup forms
  */
 function uc_shipping_new_package($form, &$form_state, $order) {
@@ -131,10 +132,10 @@ function uc_shipping_new_package($form, &$form_state, $order) {
           '#default_value' => 0,
         );
         $product_row['model'] = array(
-          '#markup' => check_plain($product->model)
+          '#markup' => check_plain($product->model),
         );
         $product_row['name'] = array(
-          '#markup' => filter_xss_admin($product->title)
+          '#markup' => filter_xss_admin($product->title),
         );
         $product_row['qty'] = array(
           '#type'          => 'select',
@@ -263,14 +264,14 @@ function uc_shipping_new_package_submit($form, &$form_state) {
           }
 
           if ($product['package'] != 0) {
-            $packages[$product['package']]['products'][$id] = (object)$product;
+            $packages[$product['package']]['products'][$id] = (object) $product;
 
             if (!isset($packages[$product['package']]['shipping_type'])) {
               $packages[$product['package']]['shipping_type'] = $shipping_type;
             }
           }
           else {
-            $packages[0][$shipping_type][$id] = (object)$product;
+            $packages[0][$shipping_type][$id] = (object) $product;
           }
         }
       }
@@ -305,6 +306,7 @@ function uc_shipping_new_package_submit($form, &$form_state) {
  *
  * @see uc_shipping_package_edit_submit()
  * @see theme_uc_shipping_edit_package_fieldset()
+ *
  * @ingroup forms
  */
 function uc_shipping_package_edit($form, &$form_state, $order, $package) {
@@ -401,7 +403,7 @@ function uc_shipping_package_edit_submit($form, &$form_state) {
   $package = uc_shipping_package_load($form_state['values']['package_id']);
   foreach ($form_state['values']['products'] as $id => $product) {
     if ($product['checked']) {
-      $package->products[$id] = (object)$product;
+      $package->products[$id] = (object) $product;
     }
     else {
       unset($package->products[$id]);
@@ -417,6 +419,7 @@ function uc_shipping_package_edit_submit($form, &$form_state) {
  * Confirms cancellation of a package's shipment.
  *
  * @see uc_shipping_package_cancel_confirm_submit()
+ *
  * @ingroup forms
  */
 function uc_shipping_package_cancel_confirm($form, &$form_state, $order, $package) {
@@ -468,6 +471,7 @@ function uc_shipping_package_cancel_confirm_submit($form, &$form_state) {
  * Decides to unpackage products.
  *
  * @see uc_shipping_package_delete_confirm_submit()
+ *
  * @ingroup forms
  */
 function uc_shipping_package_delete_confirm($form, &$form_state, $order, $package) {
@@ -541,6 +545,7 @@ function uc_shipping_order_shipments($order) {
  *
  * @see uc_shipping_new_shipment_submit()
  * @see theme_uc_shipping_new_shipment()
+ *
  * @ingroup forms
  */
 function uc_shipping_new_shipment($form, &$form_state, $order) {
@@ -622,6 +627,7 @@ function uc_shipping_new_shipment($form, &$form_state, $order) {
  * Formats and displays the new shipment form.
  *
  * @see uc_shipping_new_shipment()
+ *
  * @ingroup themeable
  */
 function theme_uc_shipping_new_shipment($variables) {
@@ -741,6 +747,7 @@ function uc_shipping_shipment_view($order, $shipment) {
  *
  * @see uc_shipping_shipment_edit_validate()
  * @see uc_shipping_shipment_edit_submit()
+ *
  * @ingroup forms
  */
 function uc_shipping_shipment_edit($form, &$form_state, $order, $shipment) {
@@ -776,7 +783,7 @@ function uc_shipping_shipment_edit($form, &$form_state, $order, $shipment) {
     }
 
     // Create list of products and get a representative product (last one in
-    // the loop) to use for some default values
+    // the loop) to use for some default values.
     $product_list = array();
     $declared_value = 0;
     foreach ($package->products as $product) {
@@ -968,7 +975,7 @@ function uc_shipping_shipment_edit($form, &$form_state, $order, $shipment) {
     '#default_value' => array(
       'year'  => $ship_date['year'],
       'month' => $ship_date['mon'],
-      'day'   => $ship_date['mday']
+      'day'   => $ship_date['mday'],
     ),
   );
   $form['shipment']['expected_delivery'] = array(
@@ -977,7 +984,7 @@ function uc_shipping_shipment_edit($form, &$form_state, $order, $shipment) {
     '#default_value' => array(
       'year'  => $exp_delivery['year'],
       'month' => $exp_delivery['mon'],
-      'day'   => $exp_delivery['mday']
+      'day'   => $exp_delivery['mday'],
     ),
   );
   $form['shipment']['cost'] = array(
@@ -987,12 +994,12 @@ function uc_shipping_shipment_edit($form, &$form_state, $order, $shipment) {
   );
 
   $form['actions'] = array(
-    '#type' => 'actions'
+    '#type' => 'actions',
   );
   $form['actions']['submit'] = array(
     '#type' => 'submit',
     '#value' => t('Save shipment'),
-    '#weight' => 10
+    '#weight' => 10,
   );
 
   return $form;
@@ -1113,6 +1120,7 @@ function theme_uc_shipping_shipment_print($variables) {
  * Decides to release packages to be put on another shipment.
  *
  * @see uc_shipping_shipment_delete_confirm_submit()
+ *
  * @ingroup forms
  */
 function uc_shipping_shipment_delete_confirm($form, &$form_state, $order, $shipment) {

+ 3 - 2
sites/all/modules/contrib/ecommerce/ubercart/shipping/uc_shipping/uc_shipping.api.php

@@ -78,7 +78,8 @@ function hook_uc_shipment($op, $shipment) {
           $response = uc_google_checkout_send_request('request', $request);
         }
       }
-    break;
+      break;
+
     case 'delete':
       $google_order_number = uc_google_checkout_get_google_number($shipment->order_id);
       if ($google_order_number) {
@@ -100,7 +101,7 @@ function hook_uc_shipment($op, $shipment) {
         $request .= '</reset-items-shipping-information>';
       }
       $response = uc_google_checkout_send_request('request', $request);
-    break;
+      break;
   }
 }
 

+ 3 - 4
sites/all/modules/contrib/ecommerce/ubercart/shipping/uc_shipping/uc_shipping.info

@@ -8,9 +8,8 @@ core = 7.x
 files[] = views/uc_shipping_handler_field_shipment_id.inc
 files[] = views/uc_shipping_handler_field_package_weight.inc
 
-; Information added by Drupal.org packaging script on 2016-07-16
-version = "7.x-3.10"
+; Information added by Drupal.org packaging script on 2019-03-06
+version = "7.x-3.12"
 core = "7.x"
 project = "ubercart"
-datestamp = "1468644909"
-
+datestamp = "1551862392"

+ 1 - 5
sites/all/modules/contrib/ecommerce/ubercart/shipping/uc_shipping/uc_shipping.module

@@ -7,7 +7,6 @@
  * and tracking numbers.
  */
 
-
 /**
  * Implements hook_help().
  */
@@ -15,7 +14,6 @@ function uc_shipping_help($path, $arg) {
   switch ($path) {
     case 'admin/store/orders/%/packages/new':
       return '<p>' . t('Organize products into packages. Package numbers in multiple shipping types are of the first shipping type they appear in. All packages are given a unique ID when they are saved. Choose the default package "Sep." to automatically create a package for each of the selected quantity of products in that row.') . '</p>';
-      break;
   }
 }
 
@@ -445,7 +443,7 @@ function uc_shipping_package_load($package_id) {
  * Saves a package.
  */
 function uc_shipping_package_save($package) {
-  $package = (object)$package;
+  $package = (object) $package;
 
   if (!isset($package->package_id)) {
     $package->package_id = db_insert('uc_packages')
@@ -853,9 +851,7 @@ function uc_shipping_uc_order($op, $order, $arg2) {
       if ($package_count > 0) {
         return FALSE;
       }
-
       return TRUE;
-      break;
 
     case 'delete':
       // Find and delete the shipments.

+ 1 - 1
sites/all/modules/contrib/ecommerce/ubercart/shipping/uc_shipping/uc_shipping.rules.inc

@@ -55,7 +55,7 @@ function uc_shipping_rules_data_info() {
       'carrier' => array(
         'type' => 'text',
         'label' => t('Carrier'),
-        'description' > t('The company making the delivery.'),
+        'description' => t('The company making the delivery.'),
       ),
       'transaction_id' => array(
         'type' => 'text',

+ 0 - 1
sites/all/modules/contrib/ecommerce/ubercart/shipping/uc_shipping/uc_shipping.tokens.inc

@@ -5,7 +5,6 @@
  * Token hooks for the uc_shipping module.
  */
 
-
 /**
  * Implements hook_token_info().
  */

+ 2 - 0
sites/all/modules/contrib/ecommerce/ubercart/shipping/uc_shipping/views/uc_shipping_handler_field_package_weight.inc

@@ -12,6 +12,7 @@
  * in packages have the same weight unit.
  */
 class uc_shipping_handler_field_package_weight extends uc_product_handler_field_weight {
+
   /**
    * Overrides views_handler::use_group_by().
    *
@@ -43,4 +44,5 @@ class uc_shipping_handler_field_package_weight extends uc_product_handler_field_
       return uc_weight_format($package->weight, $package->weight_units);
     }
   }
+
 }

+ 10 - 10
sites/all/modules/contrib/ecommerce/ubercart/shipping/uc_ups/uc_ups.admin.inc

@@ -88,7 +88,7 @@ function uc_ups_admin_settings($form, &$form_state) {
     '#description' => t('Select the UPS services that are available to customers.'),
   );
 
-  // Container for quote options
+  // Container for quote options.
   $form['uc_ups_quote_options'] = array(
     '#type'          => 'fieldset',
     '#title'         => t('Quote options'),
@@ -109,7 +109,7 @@ function uc_ups_admin_settings($form, &$form_state) {
     '#description' => t('Indicate whether each product is quoted as shipping separately or all in one package. Orders with one kind of product will still use the package quantity to determine the number of packages needed, however.'),
   );
 
-  // Form to select package types
+  // Form to select package types.
   $form['uc_ups_quote_options']['uc_ups_pkg_type'] = array(
     '#type' => 'select',
     '#title' => t('Default Package Type'),
@@ -137,7 +137,7 @@ function uc_ups_admin_settings($form, &$form_state) {
     '#description' => t('Is your UPS account receiving negotiated rates on shipments?'),
   );
 
-  // Form to select pickup type
+  // Form to select pickup type.
   $form['uc_ups_quote_options']['uc_ups_pickup_type'] = array(
     '#type' => 'select',
     '#title' => t('Pickup type'),
@@ -181,7 +181,7 @@ function uc_ups_admin_settings($form, &$form_state) {
     '#description' => t('When enabled, the quotes presented to the customer will include the cost of insurance for the full sales price of all products in the order.'),
   );
 
-  // Container for markup forms
+  // Container for markup forms.
   $form['uc_ups_markups'] = array(
     '#type'          => 'fieldset',
     '#title'         => t('Markups'),
@@ -191,7 +191,7 @@ function uc_ups_admin_settings($form, &$form_state) {
     '#group'         => 'ups-settings',
   );
 
-  // Form to select type of rate markup
+  // Form to select type of rate markup.
   $form['uc_ups_markups']['uc_ups_rate_markup_type'] = array(
     '#type' => 'select',
     '#title' => t('Rate markup type'),
@@ -203,7 +203,7 @@ function uc_ups_admin_settings($form, &$form_state) {
     ),
   );
 
-  // Form to select rate markup amount
+  // Form to select rate markup amount.
   $form['uc_ups_markups']['uc_ups_rate_markup'] = array(
     '#type' => 'textfield',
     '#title' => t('Shipping rate markup'),
@@ -211,7 +211,7 @@ function uc_ups_admin_settings($form, &$form_state) {
     '#description' => t('Markup shipping rate quote by currency amount, percentage, or multiplier.'),
   );
 
-  // Form to select type of weight markup
+  // Form to select type of weight markup.
   $form['uc_ups_markups']['uc_ups_weight_markup_type'] = array(
     '#type'          => 'select',
     '#title'         => t('Weight markup type'),
@@ -224,7 +224,7 @@ function uc_ups_admin_settings($form, &$form_state) {
     '#disabled' => TRUE,
   );
 
-  // Form to select weight markup amount
+  // Form to select weight markup amount.
   $form['uc_ups_markups']['uc_ups_weight_markup'] = array(
     '#type'          => 'textfield',
     '#title'         => t('Shipping weight markup'),
@@ -233,7 +233,7 @@ function uc_ups_admin_settings($form, &$form_state) {
     '#disabled' => TRUE,
   );
 
-  // Container for label printing
+  // Container for label printing.
   $form['uc_ups_labels'] = array(
     '#type'          => 'fieldset',
     '#title'         => t('Label Printing'),
@@ -246,7 +246,7 @@ function uc_ups_admin_settings($form, &$form_state) {
   $period = drupal_map_assoc(array(86400, 302400, 604800, 1209600, 2419200, 0), 'format_interval');
   $period[0] = t('Forever');
 
-  // Form to select how long labels stay on server
+  // Form to select how long labels stay on server.
   $form['uc_ups_labels']['uc_ups_label_lifetime'] = array(
     '#type'          => 'select',
     '#title'         => t('Label lifetime'),

+ 3 - 4
sites/all/modules/contrib/ecommerce/ubercart/shipping/uc_ups/uc_ups.info

@@ -6,9 +6,8 @@ core = 7.x
 
 configure = admin/store/settings/quotes/settings/ups
 
-; Information added by Drupal.org packaging script on 2016-07-16
-version = "7.x-3.10"
+; Information added by Drupal.org packaging script on 2019-03-06
+version = "7.x-3.12"
 core = "7.x"
 project = "ubercart"
-datestamp = "1468644909"
-
+datestamp = "1551862392"

+ 14 - 10
sites/all/modules/contrib/ecommerce/ubercart/shipping/uc_ups/uc_ups.module

@@ -387,6 +387,7 @@ function uc_ups_shipping_quote($packages, $origin, $destination, $ups_service) {
       $units = 'LBS';
       $unit_name = 'Pounds';
       break;
+
     case 'cm':
       $units = 'KGS';
       $unit_name = 'Kilograms';
@@ -404,6 +405,7 @@ function uc_ups_shipping_quote($packages, $origin, $destination, $ups_service) {
       case 'in':
         $weight_factor = uc_weight_conversion($package->weight_units, 'lb');
         break;
+
       case 'cm':
         $weight_factor = uc_weight_conversion($package->weight_units, 'kg');
         break;
@@ -663,7 +665,7 @@ function uc_ups_quote($products, $details, $method) {
       if (!isset($product->pkg_qty) || !$product->pkg_qty) {
         $product->pkg_qty = 1;
       }
-      $num_of_pkgs = (int)($product->qty / $product->pkg_qty);
+      $num_of_pkgs = (int) ($product->qty / $product->pkg_qty);
 
       // Grab some product properties directly from the (cached) product
       // data.  They are not normally available here because the $product
@@ -706,7 +708,7 @@ function uc_ups_quote($products, $details, $method) {
     return array();
   }
 
-  $dest = (object)$details;
+  $dest = (object) $details;
 
   foreach ($packages as $key => $ship_packages) {
     $orig = $addresses[$key];
@@ -727,9 +729,9 @@ function uc_ups_quote($products, $details, $method) {
       if (isset($response->Response->Error)) {
         foreach ($response->Response->Error as $error) {
           if (user_access('configure quotes') && variable_get('uc_quote_display_debug', FALSE)) {
-            $debug_data[$ups_service]['error'][] = (string)$error->ErrorSeverity . ' ' . (string)$error->ErrorCode . ': ' . (string)$error->ErrorDescription;
+            $debug_data[$ups_service]['error'][] = (string) $error->ErrorSeverity . ' ' . (string) $error->ErrorCode . ': ' . (string) $error->ErrorDescription;
           }
-          if (strpos((string)$error->ErrorSeverity, 'Hard') !== FALSE) {
+          if (strpos((string) $error->ErrorSeverity, 'Hard') !== FALSE) {
             // All or nothing quote. If some products can't be shipped by
             // a certain service, no quote is given for that service. If
             // that means no quotes are given at all, they'd better call in.
@@ -744,12 +746,12 @@ function uc_ups_quote($products, $details, $method) {
         if (isset($response->RatedShipment->NegotiatedRates)) {
           $charge = $response->RatedShipment->NegotiatedRates->NetSummaryCharges->GrandTotal;
         }
-        if (!isset($charge->CurrencyCode) || (string)$charge->CurrencyCode == variable_get('uc_currency_code', "USD")) {
+        if (!isset($charge->CurrencyCode) || (string) $charge->CurrencyCode == variable_get('uc_currency_code', "USD")) {
           // Markup rate before customer sees it.
           if (!isset($quotes[$ups_service]['rate'])) {
             $quotes[$ups_service]['rate'] = 0;
           }
-          $rate = uc_ups_rate_markup((string)$charge->MonetaryValue);
+          $rate = uc_ups_rate_markup((string) $charge->MonetaryValue);
           $quotes[$ups_service]['rate'] += $rate;
         }
       }
@@ -847,20 +849,20 @@ function uc_ups_void_shipment($shipment_number, $tracking_numbers = array()) {
   $response = new SimpleXMLElement($resp->data);
   if (isset($response->Response)) {
     if (isset($response->Response->ResponseStatusCode)) {
-      $success = (string)$response->Response->ResponseStatusCode;
+      $success = (string) $response->Response->ResponseStatusCode;
     }
     if (isset($response->Response->Error)) {
       foreach ($response->Response->Error as $error) {
-        drupal_set_message((string)$error->ErrorSeverity . ' ' . (string)$error->ErrorCode . ': ' . (string)$error->ErrorDescription, 'error');
+        drupal_set_message((string) $error->ErrorSeverity . ' ' . (string) $error->ErrorCode . ': ' . (string) $error->ErrorDescription, 'error');
       }
     }
   }
   if (isset($response->Status)) {
     if (isset($response->Status->StatusType)) {
-      $success = (string)$response->Status->StatusType->Code;
+      $success = (string) $response->Status->StatusType->Code;
     }
   }
-  return (bool)$success;
+  return (bool) $success;
 }
 
 /**
@@ -880,8 +882,10 @@ function uc_ups_rate_markup($rate) {
     switch ($type) {
       case 'percentage':
         return $rate + $rate * floatval($markup) / 100;
+
       case 'multiplier':
         return $rate * floatval($markup);
+
       case 'currency':
         return $rate + floatval($markup);
     }

+ 13 - 13
sites/all/modules/contrib/ecommerce/ubercart/shipping/uc_ups/uc_ups.ship.inc

@@ -5,7 +5,6 @@
  * UPS functions for label generation.
  */
 
-
 /**
  * Shipment creation callback.
  *
@@ -31,7 +30,7 @@ function uc_ups_fulfill_order($form, &$form_state, $order, $package_ids) {
     '#type'        => 'fieldset',
     '#title'       => t('Packages'),
     '#collapsible' => TRUE,
-    '#tree'        => TRUE
+    '#tree'        => TRUE,
   );
   foreach ($package_ids as $id) {
     $package = uc_shipping_package_load($id);
@@ -42,14 +41,14 @@ function uc_ups_fulfill_order($form, &$form_state, $order, $package_ids) {
         }
       }
       // Create list of products and get a representative product (last one in
-      // the loop) to use for some default values
+      // the loop) to use for some default values.
       $product_list = array();
       $declared_value = 0;
       foreach ($package->products as $product) {
         $product_list[] = $product->qty . ' x ' . $product->model;
         $declared_value += $product->qty * $product->price;
       }
-      // Use last product in package to determine package type
+      // Use last product in package to determine package type.
       $ups_data = db_query("SELECT pkg_type FROM {uc_ups_products} WHERE nid = :nid", array(':nid' => $product->nid))->fetchAssoc();
       $product->ups = $ups_data;
       $pkg_form = array(
@@ -151,7 +150,7 @@ function uc_ups_fulfill_order($form, &$form_state, $order, $package_ids) {
     $form['destination'][$field]['#required'] = TRUE;
   }
 
-  // Determine shipping option chosen by the customer
+  // Determine shipping option chosen by the customer.
   $method  = $order->quote['method'];
   $methods = module_invoke_all('uc_shipping_method');
   if (isset($methods[$method])) {
@@ -159,14 +158,14 @@ function uc_ups_fulfill_order($form, &$form_state, $order, $package_ids) {
     $method   = $services[$order->quote['accessorials']];
   }
 
-  // Container for shipment data
+  // Container for shipment data.
   $form['shipment'] = array(
     '#type'        => 'fieldset',
     '#title'       => t('Shipment data'),
     '#collapsible' => TRUE,
   );
 
-  // Inform user of customer's shipping choice
+  // Inform user of customer's shipping choice.
   $form['shipment']['shipping_choice'] = array(
     '#type'   => 'markup',
     '#prefix' => '<div>',
@@ -175,7 +174,7 @@ function uc_ups_fulfill_order($form, &$form_state, $order, $package_ids) {
   );
 
   // Pass shipping charge paid information on to validation function so it
-  // can be displayed alongside actual costs
+  // can be displayed alongside actual costs.
   $form['shipment']['paid'] = array(
     '#type'  => 'value',
     '#value' => uc_currency_format($order->quote['rate']),
@@ -402,6 +401,7 @@ function uc_ups_shipment_request($packages, $origin, $destination, $ups_service)
         $units = 'LBS';
         $unit_name = 'Pounds';
         break;
+
       case 'cm':
         $weight_factor = uc_weight_conversion($package->weight_units, 'kg');
         $units = 'KGS';
@@ -709,18 +709,18 @@ function uc_ups_confirm_shipment_submit($form, &$form_state) {
 /**
  * Constructs an XML label and pickup request.
  *
- * @param $digest
+ * @param string $digest
  *   Base-64 encoded shipment request.
- * @param $order_id
+ * @param int $order_id
  *   The order id of the shipment.
- * @param $packages
+ * @param array $packages
  *   An array of package ids to be shipped.
  *
- * @return
+ * @return string
  *   ShipmentAcceptRequest XML document to send to UPS.
  */
 function uc_ups_request_pickup($digest, $order_id = 0, $packages = array()) {
-  $packages = (array)$packages;
+  $packages = (array) $packages;
 
   $schema = uc_ups_access_request();
   $schema .= "<?xml version=\"1.0\" encoding=\"UTF-8\"?>

+ 9 - 9
sites/all/modules/contrib/ecommerce/ubercart/shipping/uc_usps/uc_usps.admin.inc

@@ -14,7 +14,7 @@
  */
 function uc_usps_admin_settings($form, &$form_state) {
 
-  // Put fieldsets into vertical tabs
+  // Put fieldsets into vertical tabs.
   $form['usps-settings'] = array(
     '#type' => 'vertical_tabs',
     '#attached' => array(
@@ -24,7 +24,7 @@ function uc_usps_admin_settings($form, &$form_state) {
     ),
   );
 
-  // Container for credential forms
+  // Container for credential forms.
   $form['uc_usps_credentials'] = array(
     '#type'          => 'fieldset',
     '#title'         => t('Credentials'),
@@ -98,7 +98,7 @@ function uc_usps_admin_settings($form, &$form_state) {
     '#description' => t('Select the USPS services that are available to customers. Be sure to include the services that the Postal Service agrees are available to you.'),
   );
 
-  // Container for quote options
+  // Container for quote options.
   $form['uc_usps_quote_options'] = array(
     '#type'          => 'fieldset',
     '#title'         => t('Quote options'),
@@ -119,7 +119,7 @@ function uc_usps_admin_settings($form, &$form_state) {
     '#description' => t('Indicate whether each product is quoted as shipping separately or all in one package. Orders with one kind of product will still use the package quantity to determine the number of packages needed, however.'),
   );
 
-  // Insurance
+  // Insurance.
   $form['uc_usps_quote_options']['uc_usps_insurance'] = array(
     '#type' => 'checkbox',
     '#title' => t('Package insurance'),
@@ -128,7 +128,7 @@ function uc_usps_admin_settings($form, &$form_state) {
     '#disabled' => TRUE,
   );
 
-  // Delivery Confirmation
+  // Delivery Confirmation.
   $form['uc_usps_quote_options']['uc_usps_delivery_confirmation'] = array(
     '#type' => 'checkbox',
     '#title' => t('Delivery confirmation'),
@@ -137,7 +137,7 @@ function uc_usps_admin_settings($form, &$form_state) {
     '#disabled' => TRUE,
   );
 
-  // Signature Confirmation
+  // Signature Confirmation.
   $form['uc_usps_quote_options']['uc_usps_signature_confirmation'] = array(
     '#type' => 'checkbox',
     '#title' => t('Signature confirmation'),
@@ -146,7 +146,7 @@ function uc_usps_admin_settings($form, &$form_state) {
     '#disabled' => TRUE,
   );
 
-  // Container for markup forms
+  // Container for markup forms.
   $form['uc_usps_markups'] = array(
     '#type'          => 'fieldset',
     '#title'         => t('Markups'),
@@ -173,7 +173,7 @@ function uc_usps_admin_settings($form, &$form_state) {
     '#description' => t('Markup shipping rate quote by dollar amount, percentage, or multiplier.'),
   );
 
-  // Form to select type of weight markup
+  // Form to select type of weight markup.
   $form['uc_usps_markups']['uc_usps_weight_markup_type'] = array(
     '#type'          => 'select',
     '#title'         => t('Weight markup type'),
@@ -186,7 +186,7 @@ function uc_usps_admin_settings($form, &$form_state) {
     '#disabled' => TRUE,
   );
 
-  // Form to select weight markup amount
+  // Form to select weight markup amount.
   $form['uc_usps_markups']['uc_usps_weight_markup'] = array(
     '#type'          => 'textfield',
     '#title'         => t('Shipping weight markup'),

+ 3 - 4
sites/all/modules/contrib/ecommerce/ubercart/shipping/uc_usps/uc_usps.info

@@ -6,9 +6,8 @@ core = 7.x
 
 configure = admin/store/settings/quotes/settings/usps
 
-; Information added by Drupal.org packaging script on 2016-07-16
-version = "7.x-3.10"
+; Information added by Drupal.org packaging script on 2019-03-06
+version = "7.x-3.12"
 core = "7.x"
 project = "ubercart"
-datestamp = "1468644909"
-
+datestamp = "1551862392"

+ 15 - 12
sites/all/modules/contrib/ecommerce/ubercart/shipping/uc_usps/uc_usps.module

@@ -348,32 +348,31 @@ function uc_usps_quote($products, $details, $method) {
       }
     }
 
-
     if (isset($response->Package)) {
       foreach ($response->Package as $package) {
         if (isset($package->Error)) {
-          $debug_data['error'][] = (string)$package->Error[0]->Description . '<br />';
+          $debug_data['error'][] = (string) $package->Error[0]->Description . '<br />';
         }
         else {
           if (strpos($method['id'], 'intl')) {
             foreach ($package->Service as $service) {
-              $id = (string)$service['ID'];
-              $services[$id]['label'] = t('U.S.P.S. @service', array('@service' => (string)$service->SvcDescription));
+              $id = (string) $service['ID'];
+              $services[$id]['label'] = t('U.S.P.S. @service', array('@service' => (string) $service->SvcDescription));
               // Markup rate before customer sees it.
               if (!isset($services[$id]['rate'])) {
                 $services[$id]['rate'] = 0;
               }
-              $services[$id]['rate'] += uc_usps_rate_markup((string)$service->Postage);
+              $services[$id]['rate'] += uc_usps_rate_markup((string) $service->Postage);
             }
           }
           else {
             foreach ($package->Postage as $postage) {
-              $classid = (string)$postage['CLASSID'];
+              $classid = (string) $postage['CLASSID'];
               if ($classid === '0') {
-                if ((string)$postage->MailService == "First-Class Mail® Parcel") {
+                if ((string) $postage->MailService == "First-Class Mail® Parcel") {
                   $classid = 'zeroParcel';
                 }
-                elseif ((string)$postage->MailService == "First-Class Mail® Letter") {
+                elseif ((string) $postage->MailService == "First-Class Mail® Letter") {
                   $classid = 'zeroFlat';
                 }
                 else {
@@ -383,16 +382,16 @@ function uc_usps_quote($products, $details, $method) {
               if (!isset($services[$classid]['rate'])) {
                 $services[$classid]['rate'] = 0;
               }
-              $services[$classid]['label'] = t('U.S.P.S. @service', array('@service' => (string)$postage->MailService));
+              $services[$classid]['label'] = t('U.S.P.S. @service', array('@service' => (string) $postage->MailService));
               // Markup rate before customer sees it.
               // Rates are stored differently if ONLINE $rate_type is requested.
               // First Class doesn't have online rates, so if CommercialRate
               // is missing use Rate instead.
               if ($rate_type && !empty($postage->CommercialRate)) {
-                $services[$classid]['rate'] += uc_usps_rate_markup((string)$postage->CommercialRate);
+                $services[$classid]['rate'] += uc_usps_rate_markup((string) $postage->CommercialRate);
               }
               else {
-                $services[$classid]['rate'] += uc_usps_rate_markup((string)$postage->Rate);
+                $services[$classid]['rate'] += uc_usps_rate_markup((string) $postage->Rate);
               }
             }
           }
@@ -573,8 +572,10 @@ function uc_usps_rate_markup($rate) {
     switch ($type) {
       case 'percentage':
         return $rate + $rate * floatval($markup) / 100;
+
       case 'multiplier':
         return $rate * floatval($markup);
+
       case 'currency':
         return $rate + floatval($markup);
     }
@@ -714,7 +715,7 @@ function _uc_usps_package_products($products, &$addresses) {
       if (!isset($product->pkg_qty) || !$product->pkg_qty) {
         $product->pkg_qty = 1;
       }
-      $num_of_pkgs = (int)($product->qty / $product->pkg_qty);
+      $num_of_pkgs = (int) ($product->qty / $product->pkg_qty);
       if ($num_of_pkgs) {
         $package = clone $product;
         $package->description = $product->model;
@@ -730,6 +731,7 @@ function _uc_usps_package_products($products, &$addresses) {
             $package->pounds = floor($weight);
             $package->ounces = LB_TO_OZ * ($weight - $package->pounds);
             break;
+
           case 'oz':
             $package->pounds = floor($weight * OZ_TO_LB);
             $package->ounces = $weight - $package->pounds * LB_TO_OZ;
@@ -786,6 +788,7 @@ function _uc_usps_package_products($products, &$addresses) {
             $package->pounds = floor($weight);
             $package->ounces = LB_TO_OZ * ($weight - $package->pounds);
             break;
+
           case 'oz':
             $package->pounds = floor($weight * OZ_TO_LB);
             $package->ounces = $weight - $package->pounds * LB_TO_OZ;

+ 2 - 2
sites/all/modules/contrib/ecommerce/ubercart/shipping/uc_usps/uc_usps.rules_defaults.inc

@@ -13,7 +13,8 @@ function uc_usps_default_rules_configuration_alter(&$configs) {
     return;
   }
 
-  // Domestic areas include U.S., American Samoa, Guam, Puerto Rico, and the Virgin Islands
+  // Domestic areas include U.S., American Samoa, Guam, Puerto Rico,
+  // and the US Virgin Islands.
   $countries = array(
     16 => t('American Samoa'),
     316 => t('Guam'),
@@ -41,7 +42,6 @@ function uc_usps_default_rules_configuration_alter(&$configs) {
     $foreign_env->condition($condition);
   }
 
-
   $configs['get_quote_from_usps']->condition($domestic);
   $configs['get_quote_from_usps_env']->condition($domestic_env);
   $configs['get_quote_from_usps_intl']->condition($foreign);

+ 3 - 4
sites/all/modules/contrib/ecommerce/ubercart/shipping/uc_weightquote/uc_weightquote.info

@@ -6,9 +6,8 @@ core = 7.x
 
 configure = admin/store/settings/quotes/methods
 
-; Information added by Drupal.org packaging script on 2016-07-16
-version = "7.x-3.10"
+; Information added by Drupal.org packaging script on 2019-03-06
+version = "7.x-3.12"
 core = "7.x"
 project = "ubercart"
-datestamp = "1468644909"
-
+datestamp = "1551862392"

+ 0 - 1
sites/all/modules/contrib/ecommerce/ubercart/shipping/uc_weightquote/uc_weightquote.module

@@ -6,7 +6,6 @@
  * product.
  */
 
-
 /**
  * Implements hook_menu().
  */

+ 3 - 4
sites/all/modules/contrib/ecommerce/ubercart/uc_ajax_admin/uc_ajax_admin.info

@@ -4,9 +4,8 @@ dependencies[] = uc_cart
 package = Ubercart - extra
 core = 7.x
 
-; Information added by Drupal.org packaging script on 2016-07-16
-version = "7.x-3.10"
+; Information added by Drupal.org packaging script on 2019-03-06
+version = "7.x-3.12"
 core = "7.x"
 project = "ubercart"
-datestamp = "1468644909"
-
+datestamp = "1551862392"

+ 2 - 1
sites/all/modules/contrib/ecommerce/ubercart/uc_ajax_admin/uc_ajax_admin.module

@@ -182,6 +182,7 @@ function _uc_ajax_admin_list_triggers($element, &$list) {
       case 'button': case 'submit':
         $title = empty($element['#value']) ? $key : $element['#value'];
         break;
+
       default:
         $title = empty($element['#title']) ? $key : $element['#title'];
     }
@@ -233,7 +234,7 @@ function _uc_ajax_admin_build_checkout_form() {
       'price' => 1,
       'data' => array('shippable' => TRUE),
       'model' => 0,
-      'weight' => 0
+      'weight' => 0,
     ));
   }
   return drupal_get_form('uc_cart_checkout_form', $order);

+ 2 - 1
sites/all/modules/contrib/ecommerce/ubercart/uc_attribute/tests/uc_attribute.test

@@ -879,7 +879,8 @@ class UbercartAttributeTestCase extends UbercartTestHelper {
    *
    * @param $var
    */
-  function showVar($var) {
+  protected function showVar($var) {
     $this->pass('<pre>' . print_r($var, TRUE) . '</pre>');
   }
+
 }

+ 4 - 1
sites/all/modules/contrib/ecommerce/ubercart/uc_attribute/tests/uc_attribute_checkout.test

@@ -5,6 +5,9 @@
  * Ubercart attribute checkout tests.
  */
 
+/**
+ * Tests the product attribute API.
+ */
 class UbercartAttributeCheckoutTestCase extends UbercartTestHelper {
 
   public static function getInfo() {
@@ -26,7 +29,7 @@ class UbercartAttributeCheckoutTestCase extends UbercartTestHelper {
   /**
    * Tests that product in cart has the selected attribute option.
    */
-  function testAttributeAddToCart() {
+  public function testAttributeAddToCart() {
     for ($display = 0; $display <= 3; ++$display) {
       // Set up an attribute.
       $data = array(

+ 14 - 5
sites/all/modules/contrib/ecommerce/ubercart/uc_attribute/uc_attribute.admin.inc

@@ -64,6 +64,7 @@ function uc_attribute_admin() {
  * Form builder for product attributes.
  *
  * @see uc_attribute_form_submit()
+ *
  * @ingroup forms
  */
 function uc_attribute_form($form, &$form_state, $attribute = NULL) {
@@ -234,6 +235,7 @@ function uc_attribute_delete_confirm_submit($form, &$form_state) {
  *
  * @see uc_attribute_options_form_validate()
  * @see uc_attribute_options_form_submit()
+ *
  * @ingroup forms
  */
 function uc_attribute_options_form($form, &$form_state, $attribute) {
@@ -263,7 +265,7 @@ function uc_attribute_options_form($form, &$form_state, $attribute) {
         '#price' => $data->price,
       ),
       'weight' => array(
-        '#markup' => (string)$data->weight,
+        '#markup' => (string) $data->weight,
       ),
       'ordering' => array(
         '#type' => 'weight',
@@ -358,6 +360,7 @@ function theme_uc_attribute_options_form($variables) {
  *
  * @see uc_attribute_option_form_validate()
  * @see uc_attribute_option_form_submit()
+ *
  * @ingroup forms
  */
 function uc_attribute_option_form($form, &$form_state, $attribute, $option = NULL) {
@@ -538,6 +541,7 @@ function uc_attribute_option_delete_confirm_submit($form, &$form_state) {
  *
  * @see uc_object_attributes_form_submit()
  * @see theme_uc_object_attributes_form()
+ *
  * @ingroup forms
  */
 function uc_object_attributes_form($form, &$form_state, $object, $type, $view = 'overview') {
@@ -551,6 +555,7 @@ function uc_object_attributes_form($form, &$form_state, $object, $type, $view =
       drupal_set_title($class->name);
       $attributes = uc_class_get_attributes($id);
       break;
+
     case 'product':
     default:
       $product = $object;
@@ -595,7 +600,7 @@ function uc_object_attributes_form($form, &$form_state, $object, $type, $view =
             '#maxlength' => 255,
           ),
           'option' => array(
-            '#markup' => $option ? (check_plain($option->name) . ' (' . theme('uc_price', array('price' => $option->price)) . ')' ) : t('n/a'),
+            '#markup' => $option ? (check_plain($option->name) . ' (' . theme('uc_price', array('price' => $option->price)) . ')') : t('n/a'),
           ),
           'required' => array(
             '#type' => 'checkbox',
@@ -644,7 +649,7 @@ function uc_object_attributes_form($form, &$form_state, $object, $type, $view =
       '#title' => t('Attributes'),
       '#options' => count($unused_attributes) > 0 ? $unused_attributes : array(t('No attributes left to add.')),
       '#disabled' => count($unused_attributes) == 0 ? TRUE : FALSE,
-      '#weight' => -1
+      '#weight' => -1,
     );
     $form['actions'] = array('#type' => 'actions');
     $form['actions']['add'] = array(
@@ -679,6 +684,7 @@ function uc_object_attributes_form($form, &$form_state, $object, $type, $view =
  *   - form: A render element representing the form.
  *
  * @see uc_object_attributes_form()
+ *
  * @ingroup themeable
  */
 function theme_uc_object_attributes_form($variables) {
@@ -852,6 +858,7 @@ function uc_object_attributes_form_submit($form, &$form_state) {
  * @see uc_object_options_form_validate()
  * @see uc_object_options_form_submit()
  * @see theme_uc_object_options_form()
+ *
  * @ingroup forms
  */
 function uc_object_options_form($form, &$form_state, $object, $type) {
@@ -1003,6 +1010,7 @@ function uc_object_options_form($form, &$form_state, $object, $type) {
  *   - form: A render element representing the form.
  *
  * @see uc_object_options_form()
+ *
  * @ingroup themeable
  */
 function theme_uc_object_options_form($variables) {
@@ -1084,7 +1092,7 @@ function theme_uc_product_attributes($variables) {
   foreach (element_children($attributes) as $key) {
     $optionstr = '';
 
-    foreach ((array)$attributes[$key]['#options'] as $option) {
+    foreach ((array) $attributes[$key]['#options'] as $option) {
       // We only need to allow translation from the second option onward
       if (empty($optionstr)) {
         $optionstr .= $option;
@@ -1203,6 +1211,7 @@ function uc_object_options_form_submit($form, &$form_state) {
  * Form builder: associate option combinations with a product variant's SKU.
  *
  * @see uc_product_adjustments_form_submit()
+ *
  * @ingroup forms
  */
 function uc_product_adjustments_form($form, &$form_state, $node) {
@@ -1260,7 +1269,7 @@ function uc_product_adjustments_form($form, &$form_state, $node) {
   $num_prod_attr = count($attribute_ids);
 
   if ($num_prod_attr) {
-    // Get previous values
+    // Get previous values.
     $old_vals = db_query("SELECT * FROM {uc_product_adjustments} WHERE nid = :nid", array(':nid' => $nid))->fetchAll();
 
     $result = $query->execute();

+ 3 - 4
sites/all/modules/contrib/ecommerce/ubercart/uc_attribute/uc_attribute.info

@@ -8,9 +8,8 @@ core = 7.x
 files[] = tests/uc_attribute.test
 files[] = tests/uc_attribute_checkout.test
 
-; Information added by Drupal.org packaging script on 2016-07-16
-version = "7.x-3.10"
+; Information added by Drupal.org packaging script on 2019-03-06
+version = "7.x-3.12"
 core = "7.x"
 project = "ubercart"
-datestamp = "1468644909"
-
+datestamp = "1551862392"

+ 103 - 78
sites/all/modules/contrib/ecommerce/ubercart/uc_attribute/uc_attribute.module

@@ -11,7 +11,6 @@
  * instead of listing each combination separately.
  */
 
-
 /**
  * Implements hook_help().
  */
@@ -20,6 +19,7 @@ function uc_attribute_help($path, $arg) {
     // Help messages for the attributes overview on products and classes.
     case 'node/%/edit/attributes':
       return '<p>' . t('Add attributes to this product using the <a href="!url">add attributes form</a>. You may then adjust the settings for these attributes on this page and go on to configure their options in the <em>Options</em> tab.', array('!url' => url('node/' . $arg[1] . '/edit/attributes/add'))) . '</p>';
+
     case 'admin/store/products/classes/%/attributes':
       return '<p>' . t('Add attributes to the product class using the <a href="!url">add attributes form</a>. You may then adjust the settings for these attributes on this page and go on to configure their options in the <em>Options</em> tab.', array('!url' => url('admin/store/products/classes/' . $arg[4] . '/attributes/add'))) . '</p>';
 
@@ -287,7 +287,8 @@ function uc_attribute_form_uc_product_settings_form_alter(&$form, &$form_state)
     '#type' => 'radios',
     '#title' => t('Option price format'),
     '#default_value' => variable_get('uc_attribute_option_price_format', 'adjustment'),
-    '#options' => array('none' => t('Do not display'),
+    '#options' => array(
+      'none' => t('Do not display'),
       'adjustment' => t('Display price adjustment'),
       'total' => t('Display total price'),
     ),
@@ -385,7 +386,7 @@ function uc_attribute_node_insert($node) {
       'default_option',
     ))
     ->condition('pcid', $node->type);
-  // SELECT $node->nid AS nid
+  // SELECT $node->nid AS nid.
   $select->addExpression(':nid', 'nid', array(':nid' => $node->nid));
 
   db_insert('uc_product_attributes')
@@ -453,6 +454,12 @@ function uc_attribute_node_update_index($node) {
 
 /**
  * Implements hook_uc_product_models().
+ *
+ * @param int $nid
+ *   Node number for product type node.
+ *
+ * @return array
+ *   Array of SKUs (model numbers) for this $nid.
  */
 function uc_attribute_uc_product_models($nid) {
   // Get all the SKUs for all the attributes on this node.
@@ -594,18 +601,18 @@ function uc_attribute_uc_product_description($product) {
  * logic; that is, we could make uc_attribute load call this function and allow
  * this function to minimize the number of queries necessary. -cha0s
  *
- * @param $aids
+ * @param array $aids
  *   Attribute IDs to load.
- * @param $type
+ * @param string $type
  *   The type of attribute. 'product', or 'class'. Any other type will fetch
  *   a base attribute.
- * @param $id
+ * @param int $id
  *   The ID of the product/class this attribute belongs to.
  *
- * @return
+ * @return array
  *   An array of loaded attributes.
  */
-function uc_attribute_load_multiple($aids = array(), $type = '', $id = NULL) {
+function uc_attribute_load_multiple(array $aids = array(), $type = '', $id = NULL) {
   $sql = uc_attribute_type_info($type);
 
   // Product/class attributes.
@@ -652,15 +659,15 @@ function uc_attribute_load_multiple($aids = array(), $type = '', $id = NULL) {
 /**
  * Loads an attribute from the database.
  *
- * @param $aid
+ * @param int $aid
  *   The ID of the attribute.
- * @param $type
+ * @param int $id
+ *   The ID of the product/class this attribute belongs to.
+ * @param string $type
  *   The type of attribute. 'product', or 'class'. Any other type will fetch
  *   a base attribute.
- * @param $id
- *   The ID of the product/class this attribute belongs to.
  *
- * @return
+ * @return object|false
  *   The attribute object, or FALSE if it doesn't exist.
  */
 function uc_attribute_load($aid, $id = NULL, $type = '') {
@@ -669,7 +676,6 @@ function uc_attribute_load($aid, $id = NULL, $type = '') {
   switch ($type) {
     case 'product':
     case 'class':
-
       // Read attribute data.
       $query = db_select('uc_attributes', 'a')
         ->fields('a', array('aid', 'name', 'description'))
@@ -685,7 +691,9 @@ function uc_attribute_load($aid, $id = NULL, $type = '') {
       $attribute = $query->execute()->fetchObject();
 
       // Don't try to build it further if it failed already.
-      if (!$attribute) return FALSE;
+      if (!$attribute) {
+        return FALSE;
+      }
 
       // Set any missing defaults.
       foreach (array('ordering', 'required', 'display', 'label') as $field) {
@@ -707,10 +715,9 @@ function uc_attribute_load($aid, $id = NULL, $type = '') {
         ->orderBy('ao.name');
 
       $result = $query->execute();
-    break;
+      break;
 
     default:
-
       // Read attribute and option data.
       $attribute = db_query("SELECT * FROM {uc_attributes} WHERE aid = :aid", array(':aid' => $aid))->fetchObject();
       $result = db_query("SELECT * FROM {uc_attribute_options} WHERE aid = :aid ORDER BY ordering, name", array(':aid' => $aid));
@@ -719,8 +726,7 @@ function uc_attribute_load($aid, $id = NULL, $type = '') {
       if (!$attribute) {
         return FALSE;
       }
-
-    break;
+      break;
   }
 
   // Got an attribute?
@@ -739,10 +745,10 @@ function uc_attribute_load($aid, $id = NULL, $type = '') {
 /**
  * Fetches an array of attribute objects that belong to a product.
  *
- * @param $nid
+ * @param int $nid
  *   Product whose attributes to load.
  *
- * @return
+ * @return object[]
  *   The array of attribute objects.
  */
 function uc_attribute_load_product_attributes($nid) {
@@ -752,10 +758,10 @@ function uc_attribute_load_product_attributes($nid) {
 /**
  * Saves an attribute object to the database.
  *
- * @param $attribute
+ * @param object $attribute
  *   The attribute object to save.
  *
- * @return
+ * @return int
  *   The integer result from drupal_write_record().
  */
 function uc_attribute_save(&$attribute) {
@@ -767,10 +773,10 @@ function uc_attribute_save(&$attribute) {
 /**
  * Deletes an attribute from the database.
  *
- * @param $aid
+ * @param int $aid
  *   Attribute ID to delete.
  *
- * @return
+ * @return int
  *   The Drupal SAVED_DELETED flag.
  */
 function uc_attribute_delete($aid) {
@@ -794,10 +800,10 @@ function uc_attribute_delete($aid) {
 /**
  * Loads an attribute option from the database.
  *
- * @param $oid
+ * @param int $oid
  *   Option ID to load.
  *
- * @return
+ * @return object
  *   The attribute option object.
  */
 function uc_attribute_option_load($oid) {
@@ -807,10 +813,10 @@ function uc_attribute_option_load($oid) {
 /**
  * Saves an attribute object to the database.
  *
- * @param $option
+ * @param object $option
  *   The attribute option object to save.
  *
- * @return
+ * @return int
  *   The integer result from drupal_write_record().
  */
 function uc_attribute_option_save(&$option) {
@@ -822,10 +828,10 @@ function uc_attribute_option_save(&$option) {
 /**
  * Deletes an attribute option from the database.
  *
- * @param $oid
+ * @param int $oid
  *   Option ID to delete.
  *
- * @return
+ * @return int
  *   The Drupal SAVED_DELETED flag.
  */
 function uc_attribute_option_delete($oid) {
@@ -848,14 +854,14 @@ function uc_attribute_option_delete($oid) {
  *
  * @param &$attribute
  *   The product/class attribute.
- * @param $type
+ * @param string $type
  *   Is this a product or a class?
- * @param $id
+ * @param string $id
  *   The product/class ID.
- * @param $save_options
+ * @param bool $save_options
  *   Save the product/class attribute's options, too?
  *
- * @return
+ * @return int
  *   The integer result from drupal_write_record().
  */
 function uc_attribute_subject_save(&$attribute, $type, $id, $save_options = FALSE) {
@@ -895,14 +901,14 @@ function uc_attribute_subject_save(&$attribute, $type, $id, $save_options = FALS
 /**
  * Deletes an attribute and all options associated with it.
  *
- * @param $aid
+ * @param int $aid
  *   The base attribute ID.
- * @param $type
+ * @param string $type
  *   Is this a product or a class?
  * @param $id
  *   The product/class ID.
  *
- * @return
+ * @return int
  *   The Drupal SAVED_DELETED flag.
  */
 function uc_attribute_subject_delete($aid, $type, $id = NULL) {
@@ -944,14 +950,14 @@ function uc_attribute_subject_delete($aid, $type, $id = NULL) {
 /**
  * Loads a product/class attribute option.
  *
- * @param $oid
+ * @param int $oid
  *   The product/class attribute option ID.
- * @param $type
+ * @param string $type
  *   Is this a product or a class?
- * @param $id
+ * @param int $id
  *   The product/class ID.
  *
- * @return
+ * @return object
  *   An object containing the product/class attribute option.
  */
 function uc_attribute_subject_option_load($oid, $type, $id) {
@@ -974,12 +980,12 @@ function uc_attribute_subject_option_load($oid, $type, $id) {
  *
  * @param &$option
  *   The product/class attribute option.
- * @param $type
+ * @param string $type
  *   Is this a product or a class?
- * @param $id
+ * @param int $id
  *   The product/class ID.
  *
- * @return
+ * @return int
  *   The integer result from drupal_write_record().
  */
 function uc_attribute_subject_option_save(&$option, $type, $id) {
@@ -1000,12 +1006,12 @@ function uc_attribute_subject_option_save(&$option, $type, $id) {
  *
  * @param $oid
  *   The base attribute's option ID.
- * @param $type
+ * @param string $type
  *   Is this a product or a class?
- * @param $id
+ * @param int $id
  *   The product/class ID.
  *
- * @return
+ * @return int
  *   The Drupal SAVED_DELETED flag.
  */
 function uc_attribute_subject_option_delete($oid, $type, $id = NULL, $adjustments = TRUE) {
@@ -1037,14 +1043,14 @@ function uc_attribute_subject_option_delete($oid, $type, $id = NULL, $adjustment
 /**
  * Deletes an attribute adjustment.
  *
- * @param $fields
+ * @param array $fields
  *   Fields used to build a condition to delete adjustments against. Fields
  *   currently handled are 'aid', 'oid', and 'nid'.
  *
- * @return
+ * @return int
  *   The Drupal SAVED_DELETED flag.
  */
-function uc_attribute_adjustments_delete($fields) {
+function uc_attribute_adjustments_delete(array $fields) {
   // Build the serialized string to match against adjustments.
   $match = '';
   if (!empty($fields['aid'])) {
@@ -1067,7 +1073,7 @@ function uc_attribute_adjustments_delete($fields) {
     $query->condition('nid', $fields['nid']);
   }
 
-  // Delete what's necessary,
+  // Delete what's necessary.
   if ($query->conditions()) {
     $query->execute();
   }
@@ -1078,14 +1084,14 @@ function uc_attribute_adjustments_delete($fields) {
 /**
  * Checks if a product/class attribute exists.
  *
- * @param $aid
+ * @param int $aid
  *   The base attribute ID.
- * @param $id
- *   The product/class attribute's ID.
- * @param $type
+ * @param string $type
  *   Is this a product or a class?
+ * @param int $id
+ *   The product/class attribute's ID.
  *
- * @return
+ * @return bool
  *   TRUE if the attribute exists.
  */
 function uc_attribute_subject_exists($aid, $type, $id) {
@@ -1100,14 +1106,14 @@ function uc_attribute_subject_exists($aid, $type, $id) {
 /**
  * Checks if a product/class attribute option exists.
  *
- * @param $oid
+ * @param int $oid
  *   The base attribute option ID.
- * @param $id
+ * @param int $id
  *   The product/class attribute option's ID.
- * @param $type
+ * @param string $type
  *   Is this a product or a class?
  *
- * @return
+ * @return bool
  *   TRUE if the attribute option exists.
  */
 function uc_attribute_subject_option_exists($oid, $type, $id) {
@@ -1122,10 +1128,10 @@ function uc_attribute_subject_option_exists($oid, $type, $id) {
 /**
  * Returns a list of names to abstract queries between products and classes.
  *
- * @param $type
+ * @param string $type
  *   Is this a product or a class?
  *
- * @return
+ * @return array
  *   Array of information helpful for creating SQL queries dealing
  *   with attributes.
  */
@@ -1137,7 +1143,6 @@ function uc_attribute_type_info($type) {
         'opt_table' => 'uc_product_options',
         'id' => 'nid',
       );
-    break;
 
     case 'class':
       return array(
@@ -1145,12 +1150,17 @@ function uc_attribute_type_info($type) {
         'opt_table' => 'uc_class_attribute_options',
         'id' => 'pcid',
       );
-    break;
   }
 }
 
 /**
  * Loads all attributes associated with a product node.
+ *
+ * @param int $nid
+ *   The product node id.
+ *
+ * @return array
+ *   The attributes.
  */
 function uc_product_get_attributes($nid) {
   $attributes = array();
@@ -1165,6 +1175,12 @@ function uc_product_get_attributes($nid) {
 
 /**
  * Loads all attributes associated with a product class.
+ *
+ * @param int $pcid
+ *   The product class id.
+ *
+ * @return array
+ *   The attributes.
  */
 function uc_class_get_attributes($pcid) {
   $attributes = array();
@@ -1180,10 +1196,10 @@ function uc_class_get_attributes($pcid) {
 /**
  * Gets the options chosen for a product that is in the cart.
  *
- * @param $item
+ * @param mixed $item
  *   An element of the array returned by uc_cart_get_contents.
  *
- * @return
+ * @return array
  *   Array of options chosen by a customer, indexed by attribute ids. Each
  *   element stores the attribute name and the option object chosen.
  */
@@ -1204,9 +1220,9 @@ function _uc_cart_product_get_options($item) {
         // Only discrete options can affect the price of an item.
         if ($attribute->display && count($attribute->options)) {
           // There may be many selected options, or just one.
-          foreach ((array)$selected as $oid) {
+          foreach ((array) $selected as $oid) {
             if ($oid > 0) {
-              $options[$index] = (array)$attribute->options[$oid];
+              $options[$index] = (array) $attribute->options[$oid];
               $options[$index]['attribute'] = $name;
               $index++;
             }
@@ -1262,18 +1278,21 @@ function uc_attribute_option_ajax($form, $form_state) {
  *   The unique id to use to wrap these form elements.
  * @param &$product
  *   The product node for which the attribute form elements are to be attached.
- * @param $use_ajax
+ * @param bool $use_ajax
  *   TRUE to add ajax to the form. Note that ajax may be added even if this is
  *   FALSE, if there are multiple attributes and one or more of them is set to
  *   display total price.
  *
+ * @return array
+ *   Form API array with attribute elements to add to the product form.
+ *
  * @see theme_uc_attribute_add_to_cart()
  * @see uc_attribute_option_ajax()
  */
 function _uc_attribute_alter_form($id, &$product, $use_ajax) {
   // If the product doesn't have attributes, return the form as it is.
   if (empty($product->attributes) || !is_array($product->attributes)) {
-    return NULL;
+    return array();
   }
 
   $nid = $product->nid;
@@ -1286,7 +1305,8 @@ function _uc_attribute_alter_form($id, &$product, $use_ajax) {
     $product->data = array();
   }
 
-  // If the form is being built for the first time, populate attributes with their default values.
+  // If the form is being built for the first time, populate attributes
+  // with their default values.
   if (!isset($product->data['attributes'])) {
     $values = array();
     foreach ($priced_attributes as $aid) {
@@ -1386,9 +1406,11 @@ function _uc_attribute_alter_form($id, &$product, $use_ajax) {
         case 1:
           $attr_type = 'select';
           break;
+
         case 2:
           $attr_type = 'radios';
           break;
+
         case 3:
           $attr_type = 'checkboxes';
           $attribute->default_option = array();
@@ -1436,6 +1458,9 @@ function _uc_attribute_alter_form($id, &$product, $use_ajax) {
 
 /**
  * Returns an array of display types used as options when creating attributes.
+ *
+ * @return array
+ *   Array of display types used as options when creating attributes.
  */
 function _uc_attribute_display_types() {
   return array(
@@ -1449,10 +1474,10 @@ function _uc_attribute_display_types() {
 /**
  * Gets the price affecting attributes for a product.
  *
- * @param $nid
+ * @param int $nid
  *   The nid of a product.
  *
- * @return
+ * @return array
  *   Array of attribute ids that have price affecting options.
  */
 function uc_attribute_priced_attributes($nid) {
@@ -1472,13 +1497,13 @@ function uc_attribute_priced_attributes($nid) {
  * The NULL return value is typically used by forms so they know to hide the
  * #title property of the element.
  *
- * @param $attribute
+ * @param object $attribute
  *   Attribute object.
- * @param $title
+ * @param bool $title
  *   TRUE indicates the function is to return the attribute name when its label
  *   is set to '<none>'.
  *
- * @return
+ * @return string|null
  *   When the attribute label is set and not '<none>', it is returned.
  *   Otherwise, the attribute name is returned when $title is TRUE and NULL is
  *   returned when $title is FALSE.
@@ -1517,7 +1542,7 @@ function uc_attribute_i18n_string_refresh() {
 
     $options = db_query("SELECT oid, name FROM {uc_attribute_options} WHERE aid = :aid", array(':aid' => $attribute->aid));
     foreach ($options as $option) {
-      i18n_string_update('uc_attribute:option:' . $option->oid .':name', $option->name);
+      i18n_string_update('uc_attribute:option:' . $option->oid . ':name', $option->name);
     }
   }
 

+ 91 - 34
sites/all/modules/contrib/ecommerce/ubercart/uc_cart/tests/uc_cart.test

@@ -30,7 +30,7 @@ class UbercartCartCheckoutTestCase extends UbercartTestHelper {
   /**
    * Creates a new order.
    */
-  function createOrder($fields = array()) {
+  protected function createOrder($fields = array()) {
     $order = uc_order_new();
     foreach ($fields as $key => $value) {
       $order->$key = $value;
@@ -55,7 +55,10 @@ class UbercartCartCheckoutTestCase extends UbercartTestHelper {
     return $order;
   }
 
-  function testCartAPI() {
+  /**
+   * Tests cart API.
+   */
+  public function testCartApi() {
     // Test the empty cart.
     $items = uc_cart_get_contents();
     $this->assertEqual($items, array(), 'Cart is an empty array.');
@@ -99,7 +102,7 @@ class UbercartCartCheckoutTestCase extends UbercartTestHelper {
     foreach ($items as $item) {
       uc_cart_remove_item($item->nid, NULL, $item->data);
     }
-    // @TODO: remove the need for this
+    // @todo Remove the need for this.
     uc_cart_get_contents(NULL, 'rebuild');
 
     $items = uc_cart_get_contents();
@@ -113,7 +116,10 @@ class UbercartCartCheckoutTestCase extends UbercartTestHelper {
     $this->assertEqual($items, array(), 'Cart is emptied correctly.');
   }
 
-  function testCart() {
+  /**
+   * Tests basic cart functionality.
+   */
+  public function testCart() {
     module_enable(array('uc_cart_entity_test'));
 
     // Test the empty cart.
@@ -160,7 +166,10 @@ class UbercartCartCheckoutTestCase extends UbercartTestHelper {
     $this->assertText('hook_uc_cart_item_delete fired');
   }
 
-  function testCartMerge() {
+  /**
+   * Tests that anonymous cart is merged into authenticated cart upon login.
+   */
+  public function testCartMerge() {
     // Add an item to the cart as an anonymous user.
     $this->drupalLogin($this->customer);
     $this->drupalPost('node/' . $this->product->nid, array(), t('Add to cart'));
@@ -178,7 +187,10 @@ class UbercartCartCheckoutTestCase extends UbercartTestHelper {
     $this->assertFieldByName('items[0][qty]', 2, t('The product quantity is 2.'));
   }
 
-  function testDeletedCartItem() {
+  /**
+   * Tests that cart automatically removes products that have been deleted.
+   */
+  public function testDeletedCartItem() {
     // Add a product to the cart, then delete the node.
     $this->drupalPost('node/' . $this->product->nid, array(), t('Add to cart'));
     node_delete($this->product->nid);
@@ -189,7 +201,10 @@ class UbercartCartCheckoutTestCase extends UbercartTestHelper {
     $this->assertEqual(uc_cart_get_total_qty(), 0, 'There are no items in the cart.');
   }
 
-  function testMaximumQuantityRule() {
+  /**
+   * Tests Rule integration for uc_cart_maximum_product_qty reaction rule.
+   */
+  public function testMaximumQuantityRule() {
     // Enable the example maximum quantity rule.
     $rule = rules_config_load('uc_cart_maximum_product_qty');
     $rule->active = TRUE;
@@ -204,8 +219,12 @@ class UbercartCartCheckoutTestCase extends UbercartTestHelper {
     $this->assertFieldByName('items[0][qty]', 10);
   }
 
-  function testCheckout() {
-    // Allow customer to specify username and password, but don't log in after checkout.
+  /**
+   * Tests the checkout process.
+   */
+  public function testCheckout() {
+    // Allow customer to specify username and password,
+    // but don't log in after checkout.
     $settings = array(
       'uc_cart_new_account_name' => TRUE,
       'uc_cart_new_account_password' => TRUE,
@@ -285,7 +304,7 @@ class UbercartCartCheckoutTestCase extends UbercartTestHelper {
     $this->drupalLogout();
     $this->drupalLogin($new_user);
 
-    // Test again with an existing email address
+    // Test again with an existing email address.
     $this->drupalLogout();
     $this->drupalPost('node/' . $this->product->nid, array(), t('Add to cart'));
     $this->checkout(array('panes[customer][primary_email]' => $this->customer->mail));
@@ -293,7 +312,10 @@ class UbercartCartCheckoutTestCase extends UbercartTestHelper {
     $this->assertRaw('order has been attached to the account we found');
   }
 
-  function testCheckoutNewUsername() {
+  /**
+   * Tests generating a new account at checkout.
+   */
+  public function testCheckoutNewUsername() {
     // Configure the checkout for this test.
     $this->drupalLogin($this->adminUser);
     $settings = array(
@@ -326,7 +348,10 @@ class UbercartCartCheckoutTestCase extends UbercartTestHelper {
     $this->assertText('A new account has been created');
   }
 
-  function testCheckoutBlockedUser() {
+  /**
+   * Tests blocked user checkout.
+   */
+  public function testCheckoutBlockedUser() {
     // Block user after checkout.
     $settings = array(
       'uc_new_customer_status_active' => FALSE,
@@ -347,7 +372,10 @@ class UbercartCartCheckoutTestCase extends UbercartTestHelper {
     $this->assertTrue(empty($mail), 'No unblocked user email found.');
   }
 
-  function testCheckoutLogin() {
+  /**
+   * Tests logging in the customer after checkout.
+   */
+  public function testCheckoutLogin() {
     // Log in after checkout.
     variable_set('uc_new_customer_login', TRUE);
 
@@ -371,7 +399,10 @@ class UbercartCartCheckoutTestCase extends UbercartTestHelper {
     $this->assertText('There are no products in your shopping cart.');
   }
 
-  function testCheckoutComplete() {
+  /**
+   * Tests checkout complete functioning.
+   */
+  public function testCheckoutComplete() {
     // Payment notification is received first.
     $order_data = array('primary_email' => 'simpletest@ubercart.org');
     $order = $this->createOrder($order_data);
@@ -381,7 +412,7 @@ class UbercartCartCheckoutTestCase extends UbercartTestHelper {
     // Check that a new account was created.
     $this->assertTrue(strpos($output['#message'], 'new account has been created') !== FALSE, 'Checkout message mentions new account.');
 
-    // 2 e-mails: new account, customer invoice
+    // 2 e-mails: new account, customer invoice.
     $mails = $this->drupalGetMails();
     $this->assertEqual(count($mails), 2, '2 e-mails were sent.');
     variable_del('drupal_test_email_collector');
@@ -397,7 +428,7 @@ class UbercartCartCheckoutTestCase extends UbercartTestHelper {
     $output = uc_cart_complete_sale($order, TRUE);
     uc_payment_enter($order->order_id, 'SimpleTest', $order->order_total);
 
-    // 2 e-mails: new account, customer invoice
+    // 2 e-mails: new account, customer invoice.
     $mails = $this->drupalGetMails();
     $this->assertEqual(count($mails), 2, '2 e-mails were sent.');
     variable_del('drupal_test_email_collector');
@@ -415,13 +446,13 @@ class UbercartCartCheckoutTestCase extends UbercartTestHelper {
     // Check that no new account was created.
     $this->assertTrue(strpos($output['#message'], 'order has been attached to the account') !== FALSE, 'Checkout message mentions existing account.');
 
-    // 1 e-mail: customer invoice
+    // 1 e-mail: customer invoice.
     $mails = $this->drupalGetMails();
     $this->assertEqual(count($mails), 1, '1 e-mail was sent.');
     variable_del('drupal_test_email_collector');
   }
 
-  function testCheckoutRoleAssignment() {
+  public function testCheckoutRoleAssignment() {
     // Add role assignment to the test product.
     $rid = $this->drupalCreateRole(array('access content'));
     $this->drupalLogin($this->adminUser);
@@ -445,7 +476,7 @@ class UbercartCartCheckoutTestCase extends UbercartTestHelper {
     $order = uc_order_load($order->order_id);
     $this->assertEqual($order->order_status, 'payment_received', 'Shippable order was set to payment received.');
 
-    // 3 e-mails: new account, customer invoice, role assignment
+    // 3 e-mails: new account, customer invoice, role assignment.
     $mails = $this->drupalGetMails();
     $this->assertEqual(count($mails), 3, '3 e-mails were sent.');
     variable_del('drupal_test_email_collector');
@@ -462,7 +493,7 @@ class UbercartCartCheckoutTestCase extends UbercartTestHelper {
     $order = uc_order_load($order->order_id);
     $this->assertEqual($order->order_status, 'completed', 'Non-shippable order was set to completed.');
 
-    // 2 e-mails: customer invoice, role assignment
+    // 2 e-mails: customer invoice, role assignment.
     $mails = $this->drupalGetMails();
     $this->assertEqual(count($mails), 2, '2 e-mails were sent.');
     variable_del('drupal_test_email_collector');
@@ -471,7 +502,7 @@ class UbercartCartCheckoutTestCase extends UbercartTestHelper {
   /**
    * Tests that cart orders are marked abandoned after a timeout.
    */
-  function testCartOrderTimeout() {
+  public function testCartOrderTimeout() {
     $this->drupalPost('node/' . $this->product->nid, array(), t('Add to cart'));
     $this->drupalPost('cart', array(), 'Checkout');
     $this->assertText(
@@ -509,7 +540,8 @@ class UbercartCartCheckoutTestCase extends UbercartTestHelper {
 
     $order_id = db_query("SELECT order_id FROM {uc_orders} WHERE delivery_first_name = :name", array(':name' => $oldname))->fetchField();
     if ($order_id) {
-      // Go to a different page, then back to order - make sure order_id is the same.
+      // Go to a different page, then back to order to make sure
+      // order_id is the same.
       $this->drupalGet('<front>');
       $this->drupalPost('node/' . $this->product->nid, array(), t('Add to cart'));
       $this->drupalPost('cart', array(), 'Checkout');
@@ -527,7 +559,8 @@ class UbercartCartCheckoutTestCase extends UbercartTestHelper {
         ->execute();
       $old_order = uc_order_load($order_id);
 
-      // Go to a different page, then back to order - verify that we are using a new order.
+      // Go to a different page, then back to order to verify that we are
+      // using a new order.
       $this->drupalGet('<front>');
       $this->drupalPost('cart', array(), 'Checkout');
       $this->assertNoRaw($oldname, 'Customer name was cleared after timeout.');
@@ -546,7 +579,10 @@ class UbercartCartCheckoutTestCase extends UbercartTestHelper {
     }
   }
 
-  function testCustomerInformationCheckoutPane() {
+  /**
+   * Tests functioning of customer information pane on checkout page.
+   */
+  public function testCustomerInformationCheckoutPane() {
     // Log in as a customer and add an item to the cart.
     $this->drupalLogin($this->customer);
     $this->drupalPost('node/' . $this->product->nid, array(), t('Add to cart'));
@@ -588,7 +624,10 @@ class UbercartCartSettingsTestCase extends UbercartTestHelper {
     );
   }
 
-  function testAddToCartRedirect() {
+  /**
+   * Tests add-to-cart redirection.
+   */
+  public function testAddToCartRedirect() {
     $this->drupalLogin($this->adminUser);
     $this->drupalGet('admin/store/settings/cart');
     $this->assertField(
@@ -625,7 +664,10 @@ class UbercartCartSettingsTestCase extends UbercartTestHelper {
     $this->assertTrue($this->getUrl() == $url, 'Add to cart no-redirect works with a query string.');
   }
 
-  function testMinimumSubtotal() {
+  /**
+   * Tests minimum subtotal for checkout.
+   */
+  public function testMinimumSubtotal() {
     $this->drupalLogin($this->adminUser);
     $this->drupalGet('admin/store/settings/cart');
     $this->assertField(
@@ -640,12 +682,12 @@ class UbercartCartSettingsTestCase extends UbercartTestHelper {
       t('Save configuration')
     );
 
-    // Create two products, one below the minimum price, and one above the minimum price.
+    // Create two products, one below the minimum price and one above.
     $product_below_limit = $this->createProduct(array('sell_price' => $minimum_subtotal - 1));
     $product_above_limit = $this->createProduct(array('sell_price' => $minimum_subtotal + 1));
     $this->drupalLogout();
 
-    // Check to see if the lower priced product triggers the minimum price logic.
+    // Checks if the lower priced product triggers the minimum price logic.
     $this->drupalPost(
       'node/' . $product_below_limit->nid,
       array(),
@@ -660,7 +702,8 @@ class UbercartCartSettingsTestCase extends UbercartTestHelper {
       t('Prevented checkout below the minimum order total.')
     );
 
-    // Add another product to the cart, and verify that we land on the checkout page.
+    // Add another product to the cart, and verify that we land on
+    // the checkout page.
     $this->drupalPost(
       'node/' . $product_above_limit->nid,
       array(),
@@ -674,7 +717,7 @@ class UbercartCartSettingsTestCase extends UbercartTestHelper {
     $this->assertText('Enter your billing address and information here.');
   }
 
-  function testEmptyCart() {
+  public function testEmptyCart() {
     // Test that the feature is not enabled by default.
     $this->drupalPost('node/' . $this->product->nid, array(), 'Add to cart');
     $this->assertNoRaw('Empty cart');
@@ -693,7 +736,10 @@ class UbercartCartSettingsTestCase extends UbercartTestHelper {
     $this->assertText('There are no products in your shopping cart.');
   }
 
-  function testContinueShopping() {
+  /**
+   * Tests that continue shopping link returns customer to the correct place.
+   */
+  public function testContinueShopping() {
     // Continue shopping link should take you back to the product page.
     $this->drupalPost(
       'node/' . $this->product->nid,
@@ -747,7 +793,10 @@ class UbercartCartSettingsTestCase extends UbercartTestHelper {
     );
   }
 
-  function testCartBreadcrumb() {
+  /**
+   * Tests the shopping cart page breadcrumb.
+   */
+  public function testCartBreadcrumb() {
     $this->drupalLogin($this->adminUser);
     $this->drupalGet('admin/store/settings/cart');
     $this->assertField(
@@ -785,6 +834,7 @@ class UbercartCartSettingsTestCase extends UbercartTestHelper {
       t('The breadcrumb link is set correctly.')
     );
   }
+
 }
 
 /**
@@ -800,7 +850,10 @@ class UbercartCheckoutSettingsTestCase extends UbercartTestHelper {
     );
   }
 
-  function testEnableCheckout() {
+  /**
+   * Tests enabling checkout functionality.
+   */
+  public function testEnableCheckout() {
     $this->drupalLogin($this->adminUser);
     $this->drupalGet('admin/store/settings/checkout');
     $this->assertField(
@@ -827,7 +880,10 @@ class UbercartCheckoutSettingsTestCase extends UbercartTestHelper {
     );
   }
 
-  function testAnonymousCheckout() {
+  /**
+   * Tests anonymous checkout functionality.
+   */
+  public function testAnonymousCheckout() {
     $this->drupalLogin($this->adminUser);
     $this->drupalGet('admin/store/settings/checkout');
     $this->assertField(
@@ -855,4 +911,5 @@ class UbercartCheckoutSettingsTestCase extends UbercartTestHelper {
       t('The checkout page is not displayed.')
     );
   }
+
 }

+ 3 - 4
sites/all/modules/contrib/ecommerce/ubercart/uc_cart/tests/uc_cart_entity_test.info

@@ -3,9 +3,8 @@ core = 7.x
 dependencies[] = uc_cart
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2016-07-16
-version = "7.x-3.10"
+; Information added by Drupal.org packaging script on 2019-03-06
+version = "7.x-3.12"
 core = "7.x"
 project = "ubercart"
-datestamp = "1468644909"
-
+datestamp = "1551862392"

+ 5 - 4
sites/all/modules/contrib/ecommerce/ubercart/uc_cart/uc_cart.admin.inc

@@ -9,11 +9,12 @@
  * General settings for the shopping cart.
  *
  * @see uc_cart_cart_settings_form_validate()
+ *
  * @ingroup forms
  */
 function uc_cart_cart_settings_form($form, &$form_state) {
 
-  // Put fieldsets into vertical tabs
+  // Put fieldsets into vertical tabs.
   $form['cart-settings'] = array(
     '#type' => 'vertical_tabs',
     '#attached' => array(
@@ -39,12 +40,12 @@ function uc_cart_cart_settings_form($form, &$form_state) {
     $form['general']['panes'][$id]['uc_cap_' . $id . '_enabled'] = array(
       '#type' => 'checkbox',
       '#title' => check_plain($pane['title']),
-      '#default_value' => variable_get('uc_cap_'. $pane['id'] .'_enabled', $pane['enabled']),
+      '#default_value' => variable_get('uc_cap_' . $pane['id'] . '_enabled', $pane['enabled']),
     );
     $form['general']['panes'][$id]['uc_cap_' . $id . '_weight'] = array(
       '#type' => 'weight',
       '#delta' => 10,
-      '#default_value' => variable_get('uc_cap_'. $pane['id'] .'_weight', $pane['weight']),
+      '#default_value' => variable_get('uc_cap_' . $pane['id'] . '_weight', $pane['weight']),
       '#attributes' => array('class' => array('uc-cart-pane-weight')),
     );
   }
@@ -218,7 +219,7 @@ function uc_cart_cart_settings_form_validate($form, &$form_state) {
  */
 function uc_cart_checkout_settings_form($form, &$form_state) {
 
-  // Put fieldsets into vertical tabs
+  // Put fieldsets into vertical tabs.
   $form['checkout-settings'] = array(
     '#type' => 'vertical_tabs',
     '#attached' => array(

+ 1 - 2
sites/all/modules/contrib/ecommerce/ubercart/uc_cart/uc_cart.api.php

@@ -128,14 +128,13 @@ function hook_uc_cart_display($item) {
     '#markup' => node_access('view', $node) ? l($item->title, 'node/' . $node->nid) : check_plain($item->title),
   );
 
-
   $element['#total'] = $item->price * $item->qty;
   $element['data'] = array('#type' => 'hidden', '#value' => serialize($item->data));
   $element['qty'] = array(
     '#type' => 'textfield',
     '#default_value' => $item->qty,
     '#size' => 5,
-    '#maxlength' => 6
+    '#maxlength' => 6,
   );
 
   if ($description = uc_product_get_description($item)) {

+ 4 - 2
sites/all/modules/contrib/ecommerce/ubercart/uc_cart/uc_cart.controller.inc

@@ -1,9 +1,10 @@
 <?php
+
 /**
  * @file
- *
  * Contains the controller for uc_cart_item entities.
  */
+
 class UcCartItemController extends EntityAPIController {
 
   /**
@@ -21,7 +22,7 @@ class UcCartItemController extends EntityAPIController {
     parent::attachLoad($items, $revision_id);
   }
 
- /**
+  /**
    * Saves a cart item entity.
    *
    * Cart items are deleted if saved with a quantity of zero.
@@ -52,4 +53,5 @@ class UcCartItemController extends EntityAPIController {
 
     return parent::buildContent($product, $view_mode, $langcode, $content);
   }
+
 }

+ 3 - 4
sites/all/modules/contrib/ecommerce/ubercart/uc_cart/uc_cart.info

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

+ 0 - 1
sites/all/modules/contrib/ecommerce/ubercart/uc_cart/uc_cart.info.inc

@@ -5,7 +5,6 @@
  * Entity metadata hooks for uc_cart.module.
  */
 
-
 /**
  * Implements hook_entity_property_info().
  */

+ 1 - 1
sites/all/modules/contrib/ecommerce/ubercart/uc_cart/uc_cart.install

@@ -18,7 +18,7 @@ function uc_cart_schema() {
         'description' => 'Unique identifier for cart item.',
         'type' => 'serial',
         'unsigned' => TRUE,
-        'not null' => TRUE
+        'not null' => TRUE,
       ),
       'cart_id' => array(
         'description' => 'A user-specific cart ID. For authenticated users, their {users}.uid. For anonymous users, a token.',

+ 11 - 11
sites/all/modules/contrib/ecommerce/ubercart/uc_cart/uc_cart.module

@@ -22,7 +22,6 @@ define('UC_CART_ORDER_TIMEOUT', 86400); // 24 hours
  */
 define('UC_CART_CHECKOUT_TIMEOUT', 1800); // 30 minutes
 
-
 /**
  * Implements hook_menu().
  */
@@ -378,7 +377,7 @@ function uc_cart_block_view($delta = '') {
         'item_text' => $item_text,
         'total' => $total,
         'summary_links' => $summary_links,
-        'collapsed' => variable_get('uc_cart_block_collapsed', TRUE)
+        'collapsed' => variable_get('uc_cart_block_collapsed', TRUE),
       ));
 
       return $block;
@@ -597,6 +596,7 @@ function uc_cart_login_update($uid) {
  * @see uc_cart_view_form_checkout()
  * @see theme_uc_cart_view_form()
  * @see uc_cart_view_table()
+ *
  * @ingroup forms
  */
 function uc_cart_view_form($form, &$form_state, $items = NULL) {
@@ -608,7 +608,7 @@ function uc_cart_view_form($form, &$form_state, $items = NULL) {
   );
 
   $i = 0;
-  $display_items = entity_view('uc_cart_item', $items, 'cart');
+  $display_items = entity_view('uc_cart_item', $items, 'cart', NULL, TRUE);
   foreach (element_children($display_items['uc_cart_item']) as $key) {
     $display_item = $display_items['uc_cart_item'][$key];
     if (count(element_children($display_item))) {
@@ -716,7 +716,7 @@ function uc_cart_view_form_submit($form, &$form_state) {
   // if a qty has changed.
   foreach ($form['items'] as $key => $item) {
     if (isset($item['qty']['#default_value']) && $item['qty']['#default_value'] != $form_state['values']['items'][$key]['qty']) {
-      uc_cart_update_item_object((object)$form_state['values']);
+      uc_cart_update_item_object((object) $form_state['values']);
     }
   }
 }
@@ -813,10 +813,10 @@ function uc_cart_view_table($table) {
 /**
  * Returns the URL redirect for the continue shopping element on the cart page.
  *
- * @param $unset
+ * @param bool $unset
  *   TRUE or FALSE indicating whether or not to unset the last URL variable.
  *
- * @return
+ * @return string
  *   The URL or Drupal path that will be used for the continue shopping element.
  */
 function uc_cart_continue_shopping_url($unset = TRUE) {
@@ -979,13 +979,13 @@ function uc_cart_complete_sale_account($order) {
 
   $order->uid = $account->uid;
   $order->data['new_user']['name'] = $fields['name'];
-  $order->data['complete_sale'] =  'new_user';
+  $order->data['complete_sale'] = 'new_user';
 }
 
 /**
  * Returns the unique cart_id of the user.
  *
- * @param $create
+ * @param bool $create
  *   Toggle auto creation of cart id.
  *
  * @return
@@ -1013,7 +1013,7 @@ function uc_cart_get_id($create = TRUE) {
  *   (optional) Carts are statically cached by default. If set to "rebuild",
  *   the cache will be ignored and the cart reloaded from the database.
  *
- * @return
+ * @return array
  *   An array of cart items.
  */
 function uc_cart_get_contents($cid = NULL, $action = NULL) {
@@ -1086,7 +1086,7 @@ function uc_cart_get_contents($cid = NULL, $action = NULL) {
  *   The cart ID of the shopping cart whose items we're totalling; defaults to
  *   the current user's cart.
  *
- * @return
+ * @return int
  *   An integer representing the total number of items in the cart.
  */
 function uc_cart_get_total_qty($cid = NULL) {
@@ -1349,7 +1349,7 @@ function uc_cart_is_shippable($cart_id = NULL) {
 /**
  * Removes panes from the list that match the given conditions.
  *
- * @return
+ * @return array
  *   A checkout pane array with panes filtered out that have key values
  *   matching the combinations in the $remove array.
  */

+ 1 - 2
sites/all/modules/contrib/ecommerce/ubercart/uc_cart/uc_cart.rules.inc

@@ -2,8 +2,7 @@
 
 /**
  * @file
- * This file contains the Rules hooks and functions necessary to
- * make the cart related entity, conditions, events, and actions work.
+ * Hooks and functions for uc_cart Rules integration.
  */
 
 /**

+ 1 - 1
sites/all/modules/contrib/ecommerce/ubercart/uc_cart/uc_cart.rules_defaults.inc

@@ -48,7 +48,7 @@ function uc_cart_default_rules_configuration() {
 
   // Setup a default predicate for admin checkout notifications.
   $rule = rules_reaction_rule();
-  $rule ->label = t('E-mail admin checkout notification');
+  $rule->label = t('E-mail admin checkout notification');
   $rule->active = TRUE;
   $rule->event('uc_checkout_complete')
     ->action('uc_order_email_invoice', array(

+ 0 - 1
sites/all/modules/contrib/ecommerce/ubercart/uc_cart/uc_cart.variable.inc

@@ -5,7 +5,6 @@
  * Variable module hook implementations.
  */
 
-
 /**
  * Implements hook_variable_group_info().
  */

+ 1 - 1
sites/all/modules/contrib/ecommerce/ubercart/uc_cart/uc_cart_checkout_pane.inc

@@ -271,7 +271,7 @@ function uc_checkout_pane_address($pane, $op, $order, &$form_state, $description
           }
         }
 
-        if ($element['#name'] == "panes[$pane][select_address]") {
+        if ($element['#name'] == "panes[$pane][select_address]" && isset($addresses[$element['#value']])) {
           $address = $addresses[$element['#value']];
           foreach ($address as $field => $value) {
             $form_state['input']['panes'][$pane][$pane . '_' . $field] = $value;

+ 106 - 105
sites/all/modules/contrib/ecommerce/ubercart/uc_cart_links/tests/uc_cart_links.test

@@ -28,13 +28,13 @@ class UbercartCartLinksTestCase extends UbercartTestHelper {
   /**
    * Tests access to admin settings page and tests default values.
    */
-  function testCartLinksUISettingsPage() {
-    // Access settings page by anonymous user
+  public function testCartLinksUISettingsPage() {
+    // Access settings page by anonymous user.
     $this->drupalGet('admin/store/settings/cart-links');
     $this->assertText(t('Access denied'));
     $this->assertText(t('You are not authorized to access this page.'));
 
-    // Access settings page by privileged user
+    // Access settings page by privileged user.
     $this->drupalLogin($this->adminUser);
     $this->drupalGet('admin/store/settings/cart-links');
     $this->assertText(
@@ -67,7 +67,7 @@ class UbercartCartLinksTestCase extends UbercartTestHelper {
       t('Cart Links restrictions is empty.')
     );
 
-    // Test presence of and contents of Help page
+    // Test presence of and contents of Help page.
     $this->clickLink(t('View the help page'));
     $this->assertText(
       'http://www.example.com/cart/add/&lt;cart_link_content&gt;',
@@ -78,32 +78,32 @@ class UbercartCartLinksTestCase extends UbercartTestHelper {
   /**
    * Tests Cart Links on a page under a variety of conditions.
    */
-  function testCartLinksBasicFunctionality() {
-    // Create product
+  public function testCartLinksBasicFunctionality() {
+    // Create product.
     $products[] = $this->createCartLinksProduct(FALSE);
 
-    // Create a product class
+    // Create a product class.
     $products[] = $this->createCartLinksProduct(FALSE);  // later ...
 
-    // Create some valid Cart Links for these products
+    // Create some valid Cart Links for these products.
     $link_array = $this->createValidCartLinks($products);
     $cart_links = $link_array['links'];
     $link_data  = $link_array['data'];
 
     // Need to test incorrect links as well:
-    //   links which add invalid attributes
-    //   links which omit required attributes
+    // - links which add invalid attributes.
+    // - links which omit required attributes.
 
-    // Create a page containing these links
+    // Create a page containing these links.
     $page = $this->createCartLinksPage($cart_links);
 
     //
-    // Test clicking on links
+    // Test clicking on links.
     //
 
     foreach ($cart_links as $key => $test_link) {
       $this->drupalGet('node/' . $page->nid);
-      // Look for link on page
+      // Look for link on page.
       $this->assertLink(
         t('Cart Link #@link', array('@link' => $key)),
         0,
@@ -116,16 +116,16 @@ class UbercartCartLinksTestCase extends UbercartTestHelper {
         t('Cart Link @link found on page.', array('@link' => $test_link))
       );
 
-      // Click on link
+      // Click on link.
       $this->clickLink(t('Cart Link #@link', array('@link' => $key)));
       // Check for notice that item was added (this notice is set ON
-      // by default, see admin/store/settings/cart)
+      // by default, see admin/store/settings/cart).
       $this->assertText(
         t('@title added to your shopping cart.', array('@title' => $link_data[$key]['title'])),
         t('Product @title added to cart.', array('@title' => $link_data[$key]['title']))
       );
 
-      // Check contents of cart
+      // Check contents of cart.
       $this->drupalGet('cart');
       $this->assertText(
         $link_data[$key]['title'],
@@ -137,14 +137,14 @@ class UbercartCartLinksTestCase extends UbercartTestHelper {
         t('Product quantity correct in cart.')
       );
 
-      // Check for correct attribute name(s) in cart
+      // Check for correct attribute name(s) in cart.
       foreach ($link_data[$key]['attributes'] as $label => $attribute) {
         $this->assertText(
           $label . ':',
           t('Attribute @label correct in cart.', array('@label' => $label))
         );
         foreach ($attribute as $option) {
-          // Check for correct option name(s) in cart
+          // Check for correct option name(s) in cart.
           $this->assertText(
             $option,
             t('Option @name correct in cart.', array('@name' => $option))
@@ -153,15 +153,15 @@ class UbercartCartLinksTestCase extends UbercartTestHelper {
       }
 
       // Use the same link, but this time append an '_s' to turn
-      // off message display for this product
+      // off message display for this product.
       $this->drupalGet($test_link . '_s');
-      // Default add-to-cart message is different when adding a duplicate item
+      // Default add-to-cart message is different when adding a duplicate item.
       $this->assertNoText(
         t('Your item(s) have been updated.'),
         t('Default add-to-cart message suppressed.')
       );
 
-      // Empty cart (press remove button)
+      // Empty cart (press remove button).
       $this->drupalPost('cart', array(), t('Remove'));
       $this->assertText('There are no products in your shopping cart.');
     }
@@ -171,32 +171,32 @@ class UbercartCartLinksTestCase extends UbercartTestHelper {
   /**
    * Tests Cart Links product action messages.
    */
-  function testCartLinksProductActionMessage() {
-    // Create product
+  public function testCartLinksProductActionMessage() {
+    // Create product.
     $products[] = $this->createCartLinksProduct(FALSE);
 
-    // Create a product class
+    // Create a product class.
     $products[] = $this->createCartLinksProduct(FALSE);  // later ...
 
-    // Create some valid Cart Links for these products
+    // Create some valid Cart Links for these products.
     $link_array = $this->createValidCartLinks($products);
     $cart_links = $link_array['links'];
     $link_data  = $link_array['data'];
 
-    // Create a page containing these links
+    // Create a page containing these links.
     $page = $this->createCartLinksPage($cart_links);
 
     $this->drupalLogin($this->adminUser);
 
     //
-    // Test product action message display
+    // Test product action message display.
     //
 
-    // Turn on display of product action message
+    // Turn on display of product action message.
     $this->setCartLinksUIProductActionMessage(TRUE);
-    // Go to page with Cart Links
+    // Go to page with Cart Links.
     $this->drupalGet('node/' . $page->nid);
-    // Pick one of the links at random
+    // Pick one of the links at random.
     $test_link = array_rand($cart_links);
     $this->clickLink(t('Cart Link #@link', array('@link' => $test_link)));
     $this->assertText(
@@ -204,15 +204,15 @@ class UbercartCartLinksTestCase extends UbercartTestHelper {
       t('Cart Link product action message found.')
     );
 
-    // Empty cart (press remove button)
+    // Empty cart (press remove button).
     $this->drupalPost('cart', array(), t('Remove'));
     $this->assertText('There are no products in your shopping cart.');
 
-    // Turn off display of product action message
+    // Turn off display of product action message.
     $this->setCartLinksUIProductActionMessage(FALSE);
-    // Go to page with Cart Links
+    // Go to page with Cart Links.
     $this->drupalGet('node/' . $page->nid);
-    // Pick one of the links at random
+    // Pick one of the links at random.
     $test_link = array_rand($cart_links);
     $this->clickLink(t('Cart Link #@link', array('@link' => $test_link)));
     $this->assertNoText(
@@ -226,36 +226,36 @@ class UbercartCartLinksTestCase extends UbercartTestHelper {
   /**
    * Tests Cart Links cart empty action.
    */
-  function testCartLinksAllowEmptying() {
-    // Create product
+  public function testCartLinksAllowEmptying() {
+    // Create product.
     $products[] = $this->createCartLinksProduct(FALSE);
 
-    // Create a product class
+    // Create a product class.
     $products[] = $this->createCartLinksProduct(FALSE);  // later ...
 
-    // Create some valid Cart Links for these products
+    // Create some valid Cart Links for these products.
     $link_array = $this->createValidCartLinks($products);
     $cart_links = $link_array['links'];
     $link_data  = $link_array['data'];
 
-    // Create a page containing these links
+    // Create a page containing these links.
     $page = $this->createCartLinksPage($cart_links);
 
     $this->drupalLogin($this->adminUser);
 
     //
-    // Test empty cart action
+    // Test empty cart action.
     //
 
-    // Allow links to empty cart
+    // Allow links to empty cart.
     $this->setCartLinksUIAllowEmptying(TRUE);
-    // Go to page with Cart Links
+    // Go to page with Cart Links.
     $this->drupalGet('node/' . $page->nid);
-    // Pick one of the links at random and add it to the cart
+    // Pick one of the links at random and add it to the cart.
     $test_link_0 = array_rand($cart_links);
     $this->clickLink(t('Cart Link #@link', array('@link' => $test_link_0)));
 
-    // Pick another link at random and prepend an 'e-' so it will empty cart
+    // Pick another link at random and prepend an 'e-' so it will empty cart.
     $in_cart = $cart_links[$test_link_0];
     // (Don't want to use the same link.)
     unset($cart_links[$test_link_0]);
@@ -265,10 +265,10 @@ class UbercartCartLinksTestCase extends UbercartTestHelper {
       t('The current contents of your shopping cart will be lost. Are you sure you want to continue?'),
       t('Empty cart confirmation page found.')
     );
-    // Allow
+    // Allow.
     $this->drupalPost(NULL, array(), t('Confirm'));
 
-    // Verify the cart doesn't have the first item and does have the second item
+    // Verify the cart doesn't have the first item and does have the second item.
     $this->drupalGet('cart');
     $this->assertText(
       $link_data[$test_link]['title'],
@@ -279,13 +279,13 @@ class UbercartCartLinksTestCase extends UbercartTestHelper {
       t('Cart was emptied by Cart Link.')
     );
 
-    // Still have something ($test_link) in the cart
+    // Still have something ($test_link) in the cart.
 
-    // Forbid links to empty cart
+    // Forbid links to empty cart.
     $this->setCartLinksUIAllowEmptying(FALSE);
-    // Re-use $test_link_0 and prepend an 'e-' so it will (try to) empty cart
+    // Re-use $test_link_0 and prepend an 'e-' so it will (try to) empty cart.
     $this->drupalGet(str_replace('add/p', 'add/e-p', $in_cart));
-    // Verify the cart has both items - cart wasn't emptied
+    // Verify the cart has both items - cart wasn't emptied.
     $this->drupalGet('cart');
     $this->assertText(
       $link_data[$test_link_0]['title'],
@@ -302,52 +302,52 @@ class UbercartCartLinksTestCase extends UbercartTestHelper {
   /**
    * Tests Cart Links restrictions.
    */
-  function testCartLinksRestrictions() {
-    // Create product
+  public function testCartLinksRestrictions() {
+    // Create product.
     $products[] = $this->createCartLinksProduct(FALSE);
 
-    // Create a product class
+    // Create a product class.
     $products[] = $this->createCartLinksProduct(FALSE);  // later ...
 
-    // Create some valid Cart Links for these products
+    // Create some valid Cart Links for these products.
     $link_array = $this->createValidCartLinks($products);
     $cart_links = $link_array['links'];
     $link_data  = $link_array['data'];
 
-    // Create a page containing these links
+    // Create a page containing these links.
     $page = $this->createCartLinksPage($cart_links);
 
     $this->drupalLogin($this->adminUser);
 
     //
-    // Test Cart Links restrictions
+    // Test Cart Links restrictions.
     //
 
-    // Go to page with Cart Links
+    // Go to page with Cart Links.
     $this->drupalGet('node/' . $page->nid);
-    // Pick one of the links at random and restrict it
+    // Pick one of the links at random and restrict it.
     $test_link_0 = array_rand($cart_links);
     // Only this link is allowed - strip '/cart/add/' from beginning
     $this->setCartLinksUIRestrictions(substr($cart_links[$test_link_0], 10));
 
-    // Attempt to click link - should pass
+    // Attempt to click link - should pass.
     $this->drupalGet('node/' . $page->nid);
     $this->clickLink(t('Cart Link #@link', array('@link' => $test_link_0)));
 
     // Check for notice that item was added (this notice is set ON
-    // by default, see admin/store/settings/cart)
+    // by default, see admin/store/settings/cart).
     $this->assertText(
       t('@title added to your shopping cart.', array('@title' => $link_data[$test_link_0]['title'])),
       t('Product @title added to cart.', array('@title' => $link_data[$test_link_0]['title']))
     );
 
-    // Pick another link at random, as long as it is different from first
+    // Pick another link at random, as long as it is different from first.
     $in_cart = $cart_links[$test_link_0];
     unset($cart_links[$test_link_0]);
     $test_link = array_rand($cart_links);
 
-    // Attempt to click it
-    // It should fail and redirect to the home page (default)
+    // Attempt to click it.
+    // It should fail and redirect to the home page (default).
     $this->drupalGet('node/' . $page->nid);
     $this->clickLink(t('Cart Link #@link', array('@link' => $test_link)));
     $this->assertText(
@@ -358,7 +358,7 @@ class UbercartCartLinksTestCase extends UbercartTestHelper {
       t('Redirected to front page for link not in restrictions.')
     );
 
-    // Now create a special redirect page for bad links
+    // Now create a special redirect page for bad links.
     $redirect_page = $this->drupalCreateNode(
       array(
         'body' => array(
@@ -369,7 +369,7 @@ class UbercartCartLinksTestCase extends UbercartTestHelper {
       )
     );
 
-    // Set redirect link
+    // Set redirect link.
     $this->setCartLinksUIRedirect('node/' . $redirect_page->nid);
 
     // Attempt to click same restricted link as above.
@@ -381,7 +381,7 @@ class UbercartCartLinksTestCase extends UbercartTestHelper {
       t('Redirected to error page for link not in restrictions.')
     );
 
-    // Remove restrictions, try to add again - it should pass
+    // Remove restrictions, try to add again - it should pass.
     $this->setCartLinksUIRestrictions('');
     $this->drupalGet('node/' . $page->nid);
     $this->clickLink(t('Cart Link #@link', array('@link' => $test_link)));
@@ -413,26 +413,26 @@ class UbercartCartLinksTestCase extends UbercartTestHelper {
    *
    * For additional messages, add additional actions, e.g. "-m99-m1337".
    */
-  function testCartLinksMessages() {
+  public function testCartLinksMessages() {
 
-    // Create product
+    // Create product.
     $products[] = $this->createCartLinksProduct(FALSE);
 
-    // Create a product class
+    // Create a product class.
     $products[] = $this->createCartLinksProduct(FALSE);  // later ...
 
-    // Create some valid Cart Links for these products
+    // Create some valid Cart Links for these products.
     $link_array = $this->createValidCartLinks($products);
     $cart_links = $link_array['links'];
     $link_data  = $link_array['data'];
 
-    // Create a page containing these links
+    // Create a page containing these links.
     $page = $this->createCartLinksPage($cart_links);
 
-    // Need to be admin to define messages
+    // Need to be admin to define messages.
     $this->drupalLogin($this->adminUser);
 
-    // Define some messages
+    // Define some messages.
     $messages = array();
     for ($i = 0; $i < 15; $i++) {
       $key = mt_rand(1, 999);
@@ -441,13 +441,13 @@ class UbercartCartLinksTestCase extends UbercartTestHelper {
     $this->setCartLinksUIMessages($messages);
 
     //
-    // Test message display
+    // Test message display.
     //
 
-    // Go to page with Cart Links
+    // Go to page with Cart Links.
     $this->drupalGet('node/' . $page->nid);
 
-    // Pick one link at random and append an '-m<#>' to display a message
+    // Pick one link at random and append an '-m<#>' to display a message.
     $test_link = array_rand($cart_links);
     $message_key  = array_rand($messages);
     $message_text = explode('|', $messages[$message_key]);
@@ -457,7 +457,7 @@ class UbercartCartLinksTestCase extends UbercartTestHelper {
       t('Message @key displayed.', array('@key' => $message_key))
     );
 
-    // Empty cart (press remove button)
+    // Empty cart (press remove button).
     $this->drupalPost('cart', array(), t('Remove'));
     $this->assertText('There are no products in your shopping cart.');
 
@@ -467,50 +467,50 @@ class UbercartCartLinksTestCase extends UbercartTestHelper {
   /**
    * Tests Cart Links tracking.
    */
-  function testCartLinksTracking() {
+  public function testCartLinksTracking() {
 
-    // Create product
+    // Create product.
     $products[] = $this->createCartLinksProduct(FALSE);
 
-    // Create a product class
+    // Create a product class.
     $products[] = $this->createCartLinksProduct(FALSE);  // later ...
 
-    // Create some valid Cart Links for these products
+    // Create some valid Cart Links for these products.
     $link_array = $this->createValidCartLinks($products);
     $cart_links = $link_array['links'];
     $link_data  = $link_array['data'];
 
-    // Create a page containing these links
+    // Create a page containing these links.
     $page = $this->createCartLinksPage($cart_links);
 
     $this->drupalLogin($this->adminUser);
 
     //
-    // Test Cart Links tracking
+    // Test Cart Links tracking.
     //
 
-    // Go to page with Cart Links
+    // Go to page with Cart Links.
     $this->drupalGet('node/' . $page->nid);
 
-    // Create three tracking IDs
+    // Create three tracking IDs.
     $tracking = array();
     for ($i = 0; $i < 3; $i++) {
       $tracking[$this->randomName(16)] = 0;
     }
 
-    // Click a number of links to create some statistics
+    // Click a number of links to create some statistics.
     for ($i = 0; $i < 50; $i++) {
-      // Pick one link at random and append an '-i<tracking ID>'
+      // Pick one link at random and append an '-i<tracking ID>'.
       $test_link = array_rand($cart_links);
 
-      // Assign one of the tracking IDs
+      // Assign one of the tracking IDs.
       $tracking_id = array_rand($tracking);
       $this->drupalGet($cart_links[$test_link] . '-i' . $tracking_id);
-      // Keep a record of how many links were assigned this key
+      // Keep a record of how many links were assigned this key.
       $tracking[$tracking_id] += 1;
     }
 
-    // Check report to see these clicks have been recorded correctly
+    // Check report to see these clicks have been recorded correctly.
     $this->drupalGet('admin/store/reports/cart-links');
     $total = 0;
     foreach ($tracking as $id => $clicks) {
@@ -538,7 +538,7 @@ class UbercartCartLinksTestCase extends UbercartTestHelper {
    *   TRUE to display product action messages, FALSE to not display.
    *   Defaults to FALSE.
    */
-  function setCartLinksUIProductActionMessage($state = FALSE) {
+  protected function setCartLinksUIProductActionMessage($state = FALSE) {
     $this->drupalPost(
       'admin/store/settings/cart-links',
       array('uc_cart_links_add_show' => $state),
@@ -560,7 +560,7 @@ class UbercartCartLinksTestCase extends UbercartTestHelper {
    *   TRUE to display product action messages, FALSE to not display.
    *   Defaults to TRUE.
    */
-  function setCartLinksUITrackClicks($state = TRUE) {
+  protected function setCartLinksUITrackClicks($state = TRUE) {
     $this->drupalPost(
       'admin/store/settings/cart-links',
       array('uc_cart_links_track' => 0),
@@ -582,7 +582,7 @@ class UbercartCartLinksTestCase extends UbercartTestHelper {
    *   TRUE to display product action messages, FALSE to not display.
    *   Defaults to TRUE.
    */
-  function setCartLinksUIAllowEmptying($state = TRUE) {
+  protected function setCartLinksUIAllowEmptying($state = TRUE) {
     $this->drupalPost(
       'admin/store/settings/cart-links',
       array('uc_cart_links_empty' => $state),
@@ -604,7 +604,7 @@ class UbercartCartLinksTestCase extends UbercartTestHelper {
    *   String containing user input from a textarea, one message per line.
    *   Messages have numeric key and text value, separated by '|'.
    */
-  function setCartLinksUIMessages($messages = '') {
+  protected function setCartLinksUIMessages($messages = '') {
     $message_string = implode("\n", $messages);
     $this->drupalPost(
       'admin/store/settings/cart-links',
@@ -627,7 +627,7 @@ class UbercartCartLinksTestCase extends UbercartTestHelper {
    *   String containing user input from a textarea, one restriction per line.
    *   Restrictions are valid Cart Links - i.e. relative URLs.
    */
-  function setCartLinksUIRestrictions($restrictions = '') {
+  protected function setCartLinksUIRestrictions($restrictions = '') {
     $this->drupalPost(
       'admin/store/settings/cart-links',
       array('uc_cart_links_restrictions' => $restrictions),
@@ -648,7 +648,7 @@ class UbercartCartLinksTestCase extends UbercartTestHelper {
    * @param $url
    *   Relative URL of the destination page for the redirect.  Omit leading '/'.
    */
-  function setCartLinksUIRedirect($url = '') {
+  protected function setCartLinksUIRedirect($url = '') {
     $this->drupalPost(
       'admin/store/settings/cart-links',
       array('uc_cart_links_invalid_page' => $url),
@@ -667,7 +667,7 @@ class UbercartCartLinksTestCase extends UbercartTestHelper {
    * @param $links
    *   Array of Cart Links to appear on page.
    */
-  public function createCartLinksPage($links = array()) {
+  protected function createCartLinksPage($links = array()) {
     if (!empty($links)) {
       $i = 0;
       foreach ($links as $link) {
@@ -698,9 +698,9 @@ class UbercartCartLinksTestCase extends UbercartTestHelper {
    *   Defaults to FALSE to create a normal product, set to TRUE to
    *   create a product class instead.
    */
-  public function createCartLinksProduct($product_class = FALSE) {
+  protected function createCartLinksProduct($product_class = FALSE) {
 
-    // Create a product
+    // Create a product.
     if ($product_class) {
       $product = $this->createProductClass();
     }
@@ -708,7 +708,7 @@ class UbercartCartLinksTestCase extends UbercartTestHelper {
       $product = $this->createProduct();
     }
 
-    // Create some attributes
+    // Create some attributes.
     for ($i = 0; $i < 5; $i++) {
       $attribute = UbercartAttributeTestCase::createAttribute();
       $attributes[$attribute->aid] = $attribute;
@@ -739,8 +739,8 @@ class UbercartCartLinksTestCase extends UbercartTestHelper {
     // Load the attributes back.
     $loaded_attributes = uc_attribute_load_multiple($aids);
 
-      // TODO: add attributes of all 4 types
-      // TODO: create both required and not required attributes
+      // TODO: add attributes of all 4 types.
+      // TODO: create both required and not required attributes.
 
     // Add the selected attributes to the product.
     foreach ($loaded_attributes as $loaded_attribute) {
@@ -750,7 +750,6 @@ class UbercartCartLinksTestCase extends UbercartTestHelper {
     return $product;
   }
 
-
   /**
    * Creates Cart Links pointing to the given product(s).
    *
@@ -770,7 +769,7 @@ class UbercartCartLinksTestCase extends UbercartTestHelper {
    * @return
    *   Array containing Cart Links and link metadata.
    */
-  function createValidCartLinks($products = array()) {
+  protected function createValidCartLinks($products = array()) {
     foreach ($products as $key => $product) {
       $nid   = $product->nid;
       $title = $product->title;
@@ -789,7 +788,7 @@ class UbercartCartLinksTestCase extends UbercartTestHelper {
       // $cart_links and $link_data share the same keys.
       $cart_links[$key] = '/cart/add/p' . $nid . '_q' . $qty;
 
-      // Loop over attributes, append all attribute/option combos to links
+      // Loop over attributes, append all attribute/option combos to links.
       $attributes = uc_product_get_attributes($nid);
       foreach ($attributes as $attribute) {
         // If this is textfield, radio, or select option, then
@@ -800,12 +799,14 @@ class UbercartCartLinksTestCase extends UbercartTestHelper {
             $link_data[$key]['attributes'][$attribute->label][] = $value;
             $cart_links[$key] .= '_a' . $attribute->aid . 'o' . $value;
             break;
+
           case 1:  // select
           case 2:  // radios
             $option = $attribute->options[array_rand($attribute->options)];
             $link_data[$key]['attributes'][$attribute->label][] = $option->name;
             $cart_links[$key] .= '_a' . $attribute->aid . 'o' . $option->oid;
             break;
+
           case 3:  // checkboxes
             foreach ($attribute->options as $option) {
               $link_data[$key]['attributes'][$attribute->label][] = $option->name;

+ 3 - 4
sites/all/modules/contrib/ecommerce/ubercart/uc_cart_links/uc_cart_links.info

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

Some files were not shown because too many files changed in this diff