Issue #2737607 by generalredneck: Migration Source Plugins are not extendable because of ambiguous database field names
parent
cf1a9f8a4c
commit
55707edb94
|
@ -229,10 +229,8 @@ class UrlGenerator implements UrlGeneratorInterface {
|
|||
|
||||
// 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 @@ class Book extends DrupalSqlBase {
|
|||
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 @@ class CommentType extends DrupalSqlBase {
|
|||
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 @@ class ContactCategory extends DrupalSqlBase {
|
|||
'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 @@ class FieldInstancePerFormDisplay extends DrupalSqlBase {
|
|||
'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 @@ class FieldInstancePerViewMode extends ViewModeBase {
|
|||
'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 @@ class FieldInstance extends DrupalSqlBase {
|
|||
|
||||
// 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 @@ class File extends DrupalSqlBase {
|
|||
// 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 @@ class UploadInstance extends DrupalSqlBase {
|
|||
$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 @@ class Node extends DrupalSqlBase {
|
|||
$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 @@ class Node extends FieldableEntity {
|
|||
$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 @@ class Shortcut extends DrupalSqlBase {
|
|||
->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 @@ class Term extends DrupalSqlBase {
|
|||
$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 @@ class UserPicture extends DrupalSqlBase {
|
|||
$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 @@ class UrlGeneratorTest extends UnitTestCase {
|
|||
// 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 @@ class UrlGeneratorTest extends UnitTestCase {
|
|||
|
||||
$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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue