Commit 9e919411 authored by catch's avatar catch

Issue #2403101 by alexpott: ContentLanguageSettingsForm is not a config form

parent 7854cac4
......@@ -7,9 +7,8 @@
namespace Drupal\language\Form;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Entity\EntityManagerInterface;
use Drupal\Core\Form\ConfigFormBase;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\language\Entity\ContentLanguageSettings;
use Symfony\Component\DependencyInjection\ContainerInterface;
......@@ -17,7 +16,7 @@
/**
* Configure the content language settings for this site.
*/
class ContentLanguageSettingsForm extends ConfigFormBase {
class ContentLanguageSettingsForm extends FormBase {
/**
* The entity manager.
......@@ -29,14 +28,10 @@ class ContentLanguageSettingsForm extends ConfigFormBase {
/**
* Constructs a ContentLanguageSettingsForm object.
*
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* The config factory.
* @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
* The entity manager.
*/
public function __construct(ConfigFactoryInterface $config_factory, EntityManagerInterface $entity_manager) {
parent::__construct($config_factory);
public function __construct(EntityManagerInterface $entity_manager) {
$this->entityManager = $entity_manager;
}
......@@ -45,7 +40,6 @@ public function __construct(ConfigFactoryInterface $config_factory, EntityManage
*/
public static function create(ContainerInterface $container) {
return new static(
$container->get('config.factory'),
$container->get('entity.manager')
);
}
......@@ -136,7 +130,12 @@ public function buildForm(array $form, FormStateInterface $form_state) {
}
}
$form = parent::buildForm($form, $form_state);
$form['actions']['#type'] = 'actions';
$form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => $this->t('Save configuration'),
'#button_type' => 'primary',
);
return $form;
}
......
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