Commit c62be3be authored by DamienMcKenna's avatar DamienMcKenna

Issue #3039953 by joelpittet, dromansab, awasson, joseph.olstad, darkodev,...

Issue #3039953 by joelpittet, dromansab, awasson, joseph.olstad, darkodev, TheWrench: PHP 5.3.x fix for syntax changes Views 3.21.
parent e234a488
...@@ -1000,20 +1000,20 @@ class views_many_to_one_helper { ...@@ -1000,20 +1000,20 @@ class views_many_to_one_helper {
// We do one join per selected value. // We do one join per selected value.
// Clone the join for each table: // Clone the join for each table:
$this->handler->table_aliases = []; $this->handler->table_aliases = array();
foreach ($this->handler->value as $value) { foreach ($this->handler->value as $value) {
$join = $this->get_join(); $join = $this->get_join();
if ($this->handler->operator == 'and') { if ($this->handler->operator == 'and') {
$join->type = 'INNER'; $join->type = 'INNER';
} }
if (empty($join->extra)) { if (empty($join->extra)) {
$join->extra = []; $join->extra = array();
} }
$join->extra[] = [ $join->extra[] = array(
'field' => $this->handler->real_field, 'field' => $this->handler->real_field,
'value' => $value, 'value' => $value,
'numeric' => !empty($this->handler->definition['numeric']), 'numeric' => !empty($this->handler->definition['numeric']),
]; );
// The table alias needs to be unique to this value across the // The table alias needs to be unique to this value across the
// multiple times the filter or argument is called by the view. // multiple times the filter or argument is called by the view.
if (!isset($this->handler->view->many_to_one_aliases[$field][$value])) { if (!isset($this->handler->view->many_to_one_aliases[$field][$value])) {
......
...@@ -60,8 +60,8 @@ class ViewsHandlerFilterTest extends ViewsSqlTest { ...@@ -60,8 +60,8 @@ class ViewsHandlerFilterTest extends ViewsSqlTest {
$node1 = $this->drupalCreateNode(array('type' => 'article','field_tags_tid' => $term->tid, 'created' => REQUEST_TIME)); $node1 = $this->drupalCreateNode(array('type' => 'article','field_tags_tid' => $term->tid, 'created' => REQUEST_TIME));
$node2 = $this->drupalCreateNode(array('type' => 'article', 'created' => REQUEST_TIME + 1)); $node2 = $this->drupalCreateNode(array('type' => 'article', 'created' => REQUEST_TIME + 1));
$user2 = $this->drupalCreateUser(array('access content')); $user2 = $this->drupalCreateUser(array('access content'));
// $this->drupalLogin($this->drupalCreateUser(['administer users']); // $this->drupalLogin($this->drupalCreateUser(array('administer users'));
$this->drupalLogin($this->drupalCreateUser(['administer users', 'access administration pages', 'administer site configuration', 'administer nodes', 'bypass node access'])); $this->drupalLogin($this->drupalCreateUser(array('administer users', 'access administration pages', 'administer site configuration', 'administer nodes', 'bypass node access')));
$this->drupalGet('node/1/edit'); $this->drupalGet('node/1/edit');
$edit['field_tags' . '[' . LANGUAGE_NONE . ']'] = $term->name; $edit['field_tags' . '[' . LANGUAGE_NONE . ']'] = $term->name;
......
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