Skip to content
Snippets Groups Projects
Commit 7beb95cd authored by m4olivei's avatar m4olivei
Browse files

Issue #3296577 by m4olivei, Project Update Bot, GersonJL, christyanpaim,...

Issue #3296577 by m4olivei, Project Update Bot, GersonJL, christyanpaim, jcnventura: Automated Drupal 10 compatibility fixes
parent 45a92abc
Branches
Tags
1 merge request!7Issue #3296577 Apply patch, modify some of the weird things it did
name: API Proxy
description: Puts Drupal between the front-end and the 3rd party API.
core: 8.x
core_version_requirement: ^8 || ^9
core_version_requirement: ^8 || ^9 || ^10
type: module
name: API Proxy Example
description: Illustrates the implementation of an HTTP API plugin.
core: 8.x
core_version_requirement: ^8 || ^9
core_version_requirement: ^8 || ^9 || ^10
type: module
dependencies:
- api_proxy:api_proxy
......@@ -29,7 +29,7 @@ final class Example extends HttpApiPluginBase {
$form['more_stuff'] = [
'#type' => 'textfield',
'#title' => $this->t('Extra config'),
'#default_value' => $this->configuration['more_stuff'],
'#default_value' => $this->configuration['more_stuff'] ?? [],
];
return $form;
}
......
......@@ -6,9 +6,9 @@ use Drupal\api_proxy\Plugin\HttpApiPluginBase;
use Drupal\Core\Cache\CacheableMetadata;
use Drupal\Core\Cache\CacheableResponse;
use Drupal\Core\Config\ImmutableConfig;
use Symfony\Cmf\Component\Routing\RouteProviderInterface;
use Drupal\Core\Routing\RouteProviderInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\Event\RequestEvent;
use Symfony\Component\HttpKernel\KernelEvents;
/**
......@@ -21,7 +21,7 @@ class OptionsRequestSubscriber implements EventSubscriberInterface {
/**
* The route provider.
*
* @var \Symfony\Cmf\Component\Routing\RouteProviderInterface
* @var \Drupal\Core\Routing\RouteProviderInterface
*/
protected $routeProvider;
......@@ -42,7 +42,7 @@ class OptionsRequestSubscriber implements EventSubscriberInterface {
/**
* Creates a new OptionsRequestSubscriber instance.
*
* @param \Symfony\Cmf\Component\Routing\RouteProviderInterface $route_provider
* @param \Drupal\Core\Routing\RouteProviderInterface $route_provider
* The route provider.
* @param \Symfony\Component\EventDispatcher\EventSubscriberInterface $subject
* The decorated service.
......@@ -58,10 +58,10 @@ class OptionsRequestSubscriber implements EventSubscriberInterface {
/**
* Tries to handle the options request.
*
* @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event
* @param \Symfony\Component\HttpKernel\Event\RequestEvent $event
* The request event.
*/
public function onRequest(GetResponseEvent $event) {
public function onRequest(RequestEvent $event) {
$request = $event->getRequest();
$routes = $this->routeProvider->getRouteCollectionForRequest($event->getRequest());
if ($request->getMethod() !== 'OPTIONS') {
......
......@@ -28,7 +28,7 @@ final class SettingsForm extends ConfigFormBase {
* {@inheritdoc}
*/
public function __construct(ConfigFactoryInterface $config_factory, HttpApiPluginManager $api_proxy_manager) {
$this->setConfigFactory($config_factory);
parent::__construct($config_factory);
$this->apiProxyManager = $api_proxy_manager;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment