Commit c8d86baa authored by webchick's avatar webchick
Browse files

Issue #2072603 by legolasbo: Remove Unused local variable from...

Issue #2072603 by legolasbo: Remove Unused local variable  from /core/modules/views/lib/Drupal/views/Plugin/views/query/Sql.php.
parent df833f06
...@@ -1028,7 +1028,7 @@ protected function buildCondition($where = 'where') { ...@@ -1028,7 +1028,7 @@ protected function buildCondition($where = 'where') {
if (!empty($info['conditions'])) { if (!empty($info['conditions'])) {
$sub_group = $info['type'] == 'OR' ? db_or() : db_and(); $sub_group = $info['type'] == 'OR' ? db_or() : db_and();
foreach ($info['conditions'] as $key => $clause) { foreach ($info['conditions'] as $clause) {
// DBTNG doesn't support to add the same subquery twice to the main // DBTNG doesn't support to add the same subquery twice to the main
// query and the count query, so clone the subquery to have two instances // query and the count query, so clone the subquery to have two instances
// of the same object. - http://drupal.org/node/1112854 // of the same object. - http://drupal.org/node/1112854
...@@ -1227,9 +1227,6 @@ public function query($get_count = FALSE) { ...@@ -1227,9 +1227,6 @@ public function query($get_count = FALSE) {
$query->distinct(); $query->distinct();
} }
$joins = $where = $having = $orderby = $groupby = '';
$fields = $distinct = array();
// Add all the tables to the query via joins. We assume all LEFT joins. // Add all the tables to the query via joins. We assume all LEFT joins.
foreach ($this->table_queue as $table) { foreach ($this->table_queue as $table) {
if (is_object($table['join'])) { if (is_object($table['join'])) {
...@@ -1321,10 +1318,10 @@ public function query($get_count = FALSE) { ...@@ -1321,10 +1318,10 @@ public function query($get_count = FALSE) {
*/ */
public function getWhereArgs() { public function getWhereArgs() {
$args = array(); $args = array();
foreach ($this->where as $group => $where) { foreach ($this->where as $where) {
$args = array_merge($args, $where['args']); $args = array_merge($args, $where['args']);
} }
foreach ($this->having as $group => $having) { foreach ($this->having as $having) {
$args = array_merge($args, $having['args']); $args = array_merge($args, $having['args']);
} }
return $args; return $args;
...@@ -1366,7 +1363,6 @@ function build(ViewExecutable $view) { ...@@ -1366,7 +1363,6 @@ function build(ViewExecutable $view) {
* $view->current_page. * $view->current_page.
*/ */
function execute(ViewExecutable $view) { function execute(ViewExecutable $view) {
$external = FALSE; // Whether this query will run against an external database.
$query = $view->build_info['query']; $query = $view->build_info['query'];
$count_query = $view->build_info['count_query']; $count_query = $view->build_info['count_query'];
...@@ -1382,7 +1378,6 @@ function execute(ViewExecutable $view) { ...@@ -1382,7 +1378,6 @@ function execute(ViewExecutable $view) {
} }
} }
$items = array();
if ($query) { if ($query) {
$additional_arguments = \Drupal::moduleHandler()->invokeAll('views_query_substitutions', array($view)); $additional_arguments = \Drupal::moduleHandler()->invokeAll('views_query_substitutions', array($view));
...@@ -1542,7 +1537,7 @@ function loadEntities(&$results) { ...@@ -1542,7 +1537,7 @@ function loadEntities(&$results) {
// Drupal core currently has no way to load multiple revisions. Sad. // Drupal core currently has no way to load multiple revisions. Sad.
if ($table['revision']) { if ($table['revision']) {
$entities = array(); $entities = array();
foreach ($ids as $index => $revision_id) { foreach ($ids as $revision_id) {
$entity = entity_revision_load($entity_type, $revision_id); $entity = entity_revision_load($entity_type, $revision_id);
if ($entity) { if ($entity) {
$entities[$revision_id] = $entity; $entities[$revision_id] = $entity;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment