Unverified Commit e41394ec authored by larowlan's avatar larowlan
Browse files

Issue #2935654 by longwave, hctom: Use of undefined $languages variable in...

Issue #2935654 by longwave, hctom: Use of undefined $languages variable in NodeListBuilder::buildRow()
parent 02e787a5
......@@ -7,7 +7,6 @@
use Drupal\Core\Entity\EntityListBuilder;
use Drupal\Core\Entity\EntityStorageInterface;
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Language\LanguageInterface;
use Drupal\Core\Routing\RedirectDestinationInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
......@@ -95,16 +94,11 @@ public function buildRow(EntityInterface $entity) {
'#theme' => 'mark',
'#mark_type' => node_mark($entity->id(), $entity->getChangedTime()),
];
$langcode = $entity->language()->getId();
$uri = $entity->toUrl();
$options = $uri->getOptions();
$options += ($langcode != LanguageInterface::LANGCODE_NOT_SPECIFIED && isset($languages[$langcode]) ? ['language' => $languages[$langcode]] : []);
$uri->setOptions($options);
$row['title']['data'] = [
'#type' => 'link',
'#title' => $entity->label(),
'#suffix' => ' ' . \Drupal::service('renderer')->render($mark),
'#url' => $uri,
'#url' => $entity->toUrl(),
];
$row['type'] = node_get_type_label($entity);
$row['author']['data'] = [
......@@ -115,7 +109,7 @@ public function buildRow(EntityInterface $entity) {
$row['changed'] = $this->dateFormatter->format($entity->getChangedTime(), 'short');
$language_manager = \Drupal::languageManager();
if ($language_manager->isMultilingual()) {
$row['language_name'] = $language_manager->getLanguageName($langcode);
$row['language_name'] = $language_manager->getLanguageName($entity->language()->getId());
}
$row['operations']['data'] = $this->buildOperations($entity);
return $row + parent::buildRow($entity);
......
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