Project

General

Profile

Actions

Bug #93321

closed

SignalSlotDeprecator blocks TYPO3

Added by Franz Holzinger almost 4 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
System/Bootstrap/Configuration
Target version:
-
Start date:
2021-01-19
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
10
PHP Version:
7.3
Tags:
blocker
Complexity:
medium
Is Regression:
Sprint Focus:

Description

The middleware SignalSlotDeprecator requires a constructor parameter $dispatcher. However this paramter is not provided. This raises an exception which makes the backend and install tool unusable.
I could formerly log into the TYPO3 backend. Then I activated an extension. Later I deactivated this extension again. I have also removed all the typo3temp cache code files.


(1/1) ArgumentCountError

Too few arguments to function TYPO3\CMS\Extbase\Middleware\SignalSlotDeprecator::__construct(), 0 passed in /var/www/html/develop/typo3_src-10.4.12/typo3/sysext/core/Classes/Utility/GeneralUtility.php on line 3431 and exactly 1 expected
in /var/www/html/develop/typo3_src-10.4.12/typo3/sysext/extbase/Classes/Middleware/SignalSlotDeprecator.php line 36

     * @var Dispatcher
     */
    protected $dispatcher;

    public function __construct(Dispatcher $dispatcher)
    {
        $this->dispatcher = $dispatcher;
    }

at TYPO3\CMS\Extbase\Middleware\SignalSlotDeprecator->__construct()
in /var/www/html/develop/typo3_src-10.4.12/typo3/sysext/core/Classes/Utility/GeneralUtility.php line 3431

            return self::$container->get($className);
        }

        // Create new instance and call constructor with parameters
        $instance = new $finalClassName(...$constructorArguments);
        // Register new singleton instance, but only if it is not a known PSR-11 container service
        if ($instance instanceof SingletonInterface && !(self::$container !== null && self::$container->has($className))) {
            self::$singletonInstances[$finalClassName] = $instance;
        }

at TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Middleware\\SignalSlotDeprecator')
in /var/www/html/develop/typo3_src-10.4.12/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php line 166

            {
                if ($this->container !== null && $this->container->has($this->middleware)) {
                    $middleware = $this->container->get($this->middleware);
                } else {
                    $middleware = GeneralUtility::makeInstance($this->middleware);
                }

                if (!$middleware instanceof MiddlewareInterface) {
                    throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342);

at class@anonymous/var/www/html/develop/typo3_src-10.4.12/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php0x7f892ebec41b->handle(object(TYPO3\CMS\Core\Http\ServerRequest))
in /var/www/html/develop/typo3_src-10.4.12/typo3/sysext/backend/Classes/Middleware/SiteResolver.php line 69

            }
            $site = $this->siteMatcher->matchByPageId($pageId, $rootLine);
            $request = $request->withAttribute('site', $site);
        }
        return $handler->handle($request);
    }
}

at TYPO3\CMS\Backend\Middleware\SiteResolver->process(object(TYPO3\CMS\Core\Http\ServerRequest), object(class@anonymous/var/www/html/develop/typo3_src-10.4.12/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php0x7f892ebec41b))
in /var/www/html/develop/typo3_src-10.4.12/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php line 172

                if (!$middleware instanceof MiddlewareInterface) {
                    throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342);
                }
                return $middleware->process($request, $this->next);
            }
        };
    }
}

at class@anonymous/var/www/html/develop/typo3_src-10.4.12/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php0x7f892ebec41b->handle(object(TYPO3\CMS\Core\Http\ServerRequest))
in /var/www/html/develop/typo3_src-10.4.12/typo3/sysext/backend/Classes/Middleware/AdditionalResponseHeaders.php line 41

     * @return ResponseInterface
     */
    public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        $response = $handler->handle($request);
        foreach ($GLOBALS['TYPO3_CONF_VARS']['BE']['HTTP']['Response']['Headers'] ?? [] as $header) {
            [$headerName, $value] = explode(':', $header, 2);
            $response = $response->withAddedHeader($headerName, trim($value));
        }

at TYPO3\CMS\Backend\Middleware\AdditionalResponseHeaders->process(object(TYPO3\CMS\Core\Http\ServerRequest), object(class@anonymous/var/www/html/develop/typo3_src-10.4.12/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php0x7f892ebec41b))
in /var/www/html/develop/typo3_src-10.4.12/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php line 172

                if (!$middleware instanceof MiddlewareInterface) {
                    throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342);
                }
                return $middleware->process($request, $this->next);
            }
        };
    }
}

