[!!!][TASK] Deprecate ext:backend class AbstractModule 12/54312/5
authorChristian Kuhn <lolli@schwarzbu.ch>
Fri, 6 Oct 2017 13:58:43 +0000 (15:58 +0200)
committerBenni Mack <benni@typo3.org>
Fri, 6 Oct 2017 15:04:31 +0000 (17:04 +0200)
The internal / experimental class ext:backend/Module/AbstractModule
doesn't do much useful stuff: It only instantiates ModuleTemplate
in it's constructor which forces all inheriting classes to call
parent::__construct(). The processRequest() method with its
dispatcher code is never used in core, but superseeded by routing
configuration via Configuration/Backend/Routes.php.

The patch removes given AbstractModule usages and markes the
class as deprecated. The patch is slightly breaking in cases
an extension extends AbstractWizardController and additionally
uses the initialized moduleTemplate property.

Change-Id: Iee36e1787a6dc2a1affb3625983ccb6450589481
Resolves: #82689
Releases: master
Reviewed-on: https://review.typo3.org/54312
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
21 files changed:
typo3/sysext/backend/Classes/Controller/ContentElement/ElementHistoryController.php
typo3/sysext/backend/Classes/Controller/ContentElement/MoveElementController.php
typo3/sysext/backend/Classes/Controller/ContentElement/NewContentElementController.php
typo3/sysext/backend/Classes/Controller/EditDocumentController.php
typo3/sysext/backend/Classes/Controller/File/CreateFolderController.php
typo3/sysext/backend/Classes/Controller/File/EditFileController.php
typo3/sysext/backend/Classes/Controller/File/FileUploadController.php
typo3/sysext/backend/Classes/Controller/File/RenameFileController.php
typo3/sysext/backend/Classes/Controller/File/ReplaceFileController.php
typo3/sysext/backend/Classes/Controller/NewRecordController.php
typo3/sysext/backend/Classes/Controller/Wizard/AbstractWizardController.php
typo3/sysext/backend/Classes/Controller/Wizard/AddController.php
typo3/sysext/backend/Classes/Controller/Wizard/EditController.php
typo3/sysext/backend/Classes/Controller/Wizard/ListController.php
typo3/sysext/backend/Classes/Controller/Wizard/TableController.php
typo3/sysext/backend/Classes/Module/AbstractModule.php
typo3/sysext/core/Documentation/Changelog/master/Breaking-82689-BackendAbstractWizardControllerNotExtendsAbstractModule.rst [new file with mode: 0644]
typo3/sysext/install/Configuration/ExtensionScanner/Php/ClassNameMatcher.php
typo3/sysext/linkvalidator/Classes/Report/LinkValidatorReport.php
typo3/sysext/recordlist/Classes/RecordList.php
typo3/sysext/setup/Classes/Controller/SetupModuleController.php

index e45a750..8f8a4f5 100644 (file)
@@ -17,8 +17,8 @@ namespace TYPO3\CMS\Backend\Controller\ContentElement;
 use Psr\Http\Message\ResponseInterface;
 use Psr\Http\Message\ServerRequestInterface;
 use TYPO3\CMS\Backend\History\RecordHistory;
-use TYPO3\CMS\Backend\Module\AbstractModule;
 use TYPO3\CMS\Backend\Template\Components\ButtonBar;
+use TYPO3\CMS\Backend\Template\ModuleTemplate;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\History\RecordHistoryStore;
 use TYPO3\CMS\Core\Imaging\Icon;
@@ -30,7 +30,7 @@ use TYPO3\CMS\Fluid\View\StandaloneView;
  * Controller for showing the history module of TYPO3s backend
  * @see \TYPO3\CMS\Backend\History\RecordHistory
  */
