-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #31 upgrade for TYPO3 12.4 LTS
- Loading branch information
Showing
38 changed files
with
503 additions
and
180 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
/*************************************************************** | ||
* Copyright notice | ||
* | ||
* (c) 2010-2022 Rene Nitzsche ([email protected]) | ||
* (c) 2010-2023 Rene Nitzsche ([email protected]) | ||
* All rights reserved | ||
* | ||
* This script is part of the TYPO3 project. The TYPO3 project is | ||
|
@@ -114,7 +114,7 @@ private function findData(RequestInterface $request, $viewData, $type) | |
* | ||
* @param string $confid | ||
* Die Confid des PageBrowsers. z.B. myview.org.pagebrowser ohne Punkt! | ||
* @param \tx_rnbase_configurations $configurations | ||
* @param ConfigurationInterface $configurations | ||
* @param \ArrayObject $viewdata | ||
* @param array $fields | ||
* @param array $options | ||
|
@@ -124,7 +124,7 @@ private static function handlePageBrowser(ConfigurationInterface $configurations | |
$confid .= '.'; | ||
if (is_array($configurations->get($confid))) { | ||
// Die Gesamtzahl der Items ist entweder im Limit gesetzt oder muss ermittelt werden | ||
$listSize = intval($options['limit']); | ||
$listSize = (int) ($options['limit'] ?? 0); | ||
if (!$listSize) { | ||
// Mit Pagebrowser benötigen wir zwei Zugriffe, um die Gesamtanzahl der Items zu ermitteln | ||
$options['count'] = 1; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace System25\T3sports\DependencyInjection; | ||
|
||
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; | ||
use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
use Symfony\Component\DependencyInjection\Reference; | ||
use System25\T3sports\Service\StatsIndexerProvider; | ||
|
||
class StatsIndexerPass implements CompilerPassInterface | ||
{ | ||
public function process(ContainerBuilder $container): void | ||
{ | ||
// always first check if the primary service is defined | ||
if (!$container->has(StatsIndexerProvider::class)) { | ||
return; | ||
} | ||
|
||
$definition = $container->findDefinition(StatsIndexerProvider::class); | ||
|
||
// find all service IDs with the t3sports.stats.player tag | ||
$taggedServices = $container->findTaggedServiceIds('t3sports.stats.indexer'); | ||
|
||
foreach ($taggedServices as $id => $tags) { | ||
// add the indexer to the IndexerProvider service | ||
$definition->addMethodCall('addStatsIndexer', [new Reference($id)]); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,13 +3,13 @@ | |
namespace System25\T3sports\Hooks; | ||
|
||
use System25\T3sports\Model\Competition; | ||
use System25\T3sports\Service\StatsServiceRegistry; | ||
use System25\T3sports\Service\Statistics; | ||
use tx_rnbase; | ||
|
||
/*************************************************************** | ||
* Copyright notice | ||
* | ||
* (c) 2010-2022 Rene Nitzsche | ||
* (c) 2010-2023 Rene Nitzsche | ||
* Contact: [email protected] | ||
* All rights reserved | ||
* | ||
|
@@ -33,13 +33,19 @@ | |
*/ | ||
class ClearStats | ||
{ | ||
private $statsSrv; | ||
|
||
public function __construct(Statistics $statisticsService = null) | ||
{ | ||
$this->statsSrv = $statisticsService ?: new Statistics(); | ||
} | ||
|
||
public function clearStats4Comp($params, $parent) | ||
{ | ||
$srv = (new StatsServiceRegistry())->getStatisticService(); | ||
/* @var $comp Competition */ | ||
$comp = tx_rnbase::makeInstance(Competition::class, $params['compUid']); | ||
if ($comp && $comp->isValid()) { | ||
$srv->indexPlayerStatsByCompetition($comp); | ||
$this->statsSrv->indexPlayerStatsByCompetition($comp); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,13 +9,13 @@ | |
use System25\T3sports\Frontend\Marker\ProfileMarker; | ||
use System25\T3sports\Marker\PlayerStatsMarker; | ||
use System25\T3sports\Model\Profile; | ||
use System25\T3sports\Service\StatsServiceRegistry; | ||
use System25\T3sports\Service\Statistics; | ||
use tx_rnbase; | ||
|
||
/*************************************************************** | ||
* Copyright notice | ||
* | ||
* (c) 2008-2022 Rene Nitzsche | ||
* (c) 2008-2023 Rene Nitzsche | ||
* Contact: [email protected] | ||
* All rights reserved | ||
* | ||
|
@@ -59,6 +59,13 @@ class Marker | |
], | ||
]; | ||
|
||
private $statsSrv; | ||
|
||
public function __construct(Statistics $statisticsService = null) | ||
{ | ||
$this->statsSrv = $statisticsService ?: new Statistics(); | ||
} | ||
|
||
/** | ||
* Extend profileMarker for statistical data about profile. | ||
* | ||
|
@@ -93,25 +100,24 @@ public function parseProfile($params, $parent) | |
$markerClass = $markerClass ? $markerClass : PlayerStatsMarker::class; | ||
$marker = tx_rnbase::makeInstance($markerClass); | ||
// Wir sollten nur einen Datensatz haben und können diesen jetzt ausgeben | ||
$subpartArray['###'.$subpartMarker.'###'] = $marker->parseTemplate($subpart, $items[0], $config->getFormatter(), $confId.$statKey.'.data.', $subpartMarker); | ||
$subpartArray['###'.$subpartMarker.'###'] = $marker->parseTemplate($subpart, $items[0] ?? null, $config->getFormatter(), $confId.$statKey.'.data.', $subpartMarker); | ||
} | ||
|
||
$params['template'] = Templates::substituteMarkerArrayCached($template, [], $subpartArray); | ||
} | ||
|
||
/** | ||
* @param Profile $profile | ||
* @param unknown $configurations | ||
* @param unknown $confId | ||
* @param unknown $type | ||
* @param ConfigurationInterface $configurations | ||
* @param string $confId | ||
* @param string $type | ||
* | ||
* @throws \Exception | ||
* | ||
* @return unknown | ||
* @return array | ||
*/ | ||
private function findData(Profile $profile, ConfigurationInterface $configurations, $confId, $type) | ||
{ | ||
$srv = (new StatsServiceRegistry())->getStatisticService(); | ||
$request = new Request($configurations->getParameters(), $configurations, $confId); | ||
$confId = $confId.$type.'.'; | ||
$filter = BaseFilter::createFilter( | ||
|
@@ -136,7 +142,7 @@ private function findData(Profile $profile, ConfigurationInterface $configuratio | |
$filter->init($fields, $options); | ||
|
||
$searchMethod = self::$filterData[$filterType]['search']; | ||
$items = $srv->$searchMethod($fields, $options); | ||
$items = $this->statsSrv->$searchMethod($fields, $options); | ||
|
||
return $items; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.