at class@anonymous/var/www/html/develop/typo3_src-10.4.12/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php0x7f892ebec41b->handle(object(TYPO3\CMS\Core\Http\ServerRequest))
in /var/www/html/develop/typo3_src-10.4.12/typo3/sysext/backend/Classes/Middleware/OutputCompression.php line 47

        ob_clean();
        // Initialize output compression if configured
        $this->initializeOutputCompression();

        return $handler->handle($request);
    }

    /**
     * Initialize output compression if configured

at TYPO3\CMS\Backend\Middleware\OutputCompression->process(object(TYPO3\CMS\Core\Http\ServerRequest), object(class@anonymous/var/www/html/develop/typo3_src-10.4.12/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php0x7f892ebec41b))
in /var/www/html/develop/typo3_src-10.4.12/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php line 172

                if (!$middleware instanceof MiddlewareInterface) {
                    throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342);
                }
                return $middleware->process($request, $this->next);
            }
        };
    }
}

at class@anonymous/var/www/html/develop/typo3_src-10.4.12/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php0x7f892ebec41b->handle(object(TYPO3\CMS\Core\Http\ServerRequest))
in /var/www/html/develop/typo3_src-10.4.12/typo3/sysext/backend/Classes/Middleware/BackendUserAuthenticator.php line 78

        $GLOBALS['LANG'] = LanguageService::createFromUserPreferences($GLOBALS['BE_USER']);
        // Re-setting the user and take the workspace from the user object now
        $this->setBackendUserAspect($GLOBALS['BE_USER']);

        $response = $handler->handle($request);

        // If no backend user is logged-in, the cookie should be removed
        if (!GeneralUtility::makeInstance(Context::class)->getAspect('backend.user')->isLoggedIn()) {
            $GLOBALS['BE_USER']->removeCookie($GLOBALS['BE_USER']->name);

at TYPO3\CMS\Backend\Middleware\BackendUserAuthenticator->process(object(TYPO3\CMS\Core\Http\ServerRequest), object(class@anonymous/var/www/html/develop/typo3_src-10.4.12/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php0x7f892ebec41b))
in /var/www/html/develop/typo3_src-10.4.12/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php line 172

                if (!$middleware instanceof MiddlewareInterface) {
                    throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342);
                }
                return $middleware->process($request, $this->next);
            }
        };
    }
}

at class@anonymous/var/www/html/develop/typo3_src-10.4.12/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php0x7f892ebec41b->handle(object(TYPO3\CMS\Core\Http\ServerRequest))
in /var/www/html/develop/typo3_src-10.4.12/typo3/sysext/backend/Classes/Middleware/BackendRouteInitialization.php line 58

        // Add the route path to the request
        $request = $request->withAttribute('routePath', $pathToRoute);

        return $handler->handle($request);
    }
}

at TYPO3\CMS\Backend\Middleware\BackendRouteInitialization->process(object(TYPO3\CMS\Core\Http\ServerRequest), object(class@anonymous/var/www/html/develop/typo3_src-10.4.12/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php0x7f892ebec41b))
in /var/www/html/develop/typo3_src-10.4.12/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php line 172

                if (!$middleware instanceof MiddlewareInterface) {
                    throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342);
                }
                return $middleware->process($request, $this->next);
            }
        };
    }
}

at class@anonymous/var/www/html/develop/typo3_src-10.4.12/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php0x7f892ebec41b->handle(object(TYPO3\CMS\Core\Http\ServerRequest))
in /var/www/html/develop/typo3_src-10.4.12/typo3/sysext/backend/Classes/Middleware/ForcedHttpsBackendRedirector.php line 55

            [$server, $address] = explode('/', $url, 2);
            return new RedirectResponse('https://' . $server . $sslPortSuffix . '/' . $address);
        }

        return $handler->handle($request);
    }
}

at TYPO3\CMS\Backend\Middleware\ForcedHttpsBackendRedirector->process(object(TYPO3\CMS\Core\Http\ServerRequest), object(class@anonymous/var/www/html/develop/typo3_src-10.4.12/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php0x7f892ebec41b))
in /var/www/html/develop/typo3_src-10.4.12/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php line 172

                if (!$middleware instanceof MiddlewareInterface) {
                    throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342);
                }
                return $middleware->process($request, $this->next);
            }
        };
    }
}

at class@anonymous/var/www/html/develop/typo3_src-10.4.12/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php0x7f892ebec41b->handle(object(TYPO3\CMS\Core\Http\ServerRequest))
in /var/www/html/develop/typo3_src-10.4.12/typo3/sysext/backend/Classes/Middleware/LockedBackendGuard.php line 73

            $request->getAttribute('normalizedParams')->getRemoteAddress(),
            trim((string)$GLOBALS['TYPO3_CONF_VARS']['BE']['IPmaskList'])
        );

        return $handler->handle($request);
    }

    /**
     * Check adminOnly configuration variable and redirects to an URL in file typo3conf/LOCK_BACKEND

at TYPO3\CMS\Backend\Middleware\LockedBackendGuard->process(object(TYPO3\CMS\Core\Http\ServerRequest), object(class@anonymous/var/www/html/develop/typo3_src-10.4.12/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php0x7f892ebec41b))
in /var/www/html/develop/typo3_src-10.4.12/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php line 172

                if (!$middleware instanceof MiddlewareInterface) {
                    throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342);
                }
                return $middleware->process($request, $this->next);
            }
        };
    }
}

at class@anonymous/var/www/html/develop/typo3_src-10.4.12/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php0x7f892ebec41b->handle(object(TYPO3\CMS\Core\Http\ServerRequest))
in /var/www/html/develop/typo3_src-10.4.12/typo3/sysext/core/Classes/Middleware/NormalizedParamsAttribute.php line 45

     */
    public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        $request = $request->withAttribute('normalizedParams', NormalizedParams::createFromRequest($request));
        return $handler->handle($request);
    }
}

