After Updating from TYPO3 9.5.x LTS and PHP 7.4 to TYPO3 11.5.16 and PHP 8.1 I am getting this error:
get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, string given
I know it's about my Extension (when I disable it the Error disappears), but the further debug Information I are not helping me:
in /html/typo3/typo3_src-11.5.16/typo3/sysext/extbase/Classes/Mvc/ExtbaseRequestParameters.php line 302
// todo: this is nonsense! We can detect a non existing method in
// todo: \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin, if necessary.
// todo: At this point, we want to have a getter for a fixed value.
$actionMethodName = $this->controllerActionName . 'Action';
$classMethods = get_class_methods($controllerObjectName);
if (is_array($classMethods)) {
foreach ($classMethods as $existingMethodName) {
if (strtolower($existingMethodName) === strtolower($actionMethodName)) {
$this->controllerActionName = substr($existingMethodName, 0, -6);
I couldn't find anything searching github, stackoverflow or the web. Anyone else had the same problem or knows where this could come from?
Right after this Post, it came to my Mind to change the PHP Version back to 7.4. With PHP 7.4 I've got a different Error Message ("Class does not exist. Reflection failed.") which leads me to: https://forge.typo3.org/issues/91239
I made the Mistake to Register Plugin With VendorName. Just in case anyone else does it the same way, I've written this answer and would like to keep this Post.
I had the same error, but the reason for it is a different one. Maybe this helps someone else with the same case as mine. This is not meant as answer for the original poster! But the question fits also here.
In the file ext_localconf.php there is a misspelling entered in the Extension Builder's form.
(static function() {
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'MyExtenson',
'Show',
[
\MyVendor\MyExtenson\Controller\ltemController::class => 'index'
],
// non-cacheable actions
[
\MyVendor\MyExtenson\Controller\ltemController::class => 'index'
]
);
There is a lowercase 'L' instead of an uppercase 'I'. The item table is the domain. solution:
(static function() {
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'MyExtenson',
'Show',
[
\MyVendor\MyExtenson\Controller\ItemController::class => 'index'
],
// non-cacheable actions
[
\MyVendor\MyExtenson\Controller\ItemController::class => 'index'
]
);
So check your file ext_localconf.php or ExtensionBuilder.json for the correct spelling.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With