Skip to content

Commit

Permalink
Drupal 10 deprecation fixes
Browse files Browse the repository at this point in the history
- Updated *.info.yml to be compatible with Drupal 10.
- Replaced deprecated GetResponseForExceptionEvent with ExceptionEvent
for exception handling.
  • Loading branch information
humble-ahitofel committed Jun 4, 2024
1 parent 88cc594 commit c40da4d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions kifibundle.info.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Kirjastot.fi Components Bundle
type: module
core: 8.x
core_version_requirement: ">=8"
package: Kirjastot.fi
description: Various modules built to customize Drupal.
dependencies: {}
6 changes: 3 additions & 3 deletions src/EventSubscriber/ConfigurableExceptionLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

namespace Drupal\kifibundle\EventSubscriber;

use Symfony\Component\HttpKernel\Event\ExceptionEvent;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\EventSubscriber\ExceptionLoggingSubscriber;
use Drupal\Core\Logger\LoggerChannelFactoryInterface;
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;

class ConfigurableExceptionLogger extends ExceptionLoggingSubscriber {
protected $config;
Expand All @@ -16,13 +16,13 @@ public function __construct(LoggerChannelFactoryInterface $logger, ConfigFactory
$this->config = $config->get('kifibundle.logging');
}

public function on403(GetResponseForExceptionEvent $event) {
public function on403(ExceptionEvent $event) {
if ($this->isLoggingEnabled(404)) {
parent::on403($event);
}
}

public function on404(GetResponseForExceptionEvent $event) {
public function on404(ExceptionEvent $event) {
if ($this->isLoggingEnabled(404)) {
parent::on404($event);
}
Expand Down

0 comments on commit c40da4d

Please sign in to comment.