Problem/Motivation

This is hardcoded in FieldPluginBase, which is used for standard

    // Add the field.
    $params = $this->options['group_type'] != 'group' ? ['function' => $this->options['group_type']] : [];
    $this->field_alias = $this->query->addField($this->tableAlias, $this->realField, NULL, $params);

We need \Drupal\views_remote_data\Plugin\views\query\RemoteDataQuery::addField to support a null alias since it's hardcoded for this plugin.

  public function addField(string $table, string $field, string $alias = '', array $params = []): string {
    return $field;
  }

Steps to reproduce

Use a standard plugin:

  $data['foobar']['filename'] = [
    'title' => t('Filename'),
    'help' => t('The filename'),
    'field' => [
      'id' => 'standard',
    ],
  ];

Proposed resolution

Use ?string = ''

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mglaman created an issue. See original summary.

mglaman’s picture

Status: Active » Needs review

  • mglaman committed caa5370 on 1.0.x
    Issue #3278393 by mglaman: Argument #3 ($alias) must be of type string,...
mglaman’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.