Commit 0c20eced authored by Tim Rohaly's avatar Tim Rohaly
Browse files

Core issue #2446615: #theme=>status_messages is now #type=>status_messages.

parent 3233d3ba
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -115,7 +115,7 @@ function uc_order_pane_payment($op, $order, &$form = NULL, FormStateInterface $f
function uc_payment_order_pane_ajax_callback($form, FormStateInterface $form_state) {
  $response = new AjaxResponse();
  $response->addCommand(new ReplaceCommand('#payment-details', trim(drupal_render($form['payment']['payment_details']))));
  $status_messages = array('#theme' => 'status_messages');
  $status_messages = array('#type' => 'status_messages');
  $response->addCommand(new PrependCommand('#payment-details', drupal_render($status_messages)));

  return $response;
+2 −2
Original line number Diff line number Diff line
@@ -835,7 +835,7 @@ function uc_quote_build_quote_form($order, $show_errors = TRUE) {
function uc_quote_cart_returned_rates($form, $form_state) {
  $response = new AjaxResponse();
  $response->addCommand(new ReplaceCommand('#quote', trim(drupal_render($form['quote']))));
  $status_messages = array('#theme' => 'status_messages');
  $status_messages = array('#type' => 'status_messages');
  $response->addCommand(new PrependCommand('#quote', drupal_render($status_messages)));

  return $response;
@@ -885,7 +885,7 @@ function uc_quote_order_update_rates($form, FormStateInterface $form_state) {

  // Reset shipping form.
  $response->addCommand(new ReplaceCommand('#quote', trim(drupal_render($form['quotes']['quotes']))));
  $status_messages = array('#theme' => 'status_messages');
  $status_messages = array('#type' => 'status_messages');
  $response->addCommand(new PrependCommand('#quote', drupal_render($status_messages)));

  return $response;
+10 −10
Original line number Diff line number Diff line
@@ -267,7 +267,7 @@ function uc_attribute_node_update_index($node) {
    $output .= "\n";
  }

  $result = db_query("SELECT model FROM {uc_product_adjustments} WHERE nid = :nid", array(':nid' => $node->id()));
  $result = db_query("SELECT model FROM {uc_product_adjustments} WHERE nid = :nid", [':nid' => $node->id()]);
  while ($model = $result->fetchField()) {
    $output .= '<h2>' . $model . "</h2>\n";
  }
@@ -280,7 +280,7 @@ function uc_attribute_node_update_index($node) {
 */
function uc_attribute_uc_product_models($nid) {
  // Get all the SKUs for all the attributes on this node.
  $models = db_query("SELECT DISTINCT model FROM {uc_product_adjustments} WHERE nid = :nid", array(':nid' => $nid))->fetchCol();
  $models = db_query("SELECT DISTINCT model FROM {uc_product_adjustments} WHERE nid = :nid", [':nid' => $nid])->fetchCol();

  return $models;
}
@@ -354,7 +354,7 @@ function uc_attribute_uc_product_alter(&$node) {
    }
    ksort($combination);

    $model = db_query("SELECT model FROM {uc_product_adjustments} WHERE nid = :nid AND combination LIKE :combo", array(':nid' => $node->id(), ':combo' => serialize($combination)))->fetchField();
    $model = db_query("SELECT model FROM {uc_product_adjustments} WHERE nid = :nid AND combination LIKE :combo", [':nid' => $node->id(), ':combo' => serialize($combination)])->fetchField();

    if (!empty($model)) {
      $node->model = $model;
@@ -532,8 +532,8 @@ function uc_attribute_load($aid, $id = NULL, $type = '') {
    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));
      $attribute = db_query("SELECT * FROM {uc_attributes} WHERE aid = :aid", [':aid' => $aid])->fetchObject();
      $result = db_query("SELECT * FROM {uc_attribute_options} WHERE aid = :aid ORDER BY ordering, name", [':aid' => $aid]);

      // Don't try to build it further if it failed already.
      if (!$attribute) {
@@ -639,7 +639,7 @@ function uc_attribute_delete($aid) {
 *   The attribute option object.
 */
function uc_attribute_option_load($oid) {
  return db_query("SELECT * FROM {uc_attribute_options} WHERE oid = :oid", array(':oid' => $oid))->fetchObject();
  return db_query("SELECT * FROM {uc_attribute_options} WHERE oid = :oid", [':oid' => $oid])->fetchObject();
}

/**
@@ -1002,7 +1002,7 @@ function uc_attribute_type_info($type) {
function uc_product_get_attributes($nid) {
  $attributes = array();

  $result = db_query("SELECT upa.aid FROM {uc_product_attributes} upa LEFT JOIN {uc_attributes} ua ON upa.aid = ua.aid WHERE upa.nid = :nid ORDER BY upa.ordering, ua.name", array(':nid' => $nid));
  $result = db_query("SELECT upa.aid FROM {uc_product_attributes} upa LEFT JOIN {uc_attributes} ua ON upa.aid = ua.aid WHERE upa.nid = :nid ORDER BY upa.ordering, ua.name", [':nid' => $nid]);
  foreach ($result as $attribute) {
    $attributes[$attribute->aid] = uc_attribute_load($attribute->aid, $nid, 'product');
  }
@@ -1016,7 +1016,7 @@ function uc_product_get_attributes($nid) {
function uc_class_get_attributes($pcid) {
  $attributes = array();

  $result = db_query("SELECT uca.aid FROM {uc_class_attributes} uca LEFT JOIN {uc_attributes} ua ON uca.aid = ua.aid WHERE uca.pcid = :type ORDER BY uca.ordering, ua.name", array(':type' => $pcid));
  $result = db_query("SELECT uca.aid FROM {uc_class_attributes} uca LEFT JOIN {uc_attributes} ua ON uca.aid = ua.aid WHERE uca.pcid = :type ORDER BY uca.ordering, ua.name", [':type' => $pcid]);
  foreach ($result as $attribute) {
    $attributes[$attribute->aid] = uc_attribute_load($attribute->aid, $pcid, 'class');
  }
@@ -1101,7 +1101,7 @@ function uc_attribute_option_ajax($form, FormStateInterface $form_state) {
  if (strpos($form['#form_id'], 'add_to_cart_form') !== FALSE) {
    uc_product_view_ajax_commands($response, $form_state, array('display_price', 'weight', 'cost'));
  }
  $status_messages = array('#theme' => 'status_messages');
  $status_messages = array('#type' => 'status_messages');
  $response->addCommand(new PrependCommand($wrapper, drupal_render($status_messages)));
  return $response;
}
@@ -1309,7 +1309,7 @@ function _uc_attribute_display_types() {
 *   Array of attribute ids that have price affecting options.
 */
function uc_attribute_priced_attributes($nid) {
  $aids = db_query("SELECT DISTINCT (pa.aid) FROM {uc_product_attributes} pa INNER JOIN {uc_attribute_options} ao ON ao.aid = pa.aid INNER JOIN {uc_product_options} po ON (po.oid = ao.oid AND po.nid = pa.nid) WHERE pa.nid = :nid AND po.price <> :price AND pa.display <> :display", array(':nid' => $nid, ':price' => 0, ':display' => 0))->fetchCol();
  $aids = db_query("SELECT DISTINCT (pa.aid) FROM {uc_product_attributes} pa INNER JOIN {uc_attribute_options} ao ON ao.aid = pa.aid INNER JOIN {uc_product_options} po ON (po.oid = ao.oid AND po.nid = pa.nid) WHERE pa.nid = :nid AND po.price <> :price AND pa.display <> :display", [':nid' => $nid, ':price' => 0, ':display' => 0])->fetchCol();

  return $aids;
}
+2 −2
Original line number Diff line number Diff line
@@ -688,7 +688,7 @@ function uc_order_edit_products_remove($form, FormStateInterface $form_state) {
function uc_order_pane_products_ajax_callback($form, FormStateInterface $form_state) {
  $response = new AjaxResponse();
  $response->addCommand(new ReplaceCommand('#product-controls', trim(drupal_render($form['product_controls']))));
  $status_messages = array('#theme' => 'status_messages');
  $status_messages = array('#type' => 'status_messages');
  $response->addCommand(new PrependCommand('#product-controls', drupal_render($status_messages)));

  if ($form_state->get('refresh_products')) {
@@ -927,7 +927,7 @@ function uc_order_pane_line_items_remove($form, FormStateInterface $form_state)
function uc_order_pane_line_items_update($form, FormStateInterface $form_state) {
  $response = new AjaxResponse();
  $response->addCommand(new ReplaceCommand('#order-line-items', trim(drupal_render($form['line_items']))));
  $status_messages = array('#theme' => 'status_messages');
  $status_messages = array('#type' => 'status_messages');
  $response->addCommand(new PrependCommand('#order-line-items', drupal_render($status_messages)));

  return $response;
+1 −1
Original line number Diff line number Diff line
@@ -175,7 +175,7 @@ function uc_ajax_multiplex($form, FormStateInterface $form_state) {
          // Otherwise, assume the callback returned a string or render-array, and insert it into the wrapper.
          $html = is_string($result) ? $result : drupal_render($result);
          $response->addCommand(new ReplaceCommand('#' . $wrapper, trim($html)));
          $status_messages = array('#theme' => 'status_messages');
          $status_messages = array('#type' => 'status_messages');
          $response->addCommand(new PrependCommand('#' . $wrapper, drupal_render($status_messages)));
        }
      }