Bugfix
This commit is contained in:
@@ -4,7 +4,6 @@ namespace MummertMedia\ContaoMeilisearchBundle\Controller\FrontendModule;
|
||||
|
||||
use Contao\Config;
|
||||
use Contao\CoreBundle\Controller\FrontendModule\AbstractFrontendModuleController;
|
||||
use Contao\FrontendTemplate;
|
||||
use Contao\ModuleModel;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
@@ -16,11 +15,7 @@ class MeilisearchSearchController extends AbstractFrontendModuleController
|
||||
ModuleModel $model,
|
||||
Request $request
|
||||
): Response {
|
||||
// In Contao 4.13 ist $template immer FrontendTemplate
|
||||
if (!$template instanceof FrontendTemplate) {
|
||||
throw new \RuntimeException('Expected FrontendTemplate');
|
||||
}
|
||||
|
||||
// Beide Template-Typen unterstützen Property-Zugriff
|
||||
$template->meiliLimit = (int) ($model->meiliLimit ?: 50);
|
||||
$template->meiliHost = Config::get('meilisearch_host');
|
||||
$template->meiliIndex = Config::get('meilisearch_index');
|
||||
|
||||
Reference in New Issue
Block a user