at TYPO3\CMS\Core\Middleware\NormalizedParamsAttribute->process(object(TYPO3\CMS\Core\Http\ServerRequest), object(class@anonymous/var/www/html/develop/typo3_src-10.4.12/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php0x7f892ebec41b))
in /var/www/html/develop/typo3_src-10.4.12/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php line 172

                if (!$middleware instanceof MiddlewareInterface) {
                    throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342);
                }
                return $middleware->process($request, $this->next);
            }
        };
    }
}

at class@anonymous/var/www/html/develop/typo3_src-10.4.12/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php0x7f892ebec41b->handle(object(TYPO3\CMS\Core\Http\ServerRequest))
in /var/www/html/develop/typo3_src-10.4.12/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php line 78

     * @return ResponseInterface
     */
    public function handle(ServerRequestInterface $request): ResponseInterface
    {
        return $this->tip->handle($request);
    }

    /**
     * Seed the middleware stack with the inner request handler

at TYPO3\CMS\Core\Http\MiddlewareDispatcher->handle(object(TYPO3\CMS\Core\Http\ServerRequest))
in /var/www/html/develop/typo3_src-10.4.12/typo3/sysext/core/Classes/Http/AbstractApplication.php line 85

     * @return ResponseInterface
     */
    protected function handle(ServerRequestInterface $request): ResponseInterface
    {
        return $this->requestHandler->handle($request);
    }

    /**
     * Set up the application and shut it down afterwards

at TYPO3\CMS\Core\Http\AbstractApplication->handle(object(TYPO3\CMS\Core\Http\ServerRequest))
in /var/www/html/develop/typo3_src-10.4.12/typo3/sysext/backend/Classes/Http/Application.php line 72

        $request = $request->withAttribute('applicationType', $applicationType);

        // Set up the initial context
        $this->initializeContext();
        return parent::handle($request);
    }

    /**
     * Check if LocalConfiguration.php and PackageStates.php exist

at TYPO3\CMS\Backend\Http\Application->handle(object(TYPO3\CMS\Core\Http\ServerRequest))
in /var/www/html/develop/typo3_src-10.4.12/typo3/sysext/core/Classes/Http/AbstractApplication.php line 97

    final public function run(callable $execute = null)
    {
        try {
            $response = $this->handle(
                ServerRequestFactory::fromGlobals()
            );
            if ($execute !== null) {
                call_user_func($execute);
            }

at TYPO3\CMS\Core\Http\AbstractApplication->run()
in /var/www/html/develop/typo3_src-10.4.12/typo3/index.php line 25

// Set up the application for the backend
call_user_func(function () {
    $classLoader = require dirname(__DIR__).'/vendor/autoload.php';
    \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::run(1, \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::REQUESTTYPE_BE);
    \TYPO3\CMS\Core\Core\Bootstrap::init($classLoader)->get(\TYPO3\CMS\Backend\Http\Application::class)->run();
});

at {closure}()
in /var/www/html/develop/typo3_src-10.4.12/typo3/index.php line 26

call_user_func(function () {
    $classLoader = require dirname(__DIR__).'/vendor/autoload.php';
    \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::run(1, \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::REQUESTTYPE_BE);
    \TYPO3\CMS\Core\Core\Bootstrap::init($classLoader)->get(\TYPO3\CMS\Backend\Http\Application::class)->run();
});


Files

patch-93321.diff (1.02 KB) patch-93321.diff create instance of signalSlotDispatcher Franz Holzinger, 2021-01-20 21:42
Actions #1

Updated by Franz Holzinger almost 4 years ago

  • Category set to System/Bootstrap/Configuration
  • Tags set to blocker
  • Complexity set to hard
Actions #2

Updated by Franz Holzinger almost 4 years ago

Here is a patch.

\TYPO3\CMS\Extbase\Middleware\SignalSlotDeprecator needs an \TYPO3\CMS\Extbase\SignalSlot\Dispatcher object as the parameter for the constructor.

Actions #3

Updated by Benni Mack about 3 years ago

  • Status changed from New to Needs Feedback

Hey Franz,

I am not able to reproduce this issue. Where is the error located? What is your error logging configuration?

Actions #4

Updated by Franz Holzinger about 3 years ago

This error cannot be reproduced any more because another patch has been introduced. The error which had caused to the logger to be called is caught now. See the conversation at Slack about it.
There has been an exception inside of an exception.
This does not happen any more because of the other patch.

However it would be fine if my patch could be taken into TYPO3, because something is wrong.

Actions #5

Updated by Christian Kuhn almost 3 years ago

  • Status changed from Needs Feedback to Closed

hey. v10 is in 'critical issues only mode' and the signal slot dispatcher is gone in v11. i hope it's ok to close the issue.

Actions

Also available in: Atom PDF