Olivier Massot 1 rok temu
rodzic
commit
29f5dea859

+ 1 - 1
composer.json

@@ -34,7 +34,7 @@
         "typo3/cms-recordlist": "^11.5",
         "fluidtypo3/flux": "^10.0",
         "fluidtypo3/vhs": "^7.0",
-        "georgringer/news": "^9",
+        "georgringer/news": "^11.4",
         "helhum/typo3-console": "^7.1",
         "causal/image_autoresize": "^2.2",
         "guzzlehttp/guzzle": "^7.7",

+ 2 - 0
ot_core/Configuration/Services.yaml

@@ -9,3 +9,5 @@ services:
 
   FluidTYPO3\Vhs\:
     resource: '/var/www/typo3/public/typo3conf/ext/vhs/Classes/*'
+
+  GeorgRinger\News\Controller\NewsController: '@Opentalent\OtTemplating\XClass\News\NewsController'

+ 0 - 3
ot_core/ext_localconf.php

@@ -28,9 +28,6 @@ $GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][TYPO3\CMS\Backend\Middleware\Backe
     'className' => Opentalent\OtCore\Middleware\OtBackendUserAuthenticator::class
 ];
 
-
-$GLOBALS['TYPO3_CONF_VARS']['EXT']['news']['Controller/NewsController.php']['createDemandObjectFromSettings'] = ['Opentalent\OtTemplating\News\NewsFilter->createDemandObjectFromSettings'];
-
 // ** Opentalent environment variables **
 // An array containing all or part of these variables could have been set before, for example
 // in the AdditionalConfiguration.php file.

+ 24 - 0
ot_templating/Classes/XClass/News/NewsController.php

@@ -0,0 +1,24 @@
+<?php
+
+namespace Opentalent\OtTemplating\XClass\News;
+
+use GeorgRinger\News\Domain\Model\Dto\NewsDemand;
+use GeorgRinger\News\Utility\Page;
+
+class NewsController extends \GeorgRinger\News\Controller\NewsController
+{
+    protected function createDemandObjectFromSettings(
+        array $settings,
+              $class = NewsDemand::class
+    ): \GeorgRinger\News\Domain\Model\Dto\NewsDemand {
+        $demand = parent::createDemandObjectFromSettings($settings, $class);
+
+        $rootUid = $GLOBALS['TSFE']->site->getRootPageId();
+        $demand->setStoragePage(Page::extendPidListByChildren(
+            '' . $rootUid,
+            5
+        ));
+
+        return $demand;
+    }
+}

+ 3 - 2
ot_templating/ext_localconf.php

@@ -15,8 +15,6 @@ if (!defined('TYPO3')) {
     'Content'
 );
 
-$GLOBALS['TYPO3_CONF_VARS']['EXT']['news']['Controller/NewsController.php']['createDemandObjectFromSettings'] = ['Opentalent\OtTemplating\News\NewsFilter->createDemandObjectFromSettings'];
-
 // Required to allow the use of multisite with the form extension
 $GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][TYPO3\CMS\Form\Mvc\Configuration\ConfigurationManager::class] = [
     'className' => Opentalent\OtTemplating\XClass\Form\Configuration\ConfigurationManager::class
@@ -24,3 +22,6 @@ $GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][TYPO3\CMS\Form\Mvc\Configuration\C
 $GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][TYPO3\CMS\Form\Domain\Finishers\EmailFinisher::class] = [
     'className' => Opentalent\OtTemplating\XClass\Form\Finishers\EmailFinisher::class
 ];
+$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][GeorgRinger\News\Controller\NewsController::class] = [
+    'className' => Opentalent\OtTemplating\XClass\News\NewsController::class
+];