Commit 55707edb authored by alexpott's avatar alexpott

Issue #2737607 by generalredneck: Migration Source Plugins are not extendable...

Issue #2737607 by generalredneck: Migration Source Plugins are not extendable because of ambiguous database field names
parent cf1a9f8a
......@@ -229,10 +229,8 @@ protected function doGenerate(array $variables, array $defaults, array $tokens,
// Add a query string if needed, including extra parameters.
$query_params += array_diff_key($parameters, $variables, $defaults);
if ($query_params && $query = http_build_query($query_params, '', '&')) {
// "/" and "?" can be left decoded for better user experience, see
// http://tools.ietf.org/html/rfc3986#section-3.4
$url .= '?' . strtr($query, array('%2F' => '/'));
if ($query_params && $query = UrlHelper::buildQuery($query_params)) {
$url .= '?' . $query;
}
return $url;
......
......@@ -20,7 +20,7 @@ class AggregatorItem extends DrupalSqlBase {
public function query() {
return $this->select('aggregator_item', 'ai')
->fields('ai')
->orderBy('iid');
->orderBy('ai.iid');
}
/**
......
......@@ -19,7 +19,7 @@ class Box extends DrupalSqlBase {
public function query() {
$query = $this->select('boxes', 'b')
->fields('b', array('bid', 'body', 'info', 'format'));
$query->orderBy('bid');
$query->orderBy('b.bid');
return $query;
}
......
......@@ -23,7 +23,7 @@ public function query() {
for ($i = 1; $i <= 9; $i++) {
$field = "p$i";
$ml_fields[] = $field;
$query->orderBy($field);
$query->orderBy('ml.' . $field);
}
$query->fields('ml', $ml_fields);
return $query;
......
......@@ -30,7 +30,7 @@ public function query() {
return $this->select('field_config_instance', 'fci')
->distinct()
->fields('fci', array('bundle'))
->condition('entity_type', 'comment');
->condition('fci.entity_type', 'comment');
}
/**
......
......@@ -29,7 +29,7 @@ public function query() {
'selected',
)
);
$query->orderBy('cid');
$query->orderBy('c.cid');
return $query;
}
......
......@@ -18,7 +18,7 @@ class ContactSettings extends Variable {
protected function initializeIterator() {
$default_category = $this->select('contact', 'c')
->fields('c', ['cid'])
->condition('selected', 1)
->condition('c.selected', 1)
->execute()
->fetchField();
return new \ArrayIterator([$this->values() + ['default_category' => $default_category]]);
......
......@@ -62,7 +62,7 @@ public function query() {
'module',
));
$query->join('content_node_field', 'cnf', 'cnfi.field_name = cnf.field_name');
$query->orderBy('weight');
$query->orderBy('cnfi.weight');
return $query;
}
......
......@@ -65,7 +65,7 @@ public function query() {
'module',
));
$query->join('content_node_field', 'cnf', 'cnfi.field_name = cnf.field_name');
$query->orderBy('weight');
$query->orderBy('cnfi.weight');
return $query;
}
......
......@@ -31,10 +31,10 @@ public function query() {
// Optionally filter by entity type and bundle.
if (isset($this->configuration['entity_type'])) {
$query->condition('entity_type', $this->configuration['entity_type']);
$query->condition('fci.entity_type', $this->configuration['entity_type']);
if (isset($this->configuration['bundle'])) {
$query->condition('bundle', $this->configuration['bundle']);
$query->condition('fci.bundle', $this->configuration['bundle']);
}
}
......
......@@ -45,7 +45,7 @@ public function query() {
// If two or more files have the same timestamp, they'll end up in a
// non-deterministic order. Ordering by fid (or any other unique field)
// will prevent this.
->orderBy('fid');
->orderBy('f.fid');
}
/**
......
......@@ -33,7 +33,7 @@ protected function initializeIterator() {
$return = array();
$values = $this->select('variable', 'v')
->fields('v', ['name', 'value'])
->condition('name', $variables, 'IN')
->condition('v.name', $variables, 'IN')
->execute()
->fetchAllKeyed();
foreach ($node_types as $node_type) {
......
......@@ -42,7 +42,7 @@ class File extends DrupalSqlBase {
public function query() {
$query = $this->select('file_managed', 'f')
->fields('f')
->orderBy('timestamp');
->orderBy('f.timestamp');
// Filter by scheme(s), if configured.
if (isset($this->configuration['scheme'])) {
......
......@@ -67,7 +67,7 @@ public function query() {
$query->innerJoin('node', 'n', static::JOIN);
if (isset($this->configuration['node_type'])) {
$query->condition('type', $this->configuration['node_type']);
$query->condition('n.type', $this->configuration['node_type']);
}
return $query;
......
......@@ -50,7 +50,7 @@ public function query() {
$query->innerJoin('node', 'n', static::JOIN);
if (isset($this->configuration['node_type'])) {
$query->condition('type', $this->configuration['node_type']);
$query->condition('n.type', $this->configuration['node_type']);
}
return $query;
......
......@@ -22,7 +22,7 @@ public function query() {
->fields('ml', array('mlid', 'menu_name', 'link_path', 'link_title', 'weight'))
->condition('hidden', '0')
->condition('menu_name', 'shortcut-set-%', 'LIKE')
->orderBy('mlid');
->orderBy('ml.mlid');
}
/**
......
......@@ -47,10 +47,10 @@ public function query() {
$query = $this->select($this->termDataTable, 'td')
->fields('td')
->distinct()
->orderBy('tid');
->orderBy('td.tid');
if (isset($this->configuration['vocabulary'])) {
$query->condition('vid', $this->configuration['vocabulary'], 'IN');
$query->condition('td.vid', $this->configuration['vocabulary'], 'IN');
}
return $query;
......
......@@ -27,7 +27,7 @@ class Role extends DrupalSqlBase {
public function query() {
$query = $this->select('role', 'r')
->fields('r', array('rid', 'name'))
->orderBy('rid');
->orderBy('r.rid');
return $query;
}
......
......@@ -20,7 +20,7 @@ class User extends DrupalSqlBase {
public function query() {
return $this->select('users', 'u')
->fields('u', array_keys($this->baseFields()))
->condition('uid', 0, '>');
->condition('u.uid', 0, '>');
}
/**
......
......@@ -22,7 +22,7 @@ public function query() {
$query = $this->select('users', 'u')
->condition('picture', '', '<>')
->fields('u', array('uid', 'access', 'picture'))
->orderBy('access');
->orderBy('u.access');
return $query;
}
......
......@@ -33,7 +33,7 @@ class UserPictureFile extends DrupalSqlBase {
*/
public function query() {
$query = $this->select('users', 'u')
->condition('picture', '', '<>')
->condition('u.picture', '', '<>')
->fields('u', array('uid', 'picture'));
return $query;
}
......
......@@ -20,7 +20,7 @@ class User extends FieldableEntity {
public function query() {
return $this->select('users', 'u')
->fields('u')
->condition('uid', 0, '>');
->condition('u.uid', 0, '>');
}
/**
......
......@@ -300,7 +300,7 @@ public function testAliasGenerationWithParameters() {
// No cacheability to test; UrlGenerator::generate() doesn't support
// collecting cacheability metadata.
$this->routeProcessorManager->expects($this->exactly(7))
$this->routeProcessorManager->expects($this->any())
->method('processOutbound')
->with($this->anything());
......@@ -316,6 +316,10 @@ public function testAliasGenerationWithParameters() {
$path = $this->generator->getPathFromRoute('test_2', array('narf' => '5'));
$this->assertEquals('test/two/5', $path);
// Specify a query parameter with NULL.
$options = ['query' => ['page' => NULL], 'fragment' => 'bottom'];
$this->assertGenerateFromRoute('test_2', ['narf' => 5], $options, '/goodbye/cruel/world?page#bottom', (new BubbleableMetadata())->setCacheMaxAge(Cache::PERMANENT));
}
/**
......
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