Comments

Hardik_Patel_12 created an issue. See original summary.

hardik_patel_12’s picture

StatusFileSize
new3.51 KB

Kindly review a patch.

hardik_patel_12’s picture

Assigned: hardik_patel_12 » Unassigned
Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 2: 3112421-2.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

swatichouhan012’s picture

Status: Needs work » Needs review
StatusFileSize
new4.02 KB
new1.27 KB

Status: Needs review » Needs work

The last submitted patch, 5: 3112421-5.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

thalles’s picture

Status: Needs work » Needs review
StatusFileSize
new4.02 KB

I did find only this little error in #5

+++ b/src/EventSubscriber/RedirectRequestSubscriber.php
@@ -148,7 +159,7 @@ class RedirectRequestSubscriber implements EventSubscriberInterface {
+      $this->logger('redirect')->warning('Redirect loop identified at %path for redirect %rid', ['%path' => $e->getPath(), '%rid' => $e->getRedirectId()]);

Follow a new patch.

Status: Needs review » Needs work

The last submitted patch, 7: 3112421-7.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

thalles’s picture

Status: Needs work » Needs review
StatusFileSize
new4.96 KB

Follow a patch that also changes the test

nishantghetiya’s picture

Assigned: Unassigned » nishantghetiya
nishantghetiya’s picture

Status: Needs review » Reviewed & tested by the community

@thalles Hello,

The provided patch is working fine. Thanks for your contribution.

nishantghetiya’s picture

Assigned: nishantghetiya » Unassigned
berdir’s picture

Status: Reviewed & tested by the community » Needs work
  1. +++ b/src/EventSubscriber/RedirectRequestSubscriber.php
    @@ -73,6 +74,13 @@ class RedirectRequestSubscriber implements EventSubscriberInterface {
     
    +  /**
    +   * The logger service.
    +   *
    +   * @var \Drupal\Core\Logger\LoggerChannelFactoryInterface
    +   */
    +  protected $logger;
    +
    

    Lets name this loggerFactory and similar for the description.

  2. +++ b/src/EventSubscriber/RedirectRequestSubscriber.php
    @@ -92,8 +100,10 @@ class RedirectRequestSubscriber implements EventSubscriberInterface {
        *   Request context.
    +   * @param \Drupal\Core\Logger\LoggerChannelFactoryInterface $logger
    +   *   The logger service.
        */
    -  public function __construct(RedirectRepository $redirect_repository, LanguageManagerInterface $language_manager, ConfigFactoryInterface $config, AliasManagerInterface $alias_manager, ModuleHandlerInterface $module_handler, EntityTypeManagerInterface $entity_type_manager, RedirectChecker $checker, RequestContext $context, InboundPathProcessorInterface $path_processor) {
    +  public function __construct(RedirectRepository $redirect_repository, LanguageManagerInterface $language_manager, ConfigFactoryInterface $config, AliasManagerInterface $alias_manager, ModuleHandlerInterface $module_handler, EntityTypeManagerInterface $entity_type_manager, RedirectChecker $checker, RequestContext $context, InboundPathProcessorInterface $path_processor, LoggerChannelFactoryInterface $logger) {
         $this->redirectRepository = $redirect_repository;
         $this->languageManager = $language_manager;
         $this->config = $config->get('redirect.settings');
    @@ -103,6 +113,7 @@ class RedirectRequestSubscriber implements EventSubscriberInterface {
    
    @@ -103,6 +113,7 @@ class RedirectRequestSubscriber implements EventSubscriberInterface {
         $this->checker = $checker;
         $this->context = $context;
         $this->pathProcessor = $path_processor;
    +    $this->logger = $logger;
       }
    

    Lets make the new argument optional with a fallback to \Drupal::service(), for people that forget to clear caches or use the UI to do so.

thalles’s picture

Status: Needs work » Needs review
StatusFileSize
new4.89 KB

Follow a new patch

naresh_bavaskar’s picture

Assigned: Unassigned » naresh_bavaskar
Status: Needs review » Needs work

above patch is not applying.

naresh_bavaskar’s picture

Assigned: naresh_bavaskar » Unassigned
Status: Needs work » Needs review
StatusFileSize
new4.31 KB
new2.82 KB
thalles’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me!

nicolas s.’s picture

patch #16 works for me

berdir’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/src/EventSubscriber/RedirectRequestSubscriber.php
@@ -19,13 +19,15 @@ use Symfony\Component\HttpKernel\KernelEvents;
 class RedirectRequestSubscriber implements EventSubscriberInterface {
 
-  /** @var  \Drupal\redirect\RedirectRepository */
+  /**
+   * @var  \Drupal\redirect\RedirectRepository*/
   protected $redirectRepository;
 

This is still invalid. either don't touch it or then change it to be correct :)

See also this duplicate issue #3014858: Use dependency injection for redirect classes

paulocs’s picture

Status: Needs work » Closed (duplicate)

Closing this issue as duplicated from #3014858: Use dependency injection for redirect classes