diff --git a/CHANGELOG.md b/CHANGELOG.md index 8dead57..cac1f49 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,12 @@ # Changelog All notable changes to this project will be documented in this file. +## [1.0.2] - 2018-03-22 + +### Fixed +- fixed call of `parent::__construct` with empty properties + ## [1.0.1] - 2018-03-12 ### Fixed -- removed `heimrichhannot/contao-utils-bundle` circular dependency \ No newline at end of file +- removed `heimrichhannot/contao-utils-bundle` circular dependency diff --git a/src/Component/HttpFoundation/Request.php b/src/Component/HttpFoundation/Request.php index 32b2ee6..cc191ac 100644 --- a/src/Component/HttpFoundation/Request.php +++ b/src/Component/HttpFoundation/Request.php @@ -47,11 +47,10 @@ public function __construct(ContaoFrameworkInterface $framework, RequestStack $r $this->framework = $framework; $this->scopeMatcher = $scopeMatcher; - $request = $requestStack->getCurrentRequest(); - parent::__construct($request->query->all(), $request->request->all(), $request->attributes->all(), $request->cookies->all(), $request->files->all(), $request->server->all(), $request->getContent()); + parent::__construct($request->query ? $request->query->all() : [], $request->request ? $request->request->all() : [], $request->attributes ? $request->attributes->all() : [], $request->cookies ? $request->cookies->all() : [], $request->files ? $request->files->all() : [], $request->server ? $request->server->all() : [], $request ? $request->getContent() : null); // As long as contao adds unused parameters to $_GET and $_POST Globals inside \Contao\Input, we have to add them inside custom ParameterBag classes - $this->query = new QueryParameterBag($request->query->all()); + $this->query = new QueryParameterBag($request->query ? $request->query->all() : []); } /**