Skip to content
Snippets Groups Projects
Commit ead3dd45 authored by Mohammad Anwar Siddiqui's avatar Mohammad Anwar Siddiqui
Browse files

Merge branch '3472776-getting-error-when' into '2.0.x'

Issue-3472776: Fixed configuration page issue.

See merge request !14
parents 6c9ae268 aa807aaf
Branches
Tags
No related merge requests found
Pipeline #459920 skipped
...@@ -5,6 +5,7 @@ namespace Drupal\quicklink\Form; ...@@ -5,6 +5,7 @@ namespace Drupal\quicklink\Form;
use Drupal\Core\Form\ConfigFormBase; use Drupal\Core\Form\ConfigFormBase;
use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Config\TypedConfigManagerInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Entity\EntityTypeManagerInterface;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
...@@ -27,9 +28,16 @@ class QuicklinkConfigForm extends ConfigFormBase { ...@@ -27,9 +28,16 @@ class QuicklinkConfigForm extends ConfigFormBase {
* The factory for configuration objects. * The factory for configuration objects.
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
* The entity type manager. * The entity type manager.
* @param \Drupal\Core\Config\TypedConfigManagerInterface|null $typed_config_manager
* The typed config manager.
*/ */
public function __construct(ConfigFactoryInterface $config_factory, EntityTypeManagerInterface $entity_type_manager) { public function __construct(ConfigFactoryInterface $config_factory, EntityTypeManagerInterface $entity_type_manager, ?TypedConfigManagerInterface $typed_config_manager = null) {
parent::__construct($config_factory); if (version_compare(\Drupal::VERSION, '10.2.0', '>=')) {
parent::__construct($config_factory, $typed_config_manager);
}
else {
parent::__construct($config_factory);
}
$this->entityTypeManager = $entity_type_manager; $this->entityTypeManager = $entity_type_manager;
} }
...@@ -39,7 +47,8 @@ class QuicklinkConfigForm extends ConfigFormBase { ...@@ -39,7 +47,8 @@ class QuicklinkConfigForm extends ConfigFormBase {
public static function create(ContainerInterface $container) { public static function create(ContainerInterface $container) {
return new static( return new static(
$container->get('config.factory'), $container->get('config.factory'),
$container->get('entity_type.manager') $container->get('entity_type.manager'),
$container->has('config.typed') ? $container->get('config.typed') : NULL
); );
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment