diff --git a/src/Form/SettingsForm.php b/src/Form/SettingsForm.php index 52bac78f63e7c4003fc4f12134421b60750631e1..a0eef0017525605512bd0e5442289743955cdcc6 100644 --- a/src/Form/SettingsForm.php +++ b/src/Form/SettingsForm.php @@ -4,6 +4,7 @@ namespace Drupal\vuejs\Form; use Drupal\Core\Asset\LibraryDiscoveryInterface; use Drupal\Core\Config\ConfigFactoryInterface; +use Drupal\Core\Config\TypedConfigManagerInterface; use Drupal\Core\Form\ConfigFormBase; use Drupal\Core\Form\FormStateInterface; use GuzzleHttp\ClientInterface; @@ -37,15 +38,24 @@ final class SettingsForm extends ConfigFormBase { * The library.discovery service. * @param \GuzzleHttp\ClientInterface $http_client * A Guzzle client object. + * @param \Drupal\Core\Config\TypedConfigManagerInterface|null $typed_config_manager + * The typed config manager. */ public function __construct( ConfigFactoryInterface $config_factory, LibraryDiscoveryInterface $library_discovery, - ClientInterface $http_client + ClientInterface $http_client, + ?TypedConfigManagerInterface $typed_config_manager = null ) { $this->libraryDiscovery = $library_discovery; $this->httpClient = $http_client; - parent::__construct($config_factory); + if (version_compare(\Drupal::VERSION, '10.2.0', '>=')) { + // @todo: Once we require ^10.3 + parent::__construct($config_factory, $typed_config_manager); + } + else { + parent::__construct($config_factory); + } } /** @@ -55,7 +65,8 @@ final class SettingsForm extends ConfigFormBase { return new static( $container->get('config.factory'), $container->get('library.discovery'), - $container->get('http_client') + $container->get('http_client'), + $container->has('config.typed') ? $container->get('config.typed') : NULL ); } diff --git a/vuejs.info.yml b/vuejs.info.yml index fb0a09638d9d66b576ac2abc1bd925b1362c6eba..b0bc5eec86ab9cdaccf10be9fa3613b6f019e3e7 100644 --- a/vuejs.info.yml +++ b/vuejs.info.yml @@ -2,5 +2,5 @@ name: Vue.js type: module description: Provides a bridge between Drupal and Vue.js framework. configure: vuejs.settings -core_version_requirement: ^9 || ^10 || ^11 +core_version_requirement: ^10.3 || ^11 php: 7.4