Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The argument description for views_handler_field::add_additional_fields() states that:
The key is an identifier used to later find the field alias used.
This is only true if the passed $info is an array. When $info is a string, the field name is used instead.
Example for correct behavior:
$this->add_additional_fields(array(
'langcode' => array('field' => 'language'),
));
$this->aliases
now contains a key "langcode" with the field alias.
Example for wrong behavior:
$this->add_additional_fields(array(
'langcode' => 'language',
));
$this->aliases
now contains a key "language" with the field alias.
Comments
Comment #2
ciss CreditAttribution: ciss at yousign GmbH commentedComment #3
ciss CreditAttribution: ciss at yousign GmbH commentedIt looks like the same bug made it into Drupal 8: https://github.com/drupal/drupal/blob/dba4fcf36a0963831e775e71ac8626425e...