Bug #91824

Deprecation of BackendUserAuthentication modAccess() function inconsistent

Added by Sybille Peters 18 days ago. Updated 17 days ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Authentication
Target version:
-
Start date:
2020-07-19
Due date:
% Done:

0%

TYPO3 Version:
11
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Deprecation in TYPO3 9 states:

The second argument of method modAccess() has been marked as deprecated, as the method should not trigger runtime exceptions anymore.

So, it says the function should not trigger runtime messages but since TYPO3 10.4 that is the default behaviour: to trigger the exceptions (without the parameter which is now removed).

In 9, it is not possible to get this behaviour (throws an exception) without triggering a deprecation.

Also, I am not sure if the phpdoc comment is consistent with the code. (in master):

Will return FALSE if the module name is not even found in $TBE_MODULES

If not isModuleSetInTBE_MODULES(), the function will throw an exception as well.

History

#2 Updated by Markus Klein 17 days ago

The original deprecation message in the code said:

Calling BackendUserAuthentication->modAccess() with a second argument is deprecated, as the default behaviour is throwing exceptions, which might get customized in TYPO3 v10.0. Remove the second argument within modAccess() to avoid the deprecation, and ensure to catch the Exception in the callers code.

Does that make it clear for you how to resolve the docs?

#3 Updated by Sybille Peters 17 days ago

Thank you, yes that is much clearer.

I think for the main docs, I have all I need.

Maybe someone else can decide if the changelog should be updated and also the phpdoc header for the function. IMHO the changelog is misleading: https://docs.typo3.org/c/typo3/cms-core/master/en-us/Changelog/9.5/Deprecation-86441-VariousMethodsAndPropertiesInsideBackendUserAuthentication.html

The second argument of method modAccess() has been marked as deprecated, as the method should not trigger runtime exceptions anymore.

#4 Updated by Markus Klein 17 days ago

For the time being I would say that this information is obsolete, since v10 is our current stable. New projects are using v10 and therefore this intermediate description of v9 is pointless now, you have to deal with the v10 behaviour.

Also available in: Atom PDF