MicroPresenter: throws BadRequestException on invalid argument

HonzaN
Člen | 64
+
0
-

Ahoj,

po aktualizaci Nette\Application na verzi 3.0.7 dostávám chybu Nette\Application\BadRequestException #404 / Missing parameter $hash required by getImage() z MicroPresenteru z řádku 93

$params = Application\UI\ComponentReflection::combineArgs($reflection, $params);

Na MicroPresenter mám nastavenou routu tímhle způsobem a tuším že tu bude nějaký problém s předáváním parametrů metodě getImage() třídy ImageResample. Pokud pro uvedenou routu použiju nějaký existující presenter, parametry z routeru dostanu a všechno funguje jak má.

 new Route($this->publicDir . '/<folder \d+>/<hash [a-z0-9-]{32}>-<width \d+>x<height \d+>[x<algorithm>].<ext>', [
			'presenter' => 'Nette:Micro',
			'callback' => Closure::fromCallable([$this->imageResample, 'getImage']),
		]);

Metoda getImage vypadá takhle

	public function getImage(string $hash, int $width, int $height, ?string $algorithm = null): void
	{

Zvláštní je že routa pro MicroPresenter má match a parametry naparsuje dobře.

Nette:Micro:default
folder = 1
hash = bd6f84872f2d0cd0f28fbb10ca9d8373
width = 800
height = 600
algorithm = fit
ext = jpg
callback = Closure

Budu rád za pomoc.

Editoval HonzaN (8. 11. 2020 22:42)