Unverified Commit 3663cc5b authored by alexpott's avatar alexpott
Browse files

Issue #3221933 by marcoscano, alexpott, owenbush: PHP Notice when using...

Issue #3221933 by marcoscano, alexpott, owenbush: PHP Notice when using "left_formula" in views join

(cherry picked from commit 0926b0cc)
parent da276a38
...@@ -266,7 +266,11 @@ public function __construct(array $configuration, $plugin_id, $plugin_definition ...@@ -266,7 +266,11 @@ public function __construct(array $configuration, $plugin_id, $plugin_definition
} }
$this->leftTable = $configuration['left_table']; $this->leftTable = $configuration['left_table'];
$this->leftField = $configuration['left_field'];
if (!empty($configuration['left_field'])) {
$this->leftField = $configuration['left_field'];
}
$this->field = $configuration['field']; $this->field = $configuration['field'];
if (!empty($configuration['left_formula'])) { if (!empty($configuration['left_formula'])) {
......
...@@ -205,6 +205,8 @@ public function testBasePlugin() { ...@@ -205,6 +205,8 @@ public function testBasePlugin() {
// Test that joins using 'left_formula' are properly built. // Test that joins using 'left_formula' are properly built.
$configuration['left_formula'] = 'MAX(views_test_data.uid)'; $configuration['left_formula'] = 'MAX(views_test_data.uid)';
// When 'left_formula' is present, 'left_field' is no longer required.
unset($configuration['left_field']);
$join = $this->manager->createInstance('standard', $configuration); $join = $this->manager->createInstance('standard', $configuration);
$table = ['alias' => 'users6']; $table = ['alias' => 'users6'];
$join->buildJoin($query, $table, $view->query); $join->buildJoin($query, $table, $view->query);
......
Markdown is supported
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