Skip to content

Commit f1e2832

Browse files
Franz Holzingersbuerk
authored andcommitted
[DOCS] Use ServerRequestInterface $request parameter in AbstractPlugin
The example of the breaking change to AbstractPlugin (removed in v13) is missing the third parameter `$request`. It is passed to the TS userfunc execution [1] [2]. This patch makes the migration example more complete for v12 instances. [1] https://docs.typo3.org/m/typo3/reference-coreapi/12.4/en-us/ApiOverview/RequestLifeCycle/Typo3Request.html#user-function [2] https://review.typo3.org/c/Packages/TYPO3.CMS/+/66080 Releases: main, 13.4, 12.4 Resolves: #105880 Related: #92984 Change-Id: I27a2fe9d6ee0c8b25d229a4832382ababbc8cc75 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/87628 Tested-by: Stefan Bürk <stefan@buerk.tech> Reviewed-by: Garvin Hicking <gh@faktor-e.de> Reviewed-by: Stefan Bürk <stefan@buerk.tech> Tested-by: Garvin Hicking <gh@faktor-e.de> Tested-by: core-ci <typo3@b13.com>
1 parent 5be9db3 commit f1e2832

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

typo3/sysext/core/Documentation/Changelog/12.0/Breaking-98281-MakeAbstractPluginInternal.rst

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,15 @@ Class before migration:
4949
.. code-block:: php
5050
:caption: EXT:gh_randomcontent/Classes/Plugin/RandomContent.php
5151
52+
use Psr\Http\Message\ServerRequestInterface;
53+
5254
class RandomContent extends AbstractPlugin
5355
{
54-
public function main(string $content, array $conf): string
56+
public function main(
57+
string $content,
58+
array $conf,
59+
ServerRequestInterface $request,
60+
): string
5561
{
5662
$this->conf = $conf;
5763
@@ -75,6 +81,8 @@ Class after migration:
7581
.. code-block:: php
7682
:caption: EXT:gh_randomcontent/Classes/Plugin/RandomContent.php
7783
84+
use Psr\Http\Message\ServerRequestInterface;
85+
7886
class RandomContent
7987
{
8088
/**
@@ -93,7 +101,11 @@ Class after migration:
93101
$this->cObj = $cObj;
94102
}
95103
96-
public function main(string $content, array $conf): string
104+
public function main(
105+
string $content,
106+
array $conf,
107+
ServerRequestInterface $request,
108+
): string
97109
{
98110
$this->conf = $conf;
99111
@@ -134,4 +146,12 @@ It is also possible to migrate to an Extbase plugin using a controller.
134146
See the :ref:`Extbase documentation, chapter
135147
"Frontend Plugins" <t3coreapi:extbase_registration_of_frontend_plugins>`.
136148

149+
.. important::
150+
151+
The `AbstractPlugin` is :ref:`deprecated <deprecation-100639-1681740974>`
152+
through a follow-up change and will be removed in TYPO3 v13. Executing
153+
a plugin via the TypoScript userFunc (also utilized the `$request` argument for
154+
the `main` method) continues to work, as long as the collection of `AbstractPlugin`
155+
methods are ported to the custom user class.
156+
137157
.. index:: Frontend, FullyScanned, ext:frontend

0 commit comments

Comments
 (0)