-class ElementHistoryController extends AbstractModule
+class ElementHistoryController
 {
     /**
      * @var ServerRequestInterface
@@ -60,11 +60,18 @@ class ElementHistoryController extends AbstractModule
     protected $recordCache = [];
 
     /**
+     * ModuleTemplate object
+     *
+     * @var ModuleTemplate
+     */
+    protected $moduleTemplate;
+
+    /**
      * Constructor
      */
     public function __construct()
     {
-        parent::__construct();
+        $this->moduleTemplate = GeneralUtility::makeInstance(ModuleTemplate::class);
         $this->view = $this->initializeView();
     }
 
index f7fc1df..6150475 100644 (file)
@@ -16,7 +16,7 @@ namespace TYPO3\CMS\Backend\Controller\ContentElement;
 
 use Psr\Http\Message\ResponseInterface;
 use Psr\Http\Message\ServerRequestInterface;
-use TYPO3\CMS\Backend\Module\AbstractModule;
+use TYPO3\CMS\Backend\Template\ModuleTemplate;
 use TYPO3\CMS\Backend\Tree\View\ContentMovingPagePositionMap;
 use TYPO3\CMS\Backend\Tree\View\PageMovingPagePositionMap;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
@@ -27,7 +27,7 @@ use TYPO3\CMS\Fluid\View\StandaloneView;
 /**
  * Script Class for rendering the move-element wizard display
  */
-class MoveElementController extends AbstractModule
+class MoveElementController
 {
     /**
      * @var int
@@ -79,11 +79,18 @@ class MoveElementController extends AbstractModule
     public $content;
 
     /**
+     * ModuleTemplate object
+     *
+     * @var ModuleTemplate
+     */
+    protected $moduleTemplate;
+
+    /**
      * Constructor
      */
     public function __construct()
     {
-        parent::__construct();
+        $this->moduleTemplate = GeneralUtility::makeInstance(ModuleTemplate::class);
         $this->getLanguageService()->includeLLFile('EXT:lang/Resources/Private/Language/locallang_misc.xlf');
         $GLOBALS['SOBE'] = $this;
         $this->init();
index a0b1b9c..c15b79e 100644 (file)
@@ -16,8 +16,8 @@ namespace TYPO3\CMS\Backend\Controller\ContentElement;
 
 use Psr\Http\Message\ResponseInterface;
 use Psr\Http\Message\ServerRequestInterface;
-use TYPO3\CMS\Backend\Module\AbstractModule;
 use TYPO3\CMS\Backend\Template\DocumentTemplate;
+use TYPO3\CMS\Backend\Template\ModuleTemplate;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Backend\View\BackendLayoutView;
 use TYPO3\CMS\Backend\Wizard\NewContentElementWizardHookInterface;
@@ -30,7 +30,7 @@ use TYPO3\CMS\Fluid\View\StandaloneView;
 /**
  * Script Class for the New Content element wizard
  */
-class NewContentElementController extends AbstractModule
+class NewContentElementController
 {
     /**
      * Page id
@@ -126,11 +126,18 @@ class NewContentElementController extends AbstractModule
     protected $menuItemView;
 
     /**
+     * ModuleTemplate object
+     *
+     * @var ModuleTemplate
+     */
+    protected $moduleTemplate;
+
+    /**
      * Constructor
      */
     public function __construct()
     {
-        parent::__construct();
+        $this->moduleTemplate = GeneralUtility::makeInstance(ModuleTemplate::class);
         $GLOBALS['SOBE'] = $this;
         $this->view = $this->getFluidTemplateObject();
         $this->menuItemView = $this->getFluidTemplateObject('MenuItem.html');
index 567490b..89f71b6 100644 (file)
@@ -22,8 +22,8 @@ use TYPO3\CMS\Backend\Form\FormDataGroup\TcaDatabaseRecord;
 use TYPO3\CMS\Backend\Form\FormResultCompiler;
 use TYPO3\CMS\Backend\Form\NodeFactory;
 use TYPO3\CMS\Backend\Form\Utility\FormEngineUtility;
-use TYPO3\CMS\Backend\Module\AbstractModule;
 use TYPO3\CMS\Backend\Template\Components\ButtonBar;
+use TYPO3\CMS\Backend\Template\ModuleTemplate;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Database\ConnectionPool;
 use TYPO3\CMS\Core\Database\Query\Restriction\BackendWorkspaceRestriction;
@@ -48,7 +48,7 @@ use TYPO3\CMS\Frontend\Page\PageRepository;
  * Script Class: Drawing the editing form for editing records in TYPO3.
  * Notice: It does NOT use tce_db.php to submit data to, rather it handles submissions itself
  */
-class EditDocumentController extends AbstractModule
+class EditDocumentController
 {
     const DOCUMENT_CLOSE_MODE_DEFAULT = 0;
     const DOCUMENT_CLOSE_MODE_REDIRECT = 1; // works like DOCUMENT_CLOSE_MODE_DEFAULT
@@ -400,11 +400,18 @@ class EditDocumentController extends AbstractModule
     protected $previewData = [];
 
     /**
+     * ModuleTemplate object
+     *
+     * @var ModuleTemplate
+     */
+    protected $moduleTemplate;
+
+    /**
      * Constructor
      */
     public function __construct()
     {
-        parent::__construct();
+        $this->moduleTemplate = GeneralUtility::makeInstance(ModuleTemplate::class);
         $this->moduleTemplate->setUiBlock(true);
         $GLOBALS['SOBE'] = $this;
         $this->getLanguageService()->includeLLFile('EXT:lang/Resources/Private/Language/locallang_alt_doc.xlf');
index 9012348..ffc74c2 100644 (file)
@@ -16,7 +16,7 @@ namespace TYPO3\CMS\Backend\Controller\File;
 
 use Psr\Http\Message\ResponseInterface;
 use Psr\Http\Message\ServerRequestInterface;
-use TYPO3\CMS\Backend\Module\AbstractModule;
+use TYPO3\CMS\Backend\Template\ModuleTemplate;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Resource\Exception\InsufficientFolderAccessPermissionsException;
@@ -31,7 +31,7 @@ use TYPO3\CMS\Fluid\View\StandaloneView;
  *
  * Displays forms for creating folders (1 to 10), a media asset or a new file.
  */
-class CreateFolderController extends AbstractModule
+class CreateFolderController
 {
     /**
      * @var int
@@ -84,11 +84,18 @@ class CreateFolderController extends AbstractModule
     public $content;
 
     /**
+     * ModuleTemplate object
+     *
+     * @var ModuleTemplate
+     */
+    protected $moduleTemplate;
+
+    /**
      * Constructor
      */
     public function __construct()
     {
-        parent::__construct();
+        $this->moduleTemplate = GeneralUtility::makeInstance(ModuleTemplate::class);
         $GLOBALS['SOBE'] = $this;
         $this->init();
     }
index 27a42c8..29ee2f1 100644 (file)
@@ -18,9 +18,9 @@ use Psr\Http\Message\ResponseInterface;
 use Psr\Http\Message\ServerRequestInterface;
 use TYPO3\CMS\Backend\Form\FormResultCompiler;
 use TYPO3\CMS\Backend\Form\NodeFactory;
-use TYPO3\CMS\Backend\Module\AbstractModule;
 use TYPO3\CMS\Backend\Template\Components\ButtonBar;
 use TYPO3\CMS\Backend\Template\DocumentTemplate;
+use TYPO3\CMS\Backend\Template\ModuleTemplate;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Messaging\FlashMessage;
@@ -34,7 +34,7 @@ use TYPO3\CMS\Fluid\View\StandaloneView;
 /**
  * Script Class for rendering the file editing screen
  */
-class EditFileController extends AbstractModule
+class EditFileController
 {
     /**
      * Module content accumulated.
@@ -84,11 +84,18 @@ class EditFileController extends AbstractModule
     protected $fileObject;
 
     /**
+     * ModuleTemplate object
+     *
+     * @var ModuleTemplate
+     */
+    protected $moduleTemplate;
+
+    /**
      * Constructor
      */
     public function __construct()
     {
-        parent::__construct();
+        $this->moduleTemplate = GeneralUtility::makeInstance(ModuleTemplate::class);
         $GLOBALS['SOBE'] = $this;
         $this->init();
     }
index 03fcbeb..eced801 100644 (file)
@@ -16,7 +16,7 @@ namespace TYPO3\CMS\Backend\Controller\File;
 
 use Psr\Http\Message\ResponseInterface;
 use Psr\Http\Message\ServerRequestInterface;
-use TYPO3\CMS\Backend\Module\AbstractModule;
+use TYPO3\CMS\Backend\Template\ModuleTemplate;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Resource\Exception\InsufficientFolderAccessPermissionsException;
@@ -26,7 +26,7 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
 /**
  * Script Class for display up to 10 upload fields
  */
-class FileUploadController extends AbstractModule
+class FileUploadController
 {
     /**
      * Name of the filemount
@@ -64,11 +64,18 @@ class FileUploadController extends AbstractModule
     protected $folderObject;
 
     /**
+     * ModuleTemplate object
+     *
+     * @var ModuleTemplate
+     */
+    protected $moduleTemplate;
+
+    /**
      * Constructor
      */
     public function __construct()
     {
-        parent::__construct();
+        $this->moduleTemplate = GeneralUtility::makeInstance(ModuleTemplate::class);
         $GLOBALS['SOBE'] = $this;
         $this->getLanguageService()->includeLLFile('EXT:lang/Resources/Private/Language/locallang_misc.xlf');
         $this->init();
index 2f89118..a3cf17c 100644 (file)
@@ -16,8 +16,8 @@ namespace TYPO3\CMS\Backend\Controller\File;
 
 use Psr\Http\Message\ResponseInterface;
 use Psr\Http\Message\ServerRequestInterface;
-use TYPO3\CMS\Backend\Module\AbstractModule;
 use TYPO3\CMS\Backend\Template\Components\ButtonBar;
+use TYPO3\CMS\Backend\Template\ModuleTemplate;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Resource\DuplicationBehavior;
@@ -29,7 +29,7 @@ use TYPO3\CMS\Fluid\View\StandaloneView;
 /**
  * Script Class for the rename-file form.
  */
-class RenameFileController extends AbstractModule
+class RenameFileController
 {
     /**
      * Name of the filemount
@@ -69,11 +69,18 @@ class RenameFileController extends AbstractModule
     public $content;
 
     /**
+     * ModuleTemplate object
+     *
+     * @var ModuleTemplate
+     */
+    protected $moduleTemplate;
+
+    /**
      * Constructor
      */
     public function __construct()
     {
-        parent::__construct();
+        $this->moduleTemplate = GeneralUtility::makeInstance(ModuleTemplate::class);
         $GLOBALS['SOBE'] = $this;
         $this->init();
     }
index 295741f..a6a1c95 100644 (file)
@@ -16,7 +16,7 @@ namespace TYPO3\CMS\Backend\Controller\File;
 
 use Psr\Http\Message\ResponseInterface;
 use Psr\Http\Message\ServerRequestInterface;
-use TYPO3\CMS\Backend\Module\AbstractModule;
+use TYPO3\CMS\Backend\Template\ModuleTemplate;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Localization\LanguageService;
@@ -29,7 +29,7 @@ use TYPO3\CMS\Fluid\View\StandaloneView;
 /**
  * Script Class for the rename-file form
  */
-class ReplaceFileController extends AbstractModule
+class ReplaceFileController
 {
     /**
      * Document template object
@@ -74,11 +74,18 @@ class ReplaceFileController extends AbstractModule
     public $content;
 
     /**
+     * ModuleTemplate object
+     *
+     * @var ModuleTemplate
+     */
+    protected $moduleTemplate;
+
+    /**
      * Constructor
      */
     public function __construct()
     {
-        parent::__construct();
+        $this->moduleTemplate = GeneralUtility::makeInstance(ModuleTemplate::class);
         $GLOBALS['SOBE'] = $this;
         $this->init();
     }
index dd18ae0..f1925e9 100644 (file)
@@ -16,8 +16,8 @@ namespace TYPO3\CMS\Backend\Controller;
 
 use Psr\Http\Message\ResponseInterface;
 use Psr\Http\Message\ServerRequestInterface;
-use TYPO3\CMS\Backend\Module\AbstractModule;
 use TYPO3\CMS\Backend\Template\Components\ButtonBar;
+use TYPO3\CMS\Backend\Template\ModuleTemplate;
 use TYPO3\CMS\Backend\Tree\View\NewRecordPageTreeView;
 use TYPO3\CMS\Backend\Tree\View\PagePositionMap;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
@@ -33,7 +33,7 @@ use TYPO3\CMS\Frontend\Page\PageRepository;
 /**
  * Script class for 'db_new'
  */
-class NewRecordController extends AbstractModule
+class NewRecordController
 {
     /**
      * @var array
@@ -147,11 +147,18 @@ class NewRecordController extends AbstractModule
     public $tRows;
 
     /**
+     * ModuleTemplate object
+     *
+     * @var ModuleTemplate
+     */
+    protected $moduleTemplate;
+
+    /**
      * Constructor
      */
     public function __construct()
     {
-        parent::__construct();
+        $this->moduleTemplate = GeneralUtility::makeInstance(ModuleTemplate::class);
         $GLOBALS['SOBE'] = $this;
         $this->getLanguageService()->includeLLFile('EXT:lang/Resources/Private/Language/locallang_misc.xlf');
         $this->init();
index 315c9d1..8f68bb0 100644 (file)
@@ -14,7 +14,6 @@ namespace TYPO3\CMS\Backend\Controller\Wizard;
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\CMS\Backend\Module\AbstractModule;
 use TYPO3\CMS\Backend\Template\DocumentTemplate;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
@@ -24,7 +23,7 @@ use TYPO3\CMS\Core\Type\Bitmask\Permission;
 /**
  * Class AbstractWizardController
  */
-class AbstractWizardController extends AbstractModule
+class AbstractWizardController
 {
     /**
      * Checks access for element
index 0e8a22c..a7f7063 100644 (file)
@@ -85,7 +85,6 @@ class AddController extends AbstractWizardController
      */
     public function __construct()
     {
-        parent::__construct();
         $this->getLanguageService()->includeLLFile('EXT:lang/Resources/Private/Language/locallang_wizards.xlf');
         $GLOBALS['SOBE'] = $this;
 
index 6c16d1a..b9f1e9e 100644 (file)
@@ -53,7 +53,6 @@ class EditController extends AbstractWizardController
      */
     public function __construct()
     {
-        parent::__construct();
         $this->getLanguageService()->includeLLFile('EXT:lang/Resources/Private/Language/locallang_wizards.xlf');
         $GLOBALS['SOBE'] = $this;
 
index f9f994b..63a9a56 100644 (file)
@@ -56,7 +56,6 @@ class ListController extends AbstractWizardController
      */
     public function __construct()
     {
-        parent::__construct();
         $this->getLanguageService()->includeLLFile('EXT:lang/Resources/Private/Language/locallang_wizards.xlf');
         $GLOBALS['SOBE'] = $this;
         $this->P = GeneralUtility::_GP('P');
index 9fe0d13..5b22961 100644 (file)
@@ -17,6 +17,7 @@ namespace TYPO3\CMS\Backend\Controller\Wizard;
 use Psr\Http\Message\ResponseInterface;
 use Psr\Http\Message\ServerRequestInterface;
 use TYPO3\CMS\Backend\Template\Components\ButtonBar;
+use TYPO3\CMS\Backend\Template\ModuleTemplate;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools;
 use TYPO3\CMS\Core\DataHandling\DataHandler;
@@ -104,11 +105,18 @@ class TableController extends AbstractWizardController
     protected $iconFactory;
 
     /**
+     * ModuleTemplate object
+     *
+     * @var ModuleTemplate
+     */
+    protected $moduleTemplate;
+
+    /**
      * Constructor
      */
     public function __construct()
     {
-        parent::__construct();
+        $this->moduleTemplate = GeneralUtility::makeInstance(ModuleTemplate::class);
         $this->getLanguageService()->includeLLFile('EXT:lang/Resources/Private/Language/locallang_wizards.xlf');
         $GLOBALS['SOBE'] = $this;
 
index aeae8ab..e73108b 100644 (file)
@@ -25,6 +25,7 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
  * template and comes with a simple dispatcher method.
  *
  * @internal Experimental for now
+ * @deprecated
  */
 class AbstractModule
 {
@@ -40,6 +41,11 @@ class AbstractModule
      */
     public function __construct()
     {
+        trigger_error(
+            'Class AbstractModule is deprecated since TYPO3 v9 and will be removed with TYPO3 v10.'
+            . ' Instantiate ModuleTemplate yourself if needed and use routing registered in Routes.php.',
+            E_USER_DEPRECATED
+        );
         $this->moduleTemplate = GeneralUtility::makeInstance(ModuleTemplate::class);
     }
 
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Breaking-82689-BackendAbstractWizardControllerNotExtendsAbstractModule.rst b/typo3/sysext/core/Documentation/Changelog/master/Breaking-82689-BackendAbstractWizardControllerNotExtendsAbstractModule.rst
new file mode 100644 (file)
index 0000000..0924d1b
--- /dev/null
@@ -0,0 +1,44 @@
+.. include:: ../../Includes.txt
+
+==============================================================================
+Breaking: #82689 - Backend AbstractWizardController not extends AbstractModule
+==============================================================================
+
+See :issue:`82689`
+
+Description
+===========
+
+The PHP class :php:`TYPO3\CMS\Backend\Controller\Wizard\AbstractWizardController` no
+longer extends class :php:`TYPO3\CMS\Backend\Module\AbstractModule`. This can be breaking
+if wizard classes of extensions depend on method :php:`processRequest()` or the initialized
+property :php:`moduleTemplate`.
+
+PHP class :php:`TYPO3\CMS\Backend\Module\AbstractModule` has been deprecated and should not be used any longer.
+
+
+Impact
+======
+
+* Using class :php:`AbstractModule` will throw a deprecation warning
+* Extensions with wizards extending class :php:`AbstractWizardController`
+  may fatal if they use property :php:`moduleTemplate`
+* Extensions with wizards extending class :php:`AbstractWizardController`
+  may fatal if they use they registered routes to method :php:`processRequest`
+
+
+Affected Installations
+======================
+
+Installations with extensions with one of the above described patterns.
+
+
+Migration
+=========
+
+Extensions that extend :php:`AbstractModule` should initialize :php:`moduleTemplate`
+at an appropriate place instead. Instead of :php:`processRequest()`, routes should be
+registered in an extensions :file:`Configuration/Backend/Routes.php` and
+:file:`Configuration/Backend/AjaxRoutes.php`.
+
+.. index:: Backend, PHP-API, PartiallyScanned
\ No newline at end of file
index 3f2af70..63b7b69 100644 (file)
@@ -384,6 +384,11 @@ return [
             'Breaking-82406-RoutingBackendModulesRunThroughRegularDispatcher.rst',
         ],
     ],
+    'TYPO3\CMS\Backend\Module\AbstractModule' => [
+        'restFiles' => [
+            'Breaking-82689-BackendAbstractWizardControllerNotExtendsAbstractModule.rst',
+        ],
+    ],
 
     // Removed interfaces
     'TYPO3\CMS\Backend\Form\DatabaseFileIconsHookInterface' => [
index 3e184c9..9a31f6b 100644 (file)
@@ -226,8 +226,6 @@ class LinkValidatorReport extends \TYPO3\CMS\Backend\Module\AbstractFunctionModu
             ];
         }
 
-        // @todo: Use $this-moduleTemplate as soon as this class extends from AbstractModule
-        /** @var ModuleTemplate $moduleTemplate */
         $moduleTemplate = GeneralUtility::makeInstance(ModuleTemplate::class);
         return $moduleTemplate->getDynamicTabMenu($menuItems, 'report-linkvalidator');
     }
index 01f011c..f9f4b1f 100644 (file)
@@ -17,7 +17,6 @@ namespace TYPO3\CMS\Recordlist;
 use Psr\Http\Message\ResponseInterface;
 use Psr\Http\Message\ServerRequestInterface;
 use TYPO3\CMS\Backend\Clipboard\Clipboard;
-use TYPO3\CMS\Backend\Module\AbstractModule;
 use TYPO3\CMS\Backend\Template\Components\ButtonBar;
 use TYPO3\CMS\Backend\Template\DocumentTemplate;
 use TYPO3\CMS\Backend\Template\ModuleTemplate;
@@ -37,7 +36,7 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
 /**
  * Script Class for the Web > List module; rendering the listing of records on a page
  */
-class RecordList extends AbstractModule
+class RecordList
 {
     /**
      * Page Id for which to make the listing
@@ -188,11 +187,18 @@ class RecordList extends AbstractModule
     protected $iconFactory;
 
     /**
+     * ModuleTemplate object
+     *
+     * @var ModuleTemplate
+     */
+    protected $moduleTemplate;
+
+    /**
      * Constructor
      */
     public function __construct()
     {
-        parent::__construct();
+        $this->moduleTemplate = GeneralUtility::makeInstance(ModuleTemplate::class);
         $this->getLanguageService()->includeLLFile('EXT:lang/Resources/Private/Language/locallang_mod_web_list.xlf');
         $this->moduleTemplate->getPageRenderer()->loadJquery();
         $this->moduleTemplate->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Recordlist/FieldSelectBox');
index d4a710a..a7904ef 100644 (file)
@@ -17,8 +17,8 @@ namespace TYPO3\CMS\Setup\Controller;
 use Psr\Http\Message\ResponseInterface;
 use Psr\Http\Message\ServerRequestInterface;
 use TYPO3\CMS\Backend\Backend\Avatar\DefaultAvatarProvider;
-use TYPO3\CMS\Backend\Module\AbstractModule;
 use TYPO3\CMS\Backend\Module\ModuleLoader;
+use TYPO3\CMS\Backend\Template\ModuleTemplate;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
 use TYPO3\CMS\Core\Database\ConnectionPool;
@@ -36,7 +36,7 @@ use TYPO3\CMS\Saltedpasswords\Salt\SaltFactory;
 /**
  * Script class for the Setup module
  */
-class SetupModuleController extends AbstractModule
+class SetupModuleController
 {
     /**
      * Flag if password has not been updated
@@ -166,11 +166,18 @@ class SetupModuleController extends AbstractModule
     protected $beUser;
 
     /**
+     * ModuleTemplate object
+     *
+     * @var ModuleTemplate
+     */
+    protected $moduleTemplate;
+
+    /**
      * Instantiate the form protection before a simulated user is initialized.
      */
     public function __construct()
     {
-        parent::__construct();
+        $this->moduleTemplate = GeneralUtility::makeInstance(ModuleTemplate::class);
         $this->formProtection = FormProtectionFactory::get();
         $pageRenderer = $this->moduleTemplate->getPageRenderer();
         $pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/Modal');