Skip to content

Commit 853fab8

Browse files
[TASK] Descripe argument mapping exception-handling of ActionController (#1588)
* [TASK] Descripe argument mapping exception-handling of ActionController Closes TYPO3-Documentation/Changelog-To-Doc#1038 Releases: main, 13.4 * [TASK] Add extension specific config
1 parent 6c03522 commit 853fab8

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

Documentation/TopLevelObjects/Plugin.rst

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,45 @@ plugins.
225225
Same as :ref:`setup-plugin-mvc-callDefaultActionIfActionCantBeResolved`
226226
but this will raise a "page not found" error.
227227

228+
.. confval:: mvc.showPageNotFoundIfTargetNotFoundException
229+
:name: plugin-mvc-showPageNotFoundIfTargetNotFoundException
230+
:type: :ref:`data-type-boolean`
231+
:Default: `false`
232+
233+
**Only for Extbase plugins**. By default, when calling an extbase controller action
234+
that is not registered for an Extbase plugin, a fatal exception
235+
:php:`TargetNotFoundException` is thrown
236+
(usually an internal error message is shown).
237+
238+
When this configuration option is set to `1` (true), instead the default
239+
"Page not Found" page will be shown instead (with a 404 HTTP header by default).
240+
241+
The configuration option can be either set on the global `config.tx_extbase`
242+
scope, or also plugin-specific via
243+
`plugin.tx_yourextension.mvc.showPageNotFoundIfTargetNotFoundException` /
244+
`plugin.tx_yourextension_pluginName.mvc.showPageNotFoundIfTargetNotFoundException`.
245+
246+
.. confval:: mvc.showPageNotFoundIfRequiredArgumentIsMissingException
247+
:name: plugin-mvc-showPageNotFoundIfRequiredArgumentIsMissingException
248+
:type: :ref:`data-type-boolean`
249+
:Default: `false`
250+
251+
**Only for Extbase plugins**. By default, when calling an extbase controller action
252+
with missing/invalid required arguments a fatal exception :php:`RequiredArgumentMissingException`
253+
is thrown (usually an internal error message is shown).
254+
255+
When this configuration option is set to `1` (true), instead the default
256+
"Page not Found" page will be shown instead (with a 404 HTTP header by default).
257+
258+
The configuration option can be either set on the global `config.tx_extbase`
259+
scope, or also plugin-specific via
260+
`plugin.tx_yourextension.mvc.showPageNotFoundIfRequiredArgumentIsMissingException` /
261+
`plugin.tx_yourextension_pluginName.mvc.showPageNotFoundIfRequiredArgumentIsMissingException`.
262+
263+
Note that extension authors can also implement the Controller method
264+
:php:`ActionController->handleArgumentMappingExceptions()` to individually operate
265+
on invalid arguments.
266+
228267
.. confval:: format
229268
:name: plugin-format
230269
:type: :ref:`data-type-string`

0 commit comments

Comments
 (0)