Commit 52dd6d09 authored by Patrick Schriner's avatar Patrick Schriner Committed by Anja Leichsenring
Browse files

[BUGFIX] Fix passing status code in redirects pagination

Filter status_code is not properly passed when building
pagination arguments in backend redirects module.

Resolves: #92125
Releases: master, 10.4
Change-Id: I7c3ace16e9d22eed9ac104876fdb68fdd615c2e7
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/65497


Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
parent dd26f656
......@@ -201,16 +201,16 @@ class Demand
{
$parameters = [];
if ($this->hasSourcePath()) {
$parameters['source_path'] = $this->sourcePath;
$parameters['source_path'] = $this->getSourcePath();
}
if ($this->hasSourceHost()) {
$parameters['source_host'] = $this->sourceHost;
$parameters['source_host'] = $this->getSourceHost();
}
if ($this->hasTarget()) {
$parameters['target'] = $this->target;
$parameters['target'] = $this->getTarget();
}
if ($this->hasStatusCode()) {
$parameters['target_statuscode'] = $this->target;
$parameters['target_statuscode'] = $this->getStatusCode();
}
return $parameters;
}
......
<?php
declare(strict_types=1);
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
namespace TYPO3\CMS\Redirects\Tests\Unit\Repository;
use TYPO3\CMS\Redirects\Repository\Demand;
use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
class DemandTest extends UnitTestCase
{
/**
* @return array
*/
public function getParametersRespectsDemandStateStateDataProvider(): array
{
return [
[[1, '', '', '', 0], []],
[[2, 'host', '', '', 0], ['source_host' => 'host']],
[[3, '', 'path', '', 0], ['source_path' => 'path']],
[[4, '', '', 'target', 0], ['target' => 'target']],
[[5, '', '', '', 301], ['target_statuscode' => 301]],
[[6, 'host', '', 'target'], ['source_host' => 'host', 'target' => 'target']],
[[7, '', 'path', '', 302], ['source_path' => 'path', 'target_statuscode' => 302]],
[[8, 'host', 'path', 'target', 307], ['source_path' => 'path', 'source_host' => 'host', 'target' => 'target', 'target_statuscode' => 307]]
];
}
/**
* @test
* @dataProvider getParametersRespectsDemandStateStateDataProvider
* @param string $input
* @param string $expected
*/
public function getParametersRespectsDemandState(array $input, array $expected)
{
$subject = new Demand(...$input);
self::assertEquals($expected, $subject->getParameters());
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment