Issue #2587149 by Dane Powell, claudiu.cristea: Single item config export names are ambiguous
parent
1f504dd514
commit
a51c530356
|
@ -14,6 +14,7 @@ use Drupal\Core\Entity\EntityTypeInterface;
|
|||
use Drupal\Core\Form\FormBase;
|
||||
use Drupal\Core\Form\FormState;
|
||||
use Drupal\Core\Form\FormStateInterface;
|
||||
use Drupal\Core\StringTranslation\TranslatableMarkup;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
|
||||
/**
|
||||
|
@ -169,8 +170,12 @@ class ConfigSingleExportForm extends FormBase {
|
|||
$entity_storage = $this->entityManager->getStorage($config_type);
|
||||
foreach ($entity_storage->loadMultiple() as $entity) {
|
||||
$entity_id = $entity->id();
|
||||
$label = $entity->label() ?: $entity_id;
|
||||
$names[$entity_id] = $label;
|
||||
if ($label = $entity->label()) {
|
||||
$names[$entity_id] = new TranslatableMarkup('@label (@id)', ['@label' => $label, '@id' => $entity_id]);
|
||||
}
|
||||
else {
|
||||
$names[$entity_id] = $entity_id;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Handle simple configuration.
|
||||
|
|
|
@ -208,7 +208,7 @@ EOD;
|
|||
$this->assertFieldByXPath('//select[@name="config_type"]//option[@selected="selected"]', t('Date format'), 'The date format entity type is selected when specified in the URL.');
|
||||
|
||||
$this->drupalGet('admin/config/development/configuration/single/export/date_format/fallback');
|
||||
$this->assertFieldByXPath('//select[@name="config_name"]//option[@selected="selected"]', t('Fallback date format'), 'The fallback date format config entity is selected when specified in the URL.');
|
||||
$this->assertFieldByXPath('//select[@name="config_name"]//option[@selected="selected"]', t('Fallback date format (fallback)'), 'The fallback date format config entity is selected when specified in the URL.');
|
||||
|
||||
$fallback_date = \Drupal::entityManager()->getStorage('date_format')->load('fallback');
|
||||
$data = Yaml::encode($fallback_date->toArray());
|
||||
|
|
Loading…
Reference in New Issue