Skip to content

Commit

Permalink
Merge pull request #74 from froboy/revert-73-DS-1471
Browse files Browse the repository at this point in the history
Revert "[DS-1471] Update redirect to avoid redirecting for cached scripts and styles"
  • Loading branch information
podarok authored Jun 5, 2024
2 parents 0a67e9f + f5f90fe commit dd69bde
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 45 deletions.
4 changes: 0 additions & 4 deletions openy_system/openy_system.services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,3 @@ services:
arguments: ['@config.factory', '@current_user']
tags:
- {name: event_subscriber}
openy_system.route_subscriber:
class: Drupal\openy_system\Routing\RouteSubscriber
tags:
- {name: event_subscriber}
26 changes: 0 additions & 26 deletions openy_system/src/EventSubscriber/Routing/RouteSubscriber.php

This file was deleted.

19 changes: 4 additions & 15 deletions openy_system/src/EventSubscriber/TermsSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

namespace Drupal\openy_system\EventSubscriber;

use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\Url;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpKernel\Event\RequestEvent;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Session\AccountInterface;
use Symfony\Component\HttpKernel\Event\RequestEvent;

/**
* Class TermsSubscriber.
Expand All @@ -28,12 +28,7 @@ class TermsSubscriber implements EventSubscriberInterface {
protected $currentUser;

/**
* Constructs a new TermsSubscriber event subscriber.
*
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* * The configuration factory.
* @param \Drupal\Core\Session\AccountInterface $current_user
* The current logged user.
*/
public function __construct(ConfigFactoryInterface $config_factory, AccountInterface $current_user) {
$this->config = $config_factory->get('openy.terms_and_conditions.schema');
Expand All @@ -44,12 +39,6 @@ public function __construct(ConfigFactoryInterface $config_factory, AccountInter
* {@inheritdoc}
*/
public function checkForRedirection(RequestEvent $event) {
$request = clone $event->getRequest();
// See https://www.drupal.org/project/redirect/issues/3373123 .
if ($request->attributes->get('_disable_route_normalizer')) {
return;
}

$url = Url::fromRoute('openy_system.openy_terms_and_conditions')
->toString();
$request_uri = $event->getRequest()->getRequestUri();
Expand Down

0 comments on commit dd69bde

Please sign in to